Ticket #2116: patch_splashscreen.3.diff
File patch_splashscreen.3.diff, 3.9 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 ; Splashscreen version (date of last modification). By default, 0 to force splashscreen to appear at first launch. 24 splashscreenversion = 0 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.DisableSplashScreen(); 27 28 Engine.PopGuiPage(); 28 29 ]]></action> 29 30 </object> -
source/gui/scripting/ScriptFunctions.cpp
526 526 527 527 bool IsSplashScreenEnabled(void* UNUSED(cbdata)) 528 528 { 529 bool splashScreenEnable = true; 530 CFG_GET_VAL("splashscreenenable", Bool, splashScreenEnable); 531 return splashScreenEnable; 529 time_t splashScreenVersion = 0; 530 CFileInfo splashFileInfo; 531 532 CFG_GET_VAL("splashscreenversion", Time, splashScreenVersion); 533 534 if(g_VFS->GetFileInfo("gui/splashscreen/splashscreen.txt", &splashFileInfo) == INFO::OK) 535 return (splashScreenVersion != splashFileInfo.MTime()); 536 else 537 return true; 532 538 } 533 539 534 void SetSplashScreenEnabled(void* UNUSED(cbdata), bool enabled)540 void DisableSplashScreen(void* UNUSED(cbdata)) 535 541 { 536 CStr val = (enabled ? "true" : "false"); 537 g_ConfigDB.CreateValue(CFG_USER, "splashscreenenable")->m_String = val; 542 CFileInfo splashFileInfo; 543 CStr val; 544 545 g_VFS->GetFileInfo("gui/splashscreen/splashscreen.txt", &splashFileInfo); 546 val = CStr::FromInt64(splashFileInfo.MTime()); 547 548 g_ConfigDB.CreateValue(CFG_USER, "splashscreenversion")->m_String = val; 538 549 g_ConfigDB.WriteFile(CFG_USER); 539 550 } 540 551 … … 722 733 723 734 // Splash screen functions 724 735 scriptInterface.RegisterFunction<bool, &IsSplashScreenEnabled>("IsSplashScreenEnabled"); 725 scriptInterface.RegisterFunction<void, bool, &SetSplashScreenEnabled>("SetSplashScreenEnabled");736 scriptInterface.RegisterFunction<void, &DisableSplashScreen>("DisableSplashScreen"); 726 737 727 738 // Development/debugging functions 728 739 scriptInterface.RegisterFunction<void, float, &SetSimRate>("SetSimRate"); -
source/ps/Parser.cpp
224 224 FUNC_IMPL_CAST_GETDOUBLE(GetUnsignedShort, unsigned short) 225 225 FUNC_IMPL_CAST_GETDOUBLE(GetUnsignedInt, unsigned int) 226 226 FUNC_IMPL_CAST_GETDOUBLE(GetUnsignedLong, unsigned long) 227 FUNC_IMPL_CAST_GETDOUBLE(GetTime, time_t) 227 228 228 229 // CParserTaskTypeNode 229 230 // ---------------------------------------------------------------------| Class -
source/ps/Parser.h
106 106 bool GetUnsignedInt(unsigned int &ret); 107 107 bool GetUnsignedLong(unsigned long &ret); 108 108 bool GetFloat(float &ret); 109 bool GetTime(time_t &time); 109 110 bool GetDouble(double &ret); 110 111 111 112 // Memory regardless if it's an int, real, string or whatever