Ticket #3823: 3823_rebased.patch
File 3823_rebased.patch, 2.5 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/gui/session/selection_panels.js
175 175 { 176 176 return 6; 177 177 }, 178 "getItems": function(unitEntState )178 "getItems": function(unitEntStateUNUSED, selection) 179 179 { 180 180 let commands = []; 181 181 182 for (let c in g_EntityCommands)182 for (let cmd in g_EntityCommands) 183 183 { 184 let info = g_EntityCommands[c].getInfo(unitEntState); 185 if (!info) 186 continue; 184 for (let id of selection) 185 { 186 let unitEntState = GetEntityState(id); 187 let info = g_EntityCommands[cmd].getInfo(unitEntState); 188 if (!info) 189 continue; 187 190 188 info.name = c; 189 commands.push(info); 191 info.name = cmd; 192 commands.push(info); 193 break; 194 } 190 195 } 191 196 return commands; 192 197 }, -
binaries/data/mods/public/gui/session/unit_commands.js
47 47 * @param unitEntState Entity state of the selected unit with the lowest id. 48 48 * @param payerState Player state 49 49 */ 50 function setupUnitPanel(guiName, unitEntState, playerState )50 function setupUnitPanel(guiName, unitEntState, playerState, selection) 51 51 { 52 52 if (!g_SelectionPanels[guiName]) 53 53 { … … 55 55 return; 56 56 } 57 57 58 let selection = g_Selection.toList();59 58 let items = g_SelectionPanels[guiName].getItems(unitEntState, selection); 60 59 61 60 if (!items || !items.length) … … 145 144 g_SelectionPanels[guiName].conflictsWith.some(p => g_SelectionPanels[p].used)) 146 145 continue; 147 146 148 setupUnitPanel(guiName, entState, playerStates[entState.player] );147 setupUnitPanel(guiName, entState, playerStates[entState.player], selection); 149 148 } 150 149 151 150 supplementalDetailsPanel.hidden = false; … … 155 154 { 156 155 // TODO if there's a second panel needed for a different player 157 156 // we should consider adding the players list to g_SelectionPanels 158 setupUnitPanel("Garrison", entState, playerState );159 setupUnitPanel("AllyCommand", entState, playerState );157 setupUnitPanel("Garrison", entState, playerState, selection); 158 setupUnitPanel("AllyCommand", entState, playerState, selection); 160 159 161 160 supplementalDetailsPanel.hidden = !g_SelectionPanels.Garrison.used; 162 161