mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-18 06:13:55 -07:00
Add a button to the top bar to access the summary screen in-game or in replays.
No effort was done to prevent players from accessing it since it's impossible to prevent them from doing so anyway. Fixes #3387 . This was SVN commit r17423.
This commit is contained in:
parent
4dcbad7b1b
commit
e57c99c6f6
4 changed files with 46 additions and 4 deletions
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e37e97f6efa26aa791c5670c7d268cdafa3af2b43a6b49bc16a14e4195598fcf
|
||||
size 1329
|
||||
|
|
@ -623,16 +623,36 @@ function toggleGameSpeed()
|
|||
gameSpeed.hidden = !gameSpeed.hidden;
|
||||
}
|
||||
|
||||
function openGameSummary()
|
||||
{
|
||||
closeMenu();
|
||||
closeOpenDialogs();
|
||||
pauseGame();
|
||||
|
||||
var extendedSimState = Engine.GuiInterfaceCall("GetExtendedSimulationState");
|
||||
|
||||
Engine.PushGuiPage("page_summary.xml", {
|
||||
"timeElapsed" : extendedSimState.timeElapsed,
|
||||
"playerStates": extendedSimState.players,
|
||||
"players": g_Players,
|
||||
"mapSettings": Engine.GetMapSettings(),
|
||||
"isInGame": true,
|
||||
"gameResult": translate("Current Scores"),
|
||||
"callback": "resumeGame"
|
||||
});
|
||||
}
|
||||
|
||||
function openStrucTree()
|
||||
{
|
||||
closeMenu();
|
||||
closeOpenDialogs();
|
||||
pauseGame();
|
||||
var data = { // TODO add info about researched techs and unlocked entities
|
||||
|
||||
// TODO add info about researched techs and unlocked entities
|
||||
Engine.PushGuiPage("page_structree.xml", {
|
||||
"civ" : g_Players[Engine.GetPlayerID()].civ,
|
||||
"callback": "resumeGame",
|
||||
};
|
||||
Engine.PushGuiPage("page_structree.xml", data);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<object>
|
||||
<object type="button"
|
||||
name="summaryScreenButton"
|
||||
size="100%-290 4 100%-262 32"
|
||||
style="iconButton"
|
||||
tooltip_style="sessionToolTip"
|
||||
>
|
||||
<translatableAttribute id="tooltip">Summary Screen</translatableAttribute>
|
||||
<object size="5 5 100%-5 100%-5" type="image" sprite="stretched:session/icons/summary.png" ghost="true"/>
|
||||
<action on="Press">
|
||||
openGameSummary();
|
||||
</action>
|
||||
</object>
|
||||
</object>
|
||||
|
|
@ -160,7 +160,11 @@
|
|||
<object type="button" style="ModernButtonRed" size="100%-160 100%-48 100%-20 100%-20">
|
||||
<translatableAttribute id="caption">Continue</translatableAttribute>
|
||||
<action on="Press"><![CDATA[
|
||||
if (g_GameData.isReplay)
|
||||
if (g_GameData.isInGame)
|
||||
{
|
||||
Engine.PopGuiPageCB(0);
|
||||
}
|
||||
else if (g_GameData.isReplay)
|
||||
{
|
||||
Engine.SwitchGuiPage("page_replaymenu.xml");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue