1
0
forked from 0ad/0ad

Adds a splashscreen that appears on startup and informs the player about the status of the game (bugs, missing features). The splashscreen can be disabled for future startups by unckecking a checkbox on the splashscreen.

This was SVN commit r12735.
This commit is contained in:
Yves 2012-10-07 12:43:08 +00:00
parent fc294e5ff9
commit 5ce5ef9286
13 changed files with 140 additions and 0 deletions

View File

@ -20,6 +20,10 @@
; Enable/disable windowed mode by default. (Use Alt+Enter to toggle in the game.)
windowed = false
; Enable/disable the splashscreen
; Currently commented out in default.cfg because of a bug with writing configuration files
;splashscreenenable = true
; Pause the game on window focus loss (Only applicable to single player mode)
pauseonfocusloss = true

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<page>
<include>common/setup.xml</include>
<include>common/styles.xml</include>
<include>common/sprite1.xml</include>
<include>common/common_sprites.xml</include>
<include>common/common_styles.xml</include>
<include>splashscreen/styles.xml</include>
<include>splashscreen/setup.xml</include>
<include>splashscreen/splashscreen.xml</include>
</page>

View File

@ -16,6 +16,11 @@ function init()
currentSubmenuType = "submenuSinglePlayer";
EnableUserReport(Engine.IsUserReportEnabled());
if(Engine.IsSplashScreenEnabled())
{
Engine.PushGuiPage("page_splashscreen.xml", { "page": "splashscreen" } );
}
}
var t0 = new Date;

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<setup>
<!-- Icons -->
<icon name="constructionIcon"
sprite="stretched:pregame/icons/experimental.png"
size="32 32"
/>
<icon name="iconLag"
sprite="stretched:pregame/icons/lag.png"
size="32 32"
/>
<icon name="iconMap"
sprite="stretched:pregame/icons/map.png"
size="32 32"
/>
<icon name="iconShip"
sprite="stretched:pregame/icons/port.png"
size="32 32"
/>
</setup>

View File

@ -0,0 +1,4 @@
function init(data)
{
getGUIObjectByName("mainText").caption = readFile("gui/splashscreen/" + data.page + ".txt");
}

View File

@ -0,0 +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=iconLag]The game lags when many units are moving.
[icon="iconShip"]The computer opponent can't use ships.
[icon="iconMap"]Large maps can cause problems.

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<objects>
<script file="gui/common/functions_global_object.js"/>
<script file="gui/splashscreen/splashscreen.js"/>
<!-- Add a translucent black background to fade out the menu page -->
<object type="image" z="0" style="TranslucentPanel"/>
<object type="image" style="StoneDialog" size="50%-274 50%-200 50%+274 50%+200">
<object type="text" style="TitleText" size="50%-128 0%-16 50%+128 16">Welcome to 0 A.D. !</object>
<object type="image" sprite="BackgroundTranslucent" size="20 20 100%-20 100%-52">
<object name="mainText" type="text" style="textPanel"/>
<object size="8 100%-60 100% 100%">
<object size="0 20 100% 100%">
<object name="displaySplashScreenText" size="20 0 100% 100%" type="text" style="LeftLabelText">Show this message in the future</object>
<object name="displaySplashScreen" checked="true" size="0 50%-8 16 50%+8" type="checkbox" style="StoneCrossBox"/>
</object>
</object>
</object>
<object name="btnOK" type="button" style="StoneButton" tooltip_style="snToolTip" size="24 100%-52 188 100%-24">
OK
<action on="Press"><![CDATA[
Engine.SetSplashScreenEnabled(getGUIObjectByName("displaySplashScreen").checked);
Engine.PopGuiPage();
]]></action>
</object>
<object type="button" style="StoneButton" size="192 100%-52 356 100%-24">
Known issues (web)
<action on="Press"><![CDATA[
var url = "http://www.wildfiregames.com/forum/index.php?showtopic=15796";
Engine.OpenURL(url);
messageBox(600, 200, "Opening "+url+"\n in default web browser. Please wait...", "Opening page", 2);
]]></action>
</object>
</object>
</objects>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<styles>
<style name="textPanel"
buffer_zone="8"
font="serif-bold-16"
textcolor="white"
textcolor_selected="black"
text_align="left"
text_valign="top"
/>
</styles>

View File

@ -43,6 +43,7 @@
#include "ps/UserReport.h"
#include "ps/GameSetup/Atlas.h"
#include "ps/GameSetup/Config.h"
#include "ps/ConfigDB.h"
#include "tools/atlas/GameInterface/GameLoop.h"
#include "simulation2/Simulation2.h"
@ -470,6 +471,21 @@ bool IsUserReportEnabled(void* UNUSED(cbdata))
return g_UserReporter.IsReportingEnabled();
}
bool IsSplashScreenEnabled(void* UNUSED(cbdata))
{
bool splashScreenEnable = true;
CFG_GET_USER_VAL("splashscreenenable", Bool, splashScreenEnable);
return splashScreenEnable;
}
void SetSplashScreenEnabled(void* UNUSED(cbdata), bool enabled)
{
CStr val = (enabled ? "true" : "false");
g_ConfigDB.CreateValue(CFG_USER, "splashscreenenable")->m_String = val;
g_ConfigDB.WriteFile(CFG_USER);
}
void SetUserReportEnabled(void* UNUSED(cbdata), bool enabled)
{
g_UserReporter.SetReportingEnabled(enabled);
@ -638,6 +654,10 @@ void GuiScriptingInit(ScriptInterface& scriptInterface)
scriptInterface.RegisterFunction<std::string, &GetUserReportStatus>("GetUserReportStatus");
scriptInterface.RegisterFunction<void, std::string, int, std::wstring, &SubmitUserReport>("SubmitUserReport");
// Splash screen functions
scriptInterface.RegisterFunction<bool, &IsSplashScreenEnabled>("IsSplashScreenEnabled");
scriptInterface.RegisterFunction<void, bool, &SetSplashScreenEnabled>("SetSplashScreenEnabled");
// Development/debugging functions
scriptInterface.RegisterFunction<void, float, &SetSimRate>("SetSimRate");
scriptInterface.RegisterFunction<void, int, &SetTurnLength>("SetTurnLength");