1
0
forked from 0ad/0ad

Fixes splash screen to display only once at startup. Fixes #1701.

Adds some spacing between splash screen icons and text.

This was SVN commit r12762.
This commit is contained in:
historic_bruno 2012-10-17 20:33:50 +00:00
parent 8e48beeeef
commit 7fafeec767
3 changed files with 17 additions and 10 deletions

View File

@ -3,7 +3,7 @@ var currentSubmenuType; // contains submenu type
const MARGIN = 4; // menu border size
const background = "hellenes1"; // Background type. Currently: 'hellenes1', 'persians1'.
function init()
function init(initData)
{
initMusic();
@ -17,10 +17,9 @@ function init()
EnableUserReport(Engine.IsUserReportEnabled());
if(Engine.IsSplashScreenEnabled())
{
// Only show splash screen once
if (initData && initData.isStartup && Engine.IsSplashScreenEnabled())
Engine.PushGuiPage("page_splashscreen.xml", { "page": "splashscreen" } );
}
}
var t0 = new Date;

View File

@ -1,9 +1,9 @@
[font="serif-bold-16"]Thank you for installing 0 A.D.!
[font="serif-16"]
[icon="constructionIcon"]This is an early experimental version of the game. Features are missing and it contains bugs.
[icon="constructionIcon"] This is an early experimental version of the game. Features are missing and it contains bugs.
[icon=iconLag]The game lags when many units are moving.
[icon=iconLag] The game lags when many units are moving.
[icon="iconShip"]The computer opponent can't use ships.
[icon="iconShip"] The computer opponent can't use ships.
[icon="iconMap"]Large maps can cause problems.
[icon="iconMap"] Large maps can cause problems.

View File

@ -986,7 +986,15 @@ void InitGraphics(const CmdLineArgs& args, int flags)
if (!Autostart(args))
{
const bool setup_gui = ((flags & INIT_NO_GUI) == 0);
InitPs(setup_gui, L"page_pregame.xml", JSVAL_VOID);
// We only want to display the splash screen at startup
CScriptValRooted data;
if (g_GUI)
{
ScriptInterface& scriptInterface = g_GUI->GetScriptInterface();
scriptInterface.Eval("({})", data);
scriptInterface.SetProperty(data.get(), "isStartup", true);
}
InitPs(setup_gui, L"page_pregame.xml", data.get());
}
}
catch (PSERROR_Game_World_MapLoadFailed e)