Ticket #3823: 3823.patch
File 3823.patch, 2.4 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/gui/session/selection_panels.js
192 192 { 193 193 return 6; 194 194 }, 195 "getItems": function(unitEntState )195 "getItems": function(unitEntStateUNUSED, selection) 196 196 { 197 197 let commands = []; 198 198 199 for (let c in g_EntityCommands)199 for (let cmd in g_EntityCommands) 200 200 { 201 var info = g_EntityCommands[c].getInfo(unitEntState);202 if (!info)203 continue;201 for (let id of selection) 202 { 203 let unitEntState = GetEntityState(id); 204 204 205 info.name = c; 206 commands.push(info); 205 var info = g_EntityCommands[cmd].getInfo(unitEntState); 206 if (!info) 207 continue; 208 209 info.name = cmd; 210 commands.push(info); 211 break; // add each command only once 212 } 207 213 } 208 214 return commands; 209 215 }, -
binaries/data/mods/public/gui/session/unit_commands.js
31 31 * @param unitEntState Entity state of the selected unit with the lowest id. 32 32 * @param payerState Player state 33 33 */ 34 function setupUnitPanel(guiName, unitEntState, playerState )34 function setupUnitPanel(guiName, unitEntState, playerState, selection) 35 35 { 36 36 if (!g_SelectionPanels[guiName]) 37 37 { … … 38 38 error("unknown guiName used '" + guiName + "'"); 39 39 return; 40 40 } 41 let selection = g_Selection.toList();42 41 43 42 var items = g_SelectionPanels[guiName].getItems(unitEntState, selection); 44 43 … … 174 173 ) 175 174 continue; 176 175 177 setupUnitPanel(guiName, entState, playerStates[entState.player] );176 setupUnitPanel(guiName, entState, playerStates[entState.player], selection); 178 177 } 179 178 180 179 supplementalDetailsPanel.hidden = false; … … 184 183 { 185 184 // TODO if there's a second panel needed for a different player 186 185 // we should consider adding the players list to g_SelectionPanels 187 setupUnitPanel("Garrison", entState, playerState );188 setupUnitPanel("AllyCommand", entState, playerState );186 setupUnitPanel("Garrison", entState, playerState, selection); 187 setupUnitPanel("AllyCommand", entState, playerState, selection); 189 188 190 189 supplementalDetailsPanel.hidden = !g_SelectionPanels.Garrison.used; 191 190