Skip to content

Commit

Permalink
for patch v71937
Browse files Browse the repository at this point in the history
Fix settings not showing, option bar toggle styling, and change bot
factory default to dox.
  • Loading branch information
trialq committed Sep 14, 2014
1 parent 43120c3 commit c88f2d6
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 63 deletions.
13 changes: 6 additions & 7 deletions tAutoFactory/modinfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"display_name": "Auto Factory",
"description": "Automatically build units with idle factories, when eco would otherwise be wasted",
"author": "trialq",
"version": "1.8.1",
"build": "68767",
"date": "2014/07/14",
"version": "1.8.2",
"build": "71937",
"date": "2014/09/14",
"signature": "not yet implemented",
"forum": "https://forums.uberent.com/threads/rel-auto-factory.55995/",
"icon": "http://pamods.github.io/icons/tAutoFactory.png",
Expand All @@ -15,17 +15,16 @@
"ui"
],
"scenes": {
"settings": [
"coui://ui/mods/tAutoFactory/settings/init.js"
],
"live_game": [
"coui://ui/mods/tAutoFactory/live_game/init.js"
],
"live_game_options_bar": [
"coui://ui/mods/tAutoFactory/live_game_options_bar/init.js"
],
"settings": [
"coui://ui/mods/tAutoFactory/settings/init.js"
]
},
"id": "tAutoFactory",
"priority": 100,
"enabled": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ var tAutoFactory_op_bar = (function () {
model.tAutoFactory_op_bar = tAutoFactory_op_bar;

//add toggle to live_game bottom bar
$(".div_ingame_options_bar").prepend("<div class=\"btn_ingame_options div_af_toggle_cont\"><a href=\"#\" data-bind=\"click: function () { tAutoFactory_op_bar.active(!tAutoFactory_op_bar.active()); api.Panel.message(api.Panel.parentId, 'aftoggle', tAutoFactory_op_bar.active()?'true':'false'); }\"><!-- ko if: tAutoFactory_op_bar.active() --><img src=\"coui://ui/mods/tAutoFactory/live_game/af_on.png\" /><!-- /ko --><!-- ko ifnot: tAutoFactory_op_bar.active() --><img src=\"coui://ui/mods/tAutoFactory/live_game/af_off.png\" /><!-- /ko --></a></div>");
$(".div_ingame_options_bar_cont").prepend("<div class=\"btn_ingame_options div_af_toggle_cont\"><a href=\"#\" data-bind=\"click: function () { tAutoFactory_op_bar.active(!tAutoFactory_op_bar.active()); api.Panel.message(api.Panel.parentId, 'aftoggle', tAutoFactory_op_bar.active()?'true':'false'); }\"><!-- ko if: tAutoFactory_op_bar.active() --><img src=\"coui://ui/mods/tAutoFactory/live_game/af_on.png\" /><!-- /ko --><!-- ko ifnot: tAutoFactory_op_bar.active() --><img src=\"coui://ui/mods/tAutoFactory/live_game/af_off.png\" /><!-- /ko --></a></div>");

})();
105 changes: 50 additions & 55 deletions tAutoFactory/ui/mods/tAutoFactory/settings/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,255 +2,250 @@

//console.log("af roll call live game settings");

_.extend(api.settings.definitions.ui.settings, {
var af_settings_var = {

tAutoFactory_dd_t1_bot: {
title: 'Auto Factory - T1 Bot Unit Choice',
title: 'T1 Bot Unit Choice',
type: 'select',
options: ['FABBER', 'COMBAT FABBER', 'DOX', 'GRENADIER', 'BOOM', 'NONE'],
default: 'GRENADIER'
default: 'DOX'
},
tAutoFactory_t1_bot_metal: {
title: 'Auto Factory - T1 Bot Metal % Threshold',
title: 'T1 Bot Metal % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},
tAutoFactory_t1_bot_energy: {
title: 'Auto Factory - T1 Bot Energy % Threshold',
title: 'T1 Bot Energy % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},

tAutoFactory_dd_t2_bot: {
title: 'Auto Factory - T2 Bot Unit Choice',
title: 'T2 Bot Unit Choice',
type: 'select',
options: ['ADV FABBER', 'ADV COMBAT FABBER', 'GIL-E', 'SLAMMER', 'BLUEHAWK', 'SAME AS T1'],
default: 'SLAMMER'
},
tAutoFactory_t2_bot_metal: {
title: 'Auto Factory - T2 Bot Metal % Threshold',
title: 'T2 Bot Metal % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},
tAutoFactory_t2_bot_energy: {
title: 'Auto Factory - T2 Bot Energy % Threshold',
title: 'T2 Bot Energy % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},

tAutoFactory_dd_t1_veh: {
title: 'Auto Factory - T1 Vehicle Unit Choice',
title: 'T1 Vehicle Unit Choice',
type: 'select',
options: ['FABBER', 'SKITTER', 'INFERNO', 'SPINNER', 'T1 TANK', 'NONE'],
default: 'T1 TANK'
},
tAutoFactory_t1_veh_metal: {
title: 'Auto Factory - T1 Vehicle Metal % Threshold',
title: 'T1 Vehicle Metal % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},
tAutoFactory_t1_veh_energy: {
title: 'Auto Factory - T1 Vehicle Energy % Threshold',
title: 'T1 Vehicle Energy % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},

tAutoFactory_dd_t2_veh: {
title: 'Auto Factory - T2 Vehicle Unit Choice',
title: 'T2 Vehicle Unit Choice',
type: 'select',
options: ['ADV FABBER', 'VANGUARD', 'SHELLER', 'LEVELER', 'SAME AS T1'],
default: 'LEVELER'
},
tAutoFactory_t2_veh_metal: {
title: 'Auto Factory - T2 Vehicle Metal % Threshold',
title: 'T2 Vehicle Metal % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},
tAutoFactory_t2_veh_energy: {
title: 'Auto Factory - T2 Vehicle Energy % Threshold',
title: 'T2 Vehicle Energy % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},

tAutoFactory_dd_t1_air: {
title: 'Auto Factory - T1 Air Unit Choice',
title: 'T1 Air Unit Choice',
type: 'select',
options: ['FABBER', 'FIREFLY', 'HUMMINGBIRD', 'BUMBLEBEE', 'NONE'],
default: 'HUMMINGBIRD'
},
tAutoFactory_t1_air_metal: {
title: 'Auto Factory - T1 Air Metal % Threshold',
title: 'T1 Air Metal % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},
tAutoFactory_t1_air_energy: {
title: 'Auto Factory - T1 Air Energy % Threshold',
title: 'T1 Air Energy % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},

tAutoFactory_dd_t2_air: {
title: 'Auto Factory - T2 Air Unit Choice',
title: 'T2 Air Unit Choice',
type: 'select',
options: ['ADV FABBER', 'PELICAN', 'KESTREL', 'HORNET', 'SAME AS T1'],
default: 'HORNET'
},
tAutoFactory_t2_air_metal: {
title: 'Auto Factory - T2 Air Metal % Threshold',
title: 'T2 Air Metal % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},
tAutoFactory_t2_air_energy: {
title: 'Auto Factory - T2 Air Energy % Threshold',
title: 'T2 Air Energy % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},

tAutoFactory_dd_t1_nav: {
title: 'Auto Factory - T1 Naval Unit Choice',
title: 'T1 Naval Unit Choice',
type: 'select',
options: ['FABBER', 'SUN FISH', 'NARWHAL', 'ORCA', 'NONE'],
default: 'ORCA'
},
tAutoFactory_t1_nav_metal: {
title: 'Auto Factory - T1 Naval Metal % Threshold',
title: 'T1 Naval Metal % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},
tAutoFactory_t1_nav_energy: {
title: 'Auto Factory - T1 Naval Energy % Threshold',
title: 'T1 Naval Energy % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},

tAutoFactory_dd_t2_nav: {
title: 'Auto Factory - T2 Naval Unit Choice',
title: 'T2 Naval Unit Choice',
type: 'select',
options: ['ADV FABBER', 'LEVIATHAN', 'STINGRAY', 'SAME AS T1'],
default: 'LEVIATHAN'
},
tAutoFactory_t2_nav_metal: {
title: 'Auto Factory - T2 Naval Metal % Threshold',
title: 'T2 Naval Metal % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},
tAutoFactory_t2_nav_energy: {
title: 'Auto Factory - T2 Naval Energy % Threshold',
title: 'T2 Naval Energy % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},

tAutoFactory_dd_t1_orb: {
title: 'Auto Factory - T1 Orbital Unit Choice',
title: 'T1 Orbital Unit Choice',
type: 'select',
options: ['FABBER', 'ASTRAEUS', 'AVENGER', 'RADAR SATELLITE', 'NONE'],
default: 'AVENGER'
},
tAutoFactory_t1_orb_metal: {
title: 'Auto Factory - T1 Orbital Metal % Threshold',
title: 'T1 Orbital Metal % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},
tAutoFactory_t1_orb_energy: {
title: 'Auto Factory - T1 Orbital Energy % Threshold',
title: 'T1 Orbital Energy % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},

tAutoFactory_dd_t2_orb: {
title: 'Auto Factory - T2 Orbital Unit Choice',
title: 'T2 Orbital Unit Choice',
type: 'select',
options: ['ADV RADAR SATELLITE', 'SXX LASER', 'SOLAR ARRAY', 'SAME AS LAUNCHER'],
default: 'SOLAR ARRAY'
},
tAutoFactory_t2_orb_metal: {
title: 'Auto Factory - T2 Orbital Metal % Threshold',
title: 'T2 Orbital Metal % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},
tAutoFactory_t2_orb_energy: {
title: 'Auto Factory - T2 Orbital Energy % Threshold',
title: 'T2 Orbital Energy % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},

tAutoFactory_dd_nuk: {
title: 'Auto Factory - Nuke Launcher Unit Choice',
title: 'Nuke Launcher Unit Choice',
type: 'select',
options: ['NUKE', 'NONE'],
default: 'NUKE'
},
tAutoFactory_nuk_metal: {
title: 'Auto Factory - Nuke Launcher Metal % Threshold',
title: 'Nuke Launcher Metal % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},
tAutoFactory_nuk_energy: {
title: 'Auto Factory - Nuke Launcher Energy % Threshold',
title: 'Nuke Launcher Energy % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},

tAutoFactory_dd_ank: {
title: 'Auto Factory - Anti-Nuke Launcher Unit Choice',
title: 'Anti-Nuke Launcher Unit Choice',
type: 'select',
options: ['ANTI-NUKE', 'NONE'],
default: 'ANTI-NUKE'
},
tAutoFactory_ank_metal: {
title: 'Auto Factory - Anti-Nuke Launcher Metal % Threshold',
title: 'Anti-Nuke Launcher Metal % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},
tAutoFactory_ank_energy: {
title: 'Auto Factory - Anti-Nuke Launcher Energy % Threshold',
title: 'Anti-Nuke Launcher Energy % Threshold',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
}

};

/*
tAutoFactory_: {
title: 'Auto Factory - ',
type: 'select',
options: [],
default: ''
},
tAutoFactory_: {
title: 'Auto Factory - ',
type: 'slider',
options: {min:1, max:99, step:1},
default: 80
},
*/

});
_.extend(api.settings.definitions.ui.settings, af_settings_var);

//fix for settings not shown
//model.settingGroups.notifySubscribers(); }));
model.settingDefinitions(api.settings.definitions)
model.settingDefinitions(api.settings.definitions);


var $group = $('<div class="sub-group"></div>').appendTo('.option-list.ui .form-group');
$group.append('<div class="sub-group-title">Auto Factory</div>');

Object.keys(af_settings_var).forEach(function(setting) {
$group.append('<div class="option" data-bind="template: { name: \'setting-template\', data: $root.settingsItemMap()[\'ui.' + setting + '\'] }"></div>')
});

})()

0 comments on commit c88f2d6

Please sign in to comment.