Ticket #1915: garrisonCapacity.diff
File garrisonCapacity.diff, 2.5 KB (added by , 11 years ago) |
---|
-
binaries/data/mods/public/gui/session/input.js
311 311 case "garrison": 312 312 if (hasClass(entState, "Unit") && targetState.garrisonHolder && (playerOwned || mutualAllyOwned)) 313 313 { 314 var tooltip = "Current garrison " + targetState.garrisonHolder.entities.length 315 + ", with a capacity of " + targetState.garrisonHolder.capacity + "."; 314 316 var allowedClasses = targetState.garrisonHolder.allowedClasses; 315 317 for each (var unitClass in entState.identity.classes) 316 318 { 317 319 if (allowedClasses.indexOf(unitClass) != -1) 318 320 { 319 return {"possible": true };321 return {"possible": true, "tooltip": tooltip}; 320 322 } 321 323 } 322 324 } … … 460 462 target = targets[0]; 461 463 } 462 464 465 var actionInfo = undefined; 463 466 if (preSelectedAction != ACTION_NONE) 464 467 { 465 468 switch (preSelectedAction) … … 482 485 { 483 486 return {"type": "attack", "cursor": "action-attack", "target": target}; 484 487 } 485 else if (Engine.HotkeyIsPressed("session.garrison") && getActionInfo("garrison", target).possible)488 else if (Engine.HotkeyIsPressed("session.garrison") && (actionInfo = getActionInfo("garrison", target)).possible) 486 489 { 487 return {"type": "garrison", "cursor": "action-garrison", "t arget": target};490 return {"type": "garrison", "cursor": "action-garrison", "tooltip": actionInfo.tooltip, "target": target}; 488 491 } 489 492 else if (Engine.HotkeyIsPressed("session.attackmove") && getActionInfo("attack-move", target).possible) 490 493 { … … 492 495 } 493 496 else 494 497 { 495 var actionInfo = undefined;496 498 if ((actionInfo = getActionInfo("setup-trade-route", target)).possible) 497 499 return {"type": "setup-trade-route", "cursor": "action-setup-trade-route", "tooltip": actionInfo.tooltip, "target": target}; 498 500 else if ((actionInfo = getActionInfo("gather", target)).possible) -
binaries/data/mods/public/simulation/components/GuiInterface.js
297 297 { 298 298 ret.garrisonHolder = { 299 299 "entities": cmpGarrisonHolder.GetEntities(), 300 "allowedClasses": cmpGarrisonHolder.GetAllowedClassesList() 300 "allowedClasses": cmpGarrisonHolder.GetAllowedClassesList(), 301 "capacity": cmpGarrisonHolder.GetCapacity() 301 302 }; 302 303 } 303 304