mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-26 07:32:45 +00:00
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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user