1
0
forked from mirrors/0ad

Disable some session buttons while in Atlas rather than spamming JS error stacks onTick.

These three dialogs assume to be able to read the gameSettings, but
Atlas doesn't provide them yet following the commits in #3143 and #3263.
Refs #4199.

This was SVN commit r21658.
This commit is contained in:
elexis
2018-04-04 17:35:25 +00:00
parent b48d192ee9
commit 966b1608da
4 changed files with 8 additions and 5 deletions
@@ -77,7 +77,10 @@ var g_FlushTributing = function() {};
function initMenu()
{
Engine.GetGUIObjectByName("menu").size = "100%-164 " + MENU_TOP + " 100% " + MENU_BOTTOM;
Engine.GetGUIObjectByName("menuExitButton").enabled = !Engine.IsAtlasRunning();
// TODO: Atlas should pass g_GameAttributes.settings
for (let button of ["menuExitButton", "summaryButton", "objectivesButton", "diplomacyButton"])
Engine.GetGUIObjectByName(button).enabled = !Engine.IsAtlasRunning();
}
function updateMenuPosition(dt)
@@ -696,8 +696,8 @@ function updateTopPanel()
resPop.size = resPopSize;
Engine.GetGUIObjectByName("population").hidden = !isPlayer;
Engine.GetGUIObjectByName("diplomacyButton1").hidden = !isPlayer;
Engine.GetGUIObjectByName("tradeButton1").hidden = !isPlayer;
Engine.GetGUIObjectByName("diplomacyButton").hidden = !isPlayer;
Engine.GetGUIObjectByName("tradeButton").hidden = !isPlayer;
Engine.GetGUIObjectByName("observerText").hidden = isPlayer;
let alphaLabel = Engine.GetGUIObjectByName("alphaLabel");
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<object type="button"
name="diplomacyButton1"
name="diplomacyButton"
size="100%-254 4 100%-226 32"
style="iconButton"
tooltip_style="sessionToolTip"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<object type="button"
name="tradeButton1"
name="tradeButton"
size="100%-224 4 100%-196 32"
style="iconButton"
tooltip_style="sessionToolTip"