Ticket #1206: #1206-2012-03-18.patch
File #1206-2012-03-18.patch, 3.2 KB (added by , 12 years ago) |
---|
-
binaries/data/mods/public/gui/session/input.js
1403 1403 resetIdleUnit(); 1404 1404 } 1405 1405 1406 function unload(garrisonHolder, entit y)1406 function unload(garrisonHolder, entities) 1407 1407 { 1408 Engine.PostNetworkCommand({"type": "unload", "entity": entity, "garrisonHolder": garrisonHolder}); 1408 // We just remove the first unit if session.batchtrain isn't pressed 1409 if (Engine.HotkeyIsPressed("session.batchtrain")) 1410 Engine.PostNetworkCommand({"type": "unload", "entities": entities, "garrisonHolder": garrisonHolder}); 1411 else 1412 Engine.PostNetworkCommand({"type": "unload", "entities": [entities[0]], "garrisonHolder": garrisonHolder}); 1409 1413 } 1410 1414 1411 1415 function unloadAll(garrisonHolder) -
binaries/data/mods/public/gui/session/unit_commands.js
226 226 227 227 case GARRISON: 228 228 var name = getEntityName(template); 229 var tooltip = "Unload " + getEntityName(template) ;229 var tooltip = "Unload " + getEntityName(template) + "\nSingle-click to unload 1. Shift-click to unload all of this type"; 230 230 var count = garrisonGroups.getCount(item); 231 231 getGUIObjectByName("unit"+guiName+"Count["+i+"]").caption = (count > 1 ? count : ""); 232 232 break; … … 508 508 var groups = new EntityGroups(); 509 509 groups.add(entState.garrisonHolder.entities); 510 510 setupUnitPanel("Garrison", usedPanels, entState, groups.getTemplateNames(), 511 function (item) { unload(entState.id, groups.getEntsByName(item) [0]); } );511 function (item) { unload(entState.id, groups.getEntsByName(item)); } ); 512 512 } 513 513 514 514 var formations = getEntityFormationsList(entState); -
binaries/data/mods/public/simulation/helpers/Commands.js
337 337 if (CanControlUnit(cmd.garrisonHolder, player, controlAllUnits)) 338 338 { 339 339 var cmpGarrisonHolder = Engine.QueryInterface(cmd.garrisonHolder, IID_GarrisonHolder); 340 if (!cmpGarrisonHolder || !cmpGarrisonHolder.Unload(cmd.entity))340 for each (ent in cmd.entities) 341 341 { 342 var cmpPlayer = QueryPlayerIDInterface(player, IID_Player); 343 var notification = {"player": cmpPlayer.GetPlayerID(), "message": "Unable to ungarrison unit"}; 344 var cmpGUIInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); 345 cmpGUIInterface.PushNotification(notification); 346 } 342 if (!cmpGarrisonHolder || !cmpGarrisonHolder.Unload(ent)) 343 { 344 var cmpPlayer = QueryPlayerIDInterface(player, IID_Player); 345 var notification = {"player": cmpPlayer.GetPlayerID(), "message": "Unable to ungarrison unit"}; 346 var cmpGUIInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); 347 cmpGUIInterface.PushNotification(notification); 348 } 349 } 347 350 } 348 351 else if (g_DebugCommands) 349 352 {