forked from mirrors/0ad
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:
Binary file not shown.
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user