Ticket #4129: 4129.diff
File 4129.diff, 2.8 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/gui/session/hotkeys/misc.xml
54 54 <action on="Press">stopUnits(g_Selection.toList());</action> 55 55 </object> 56 56 57 57 <!-- Find idle warrior - TODO: Potentially move this to own UI button? --> 58 58 <object hotkey="selection.idlewarrior"> 59 <action on="Press">findIdleUnit( ["Hero", "Champion", "CitizenSoldier", "Siege", "Warship", "Dog"]);</action>59 <action on="Press">findIdleUnit(g_MilitaryTypes);</action> 60 60 </object> 61 61 62 62 <object hotkey="selection.cancel"> 63 63 <action on="Press">clearSelection();</action> 64 64 </object> -
binaries/data/mods/public/gui/session/input.js
var unitFilters = { 447 447 }, 448 448 "isDefensive": entity => { 449 449 var entState = GetEntityState(entity); 450 450 return entState && hasClass(entState, "Defensive"); 451 451 }, 452 "is NotSupport": entity => {452 "isMil": entity => { 453 453 var entState = GetEntityState(entity); 454 455 454 return entState && 456 hasClass(entState, "Unit") && 457 !hasClass(entState, "Support") && 458 !hasClass(entState, "Domestic"); 455 g_MilitaryTypes.some(c => hasClass(entState, c)); 459 456 }, 460 457 "isIdle": entity => { 461 458 var entState = GetEntityState(entity); 462 459 463 460 return entState && … … function getPreferredEntities(ents) 478 475 // Default filters 479 476 var filters = [unitFilters.isUnit, unitFilters.isDefensive, unitFilters.isAnything]; 480 477 481 478 // Handle hotkeys 482 479 if (Engine.HotkeyIsPressed("selection.milonly")) 483 filters = [unitFilters.is NotSupport];480 filters = [unitFilters.isMil]; 484 481 if (Engine.HotkeyIsPressed("selection.idleonly")) 485 482 filters = [unitFilters.isIdle]; 486 483 487 484 var preferredEnts = []; 488 485 for (var i = 0; i < filters.length; ++i) -
binaries/data/mods/public/gui/session/session.js
var g_Heroes = []; 143 143 144 144 /** 145 145 * Unit classes to be checked for the idle-worker-hotkey. 146 146 */ 147 147 var g_WorkerTypes = ["Female", "Trader", "FishingBoat", "CitizenSoldier"]; 148 148 /** 149 * Unit classes to be checked for the military-only-selection modifier and for the idle-warrior-hotkey. 150 */ 151 var g_MilitaryTypes = ["Hero", "Champion", "CitizenSoldier", "Mercenary", "Siege", "Warship", "Dog"]; 149 152 /** 150 153 * Cache the idle worker status. 151 154 */ 152 155 var g_HasIdleWorker = false; 153 156