diff --git a/binaries/data/config/default.cfg b/binaries/data/config/default.cfg
index 1ae80ba..9632c40 100644
a
|
b
|
hotkey.session.devcommands.toggle = "Alt+D" ; Toggle developer commands panel
|
203 | 203 | hotkey.session.gui.toggle = "Alt+G" ; Toggle visibility of session GUI |
204 | 204 | hotkey.menu.toggle = "F10" ; Toggle in-game menu |
205 | 205 | hotkey.timeelapsedcounter.toggle = "F12" ; Toggle time elapsed counter |
| 206 | hotkey.statusbars.toggle = Tab ; Toggle display of status bars |
206 | 207 | |
207 | 208 | ; > HOTKEYS ONLY |
208 | 209 | hotkey.chat = Return ; Toggle chat window |
diff --git a/binaries/data/mods/public/gui/session/input.js b/binaries/data/mods/public/gui/session/input.js
index ff39b74..05ef1ec 100644
a
|
b
|
function handleInputAfterGui(ev)
|
970 | 970 | Engine.RewindTimeWarp(); |
971 | 971 | } |
972 | 972 | |
| 973 | if (ev.hotkey == "statusbars.toggle") |
| 974 | { |
| 975 | g_ShowAllStatusBars = (ev.type == "hotkeydown"); |
| 976 | recalculateStatusBarDisplay(); |
| 977 | } |
| 978 | |
973 | 979 | // State-machine processing: |
974 | 980 | |
975 | 981 | switch (inputState) |
diff --git a/binaries/data/mods/public/gui/session/session.js b/binaries/data/mods/public/gui/session/session.js
index 1204df5..e9fecee 100644
a
|
b
|
var g_DevSettings = {
|
13 | 13 | controlAll: false |
14 | 14 | }; |
15 | 15 | |
| 16 | // Whether status bars should be shown for all of the player's units. |
| 17 | var g_ShowAllStatusBars = false; |
| 18 | |
16 | 19 | // Indicate when one of the current player's training queues is blocked |
17 | 20 | // (this is used to support population counter blinking) |
18 | 21 | var g_IsTrainingBlocked = false; |
… |
… |
function onSimulationUpdate()
|
333 | 336 | |
334 | 337 | handleNotifications(); |
335 | 338 | |
| 339 | if (g_ShowAllStatusBars) |
| 340 | recalculateStatusBarDisplay(); |
| 341 | |
336 | 342 | updateGroups(); |
337 | 343 | updateDebug(simState); |
338 | 344 | updatePlayerDisplay(simState); |
… |
… |
function updateTimeElapsedCounter(simState)
|
421 | 427 | timeElapsedCounter.caption = timeToString(simState.timeElapsed); |
422 | 428 | } |
423 | 429 | |
| 430 | // Toggles the display of status bars for all of the player's entities. |
| 431 | function recalculateStatusBarDisplay() |
| 432 | { |
| 433 | if (g_ShowAllStatusBars) |
| 434 | var entities = Engine.PickFriendlyEntitiesOnScreen(Engine.GetPlayerID()); |
| 435 | else |
| 436 | { |
| 437 | var selected = g_Selection.toList(); |
| 438 | for each (var ent in g_Selection.highlighted) |
| 439 | selected.push(ent); |
| 440 | |
| 441 | // Remove selected entities from the 'all entities' array, to avoid disabling their status bars. |
| 442 | var entities = Engine.GuiInterfaceCall("GetPlayerEntities").filter( |
| 443 | function(idx) { return (selected.indexOf(idx) == -1); } |
| 444 | ); |
| 445 | } |
| 446 | |
| 447 | Engine.GuiInterfaceCall("SetStatusBars", { "entities": entities, "enabled": g_ShowAllStatusBars }); |
| 448 | } |
| 449 | |
424 | 450 | // Temporarily adding this here |
425 | 451 | const AMBIENT_TEMPERATE = "temperate"; |
426 | 452 | var currentAmbient; |
diff --git a/binaries/data/mods/public/simulation/components/GuiInterface.js b/binaries/data/mods/public/simulation/components/GuiInterface.js
index 4ce8c71..f82c2bd 100644
a
|
b
|
GuiInterface.prototype.SetStatusBars = function(player, cmd)
|
628 | 628 | } |
629 | 629 | }; |
630 | 630 | |
| 631 | GuiInterface.prototype.GetPlayerEntities = function(player) |
| 632 | { |
| 633 | var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); |
| 634 | return cmpRangeManager.GetEntitiesByPlayer(player); |
| 635 | }; |
| 636 | |
631 | 637 | /** |
632 | 638 | * Displays the rally points of a given list of entities (carried in cmd.entities). |
633 | 639 | * |
… |
… |
var exposedFunctions = {
|
1566 | 1572 | |
1567 | 1573 | "SetSelectionHighlight": 1, |
1568 | 1574 | "SetStatusBars": 1, |
| 1575 | "GetPlayerEntities": 1, |
1569 | 1576 | "DisplayRallyPoint": 1, |
1570 | 1577 | "SetBuildingPlacementPreview": 1, |
1571 | 1578 | "SetWallPlacementPreview": 1, |