Ticket #2116: patch_splashscreen.diff
File patch_splashscreen.diff, 2.6 KB (added by , 11 years ago) |
---|
-
binaries/data/config/default.cfg
20 20 ; Enable/disable windowed mode by default. (Use Alt+Enter to toggle in the game.) 21 21 windowed = false 22 22 23 ; Enable/disable the splashscreen24 splashscreen enable = true23 ; Choose the splashscreen. (0 to disable it.) 24 splashscreen = 1 25 25 26 26 ; Pause the game on window focus loss (Only applicable to single player mode) 27 27 pauseonfocusloss = true -
binaries/data/mods/public/gui/splashscreen/splashscreen.xml
23 23 <object name="btnOK" type="button" style="StoneButton" tooltip_style="snToolTip" size="24 100%-52 188 100%-24"> 24 24 OK 25 25 <action on="Press"><![CDATA[ 26 Engine.SetSplashScreenEnabled(!getGUIObjectByName("displaySplashScreen").checked); 26 if(getGUIObjectByName("displaySplashScreen").checked) 27 Engine.SetSplashScreen(0); 27 28 Engine.PopGuiPage(); 28 29 ]]></action> 29 30 </object> -
source/gui/scripting/ScriptFunctions.cpp
525 525 526 526 bool IsSplashScreenEnabled(void* UNUSED(cbdata)) 527 527 { 528 bool splashScreenEnable = true; 529 CFG_GET_VAL("splashscreenenable", Bool, splashScreenEnable); 530 return splashScreenEnable; 528 unsigned int splashScreen = 0; 529 CFG_GET_VAL("splashscreen", UnsignedInt, splashScreen); 530 531 return (splashScreen != 0); 531 532 } 532 533 533 void SetSplashScreen Enabled(void* UNUSED(cbdata), bool enabled)534 void SetSplashScreen(void* UNUSED(cbdata), unsigned int id) 534 535 { 535 CStr val = (enabled ? "true" : "false");536 g_ConfigDB.CreateValue(CFG_USER, "splashscreen enable")->m_String = val;536 CStr val = CStr::FromUInt(id); 537 g_ConfigDB.CreateValue(CFG_USER, "splashscreen")->m_String = val; 537 538 g_ConfigDB.WriteFile(CFG_USER); 538 539 } 539 540 … … 719 720 720 721 // Splash screen functions 721 722 scriptInterface.RegisterFunction<bool, &IsSplashScreenEnabled>("IsSplashScreenEnabled"); 722 scriptInterface.RegisterFunction<void, bool, &SetSplashScreenEnabled>("SetSplashScreenEnabled");723 scriptInterface.RegisterFunction<void, unsigned int, &SetSplashScreen>("SetSplashScreen"); 723 724 724 725 // Development/debugging functions 725 726 scriptInterface.RegisterFunction<void, float, &SetSimRate>("SetSimRate");