Ticket #2116: patch_splashscreen.4.diff
File patch_splashscreen.4.diff, 6.3 KB (added by , 11 years ago) |
---|
-
binaries/data/config/default.cfg
22 22 23 23 ; Enable/disable the splashscreen 24 24 splashscreenenable = true 25 ; Splashscreen version (date of last modification). By default, 0 to force splashscreen to appear at first launch. 26 splashscreenversion = 0 25 27 26 28 ; Pause the game on window focus loss (Only applicable to single player mode) 27 29 pauseonfocusloss = true -
binaries/data/mods/public/gui/splashscreen/splashscreen.xml
7 7 <!-- Add a translucent black background to fade out the menu page --> 8 8 <object type="image" z="0" style="TranslucentPanel"/> 9 9 10 <object type="image" style="StoneDialog" size="50%-300 50%-200 50%+300 50%+2 00">10 <object type="image" style="StoneDialog" size="50%-300 50%-200 50%+300 50%+250"> 11 11 <object type="text" style="TitleText" size="50%-128 0%-16 50%+128 16">Welcome to 0 A.D. !</object> 12 12 13 <object type="image" sprite="BackgroundTranslucent" size="20 20 100%-20 100%-52"> 14 <object name="openFundraiserPage" type="button" style="fundraiserButton" size="5 5 100% 150"> 15 <action on="Press"><![CDATA[ 16 Engine.OpenURL("http://play0ad.com/fundraiser"); 17 ]]></action> 18 </object> 19 <object size="0 150 100% 100%"> 20 <object name="mainText" type="text" style="textPanel"/> 21 </object> 13 <object type="image" sprite="BackgroundTranslucent" size="20 20 100%-20 100%-105"> 14 <object name="openFundraiserPage" type="button" style="fundraiserButton" size="5 5 100% 150"> 15 <action on="Press"><![CDATA[ 16 Engine.OpenURL("http://play0ad.com/fundraiser"); 17 ]]></action> 22 18 </object> 23 <object name="btnOK" type="button" style="StoneButton" tooltip_style="snToolTip" size="24 100%-52 188 100%-24"> 24 OK 19 <object size="0 150 100% 100%"> 20 <object name="mainText" type="text" style="textPanel"/> 21 </object> 22 </object> 23 24 <object name="btnFundraiser" type="button" style="StoneButtonFancy" tooltip_style="snToolTip" size="50 100%-104 100%-50 100%-75"> 25 Visit Fundraiser 25 26 <action on="Press"><![CDATA[ 26 Engine.SetSplashScreenEnabled(!getGUIObjectByName("displaySplashScreen").checked); 27 Engine.OpenURL("http://play0ad.com/fundraiser"); 28 ]]></action> 29 </object> 30 <object name="btnDismiss" type="button" style="StoneButton" tooltip_style="snToolTip" size="24 100%-59 180 100%-30"> 31 Dismiss 32 <action on="Press"><![CDATA[ 33 Engine.SynchroniseSplashScreen(); 27 34 Engine.PopGuiPage(); 28 35 ]]></action> 29 36 </object> 30 <object name="btn Fundraiser" type="button" style="StoneButton" tooltip_style="snToolTip" size="196 100%-52 360 100%-24">31 Visit Fundraiser37 <object name="btnRemind" type="button" style="StoneButton" tooltip_style="snToolTip" size="190 100%-59 350 100%-30"> 38 Remind me later 32 39 <action on="Press"><![CDATA[ 33 Engine. OpenURL("http://play0ad.com/fundraiser");40 Engine.PopGuiPage(); 34 41 ]]></action> 35 42 </object> 36 <object size="368 100%-52 100%-32 100%-24"> 37 <object size="0 0 100% 100%"> 38 <object name="displaySplashScreenText" size="0 0 100%-32 100%" type="text" style="RightLabelText">Don't show this again</object> 39 <object name="displaySplashScreen" checked="false" size="100%-16 50%-8 100% 50%+8" type="checkbox" style="StoneCrossBox"/> 40 </object> 43 <object name="btnDisable" type="button" style="StoneButton" tooltip_style="snToolTip" size="360 100%-59 576 100%-30"> 44 Never show notifications 45 <action on="Press"><![CDATA[ 46 Engine.SetSplashScreenEnabled(false); 47 Engine.PopGuiPage(); 48 ]]></action> 41 49 </object> 42 50 </object> 43 51 -
source/gui/scripting/ScriptFunctions.cpp
530 530 { 531 531 bool splashScreenEnable = true; 532 532 CFG_GET_VAL("splashscreenenable", Bool, splashScreenEnable); 533 return splashScreenEnable; 533 534 time_t splashScreenVersion = 0; 535 CFileInfo splashFileInfo; 536 537 CFG_GET_VAL("splashscreenversion", Time, splashScreenVersion); 538 539 if(g_VFS->GetFileInfo("gui/splashscreen/splashscreen.txt", &splashFileInfo) == INFO::OK) 540 return (splashScreenVersion != splashFileInfo.MTime() && splashScreenEnable); 541 else 542 return true; 534 543 } 535 544 545 void SynchroniseSplashScreen(void* UNUSED(cbdata)) 546 { 547 CFileInfo splashFileInfo; 548 CStr val; 549 550 g_VFS->GetFileInfo("gui/splashscreen/splashscreen.txt", &splashFileInfo); 551 val = CStr::FromInt64(splashFileInfo.MTime()); 552 553 g_ConfigDB.CreateValue(CFG_USER, "splashscreenversion")->m_String = val; 554 g_ConfigDB.WriteFile(CFG_USER); 555 } 556 536 557 void SetSplashScreenEnabled(void* UNUSED(cbdata), bool enabled) 537 558 { 538 559 CStr val = (enabled ? "true" : "false"); … … 726 747 727 748 // Splash screen functions 728 749 scriptInterface.RegisterFunction<bool, &IsSplashScreenEnabled>("IsSplashScreenEnabled"); 750 scriptInterface.RegisterFunction<void, &SynchroniseSplashScreen>("SynchroniseSplashScreen"); 729 751 scriptInterface.RegisterFunction<void, bool, &SetSplashScreenEnabled>("SetSplashScreenEnabled"); 730 752 731 753 // Development/debugging functions -
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