Ticket #4391: splashscreen-v2.patch
File splashscreen-v2.patch, 3.4 KB (added by , 7 years ago) |
---|
-
binaries/data/mods/public/gui/options/options.json
28 28 { 29 29 "type": "boolean", 30 30 "label": "Disable Welcome Screen", 31 "tooltip": " If you disable this screen completely, you may miss important announcements.\nYou can still launch it usingthe main menu.",31 "tooltip": "When disabled, the welcome screen will nevertheless be shown once when a new version is available and you can always launch it from the main menu.", 32 32 "parameters": { "config": "splashscreendisable" } 33 33 }, 34 34 { -
binaries/data/mods/public/gui/pregame/mainmenu.js
128 128 { 129 129 g_ShowSplashScreens = false; 130 130 131 if (Engine.ConfigDB_GetValue("user", "splashscreendisable") !== "true" &&131 if (Engine.ConfigDB_GetValue("user", "splashscreendisable") !== "true" || 132 132 Engine.ConfigDB_GetValue("user", "splashscreenversion") < Engine.GetFileMTime("gui/splashscreen/splashscreen.txt")) 133 133 Engine.PushGuiPage("page_splashscreen.xml", { "page": "splashscreen", callback : "SplashScreenClosedCallback" } ); 134 134 else -
binaries/data/mods/public/gui/splashscreen/splashscreen.js
1 1 function init(data) 2 2 { 3 3 Engine.GetGUIObjectByName("mainText").caption = Engine.TranslateLines(Engine.ReadFile("gui/splashscreen/" + data.page + ".txt")); 4 Engine.GetGUIObjectByName("displaySplashScreen").checked = (Engine.ConfigDB_GetValue("user", "splashscreenversion") < Engine.GetFileMTime("gui/splashscreen/splashscreen.txt"));4 Engine.GetGUIObjectByName("displaySplashScreen").checked = Engine.ConfigDB_GetValue("user", "splashscreendisable") !== "true"; 5 5 } -
binaries/data/mods/public/gui/splashscreen/splashscreen.xml
27 27 <object name="btnOK" type="button" style="ModernButtonRed" size="18 100%-45 50%-5 100%-17" hotkey="cancel"> 28 28 <translatableAttribute id="caption">OK</translatableAttribute> 29 29 <action on="Press"><![CDATA[ 30 let version = Engine.GetGUIObjectByName("displaySplashScreen").checked ? 0 : Engine.GetFileMTime("gui/splashscreen/splashscreen.txt"); 30 let disabled = "" + !Engine.GetGUIObjectByName("displaySplashScreen").checked; 31 Engine.ConfigDB_CreateValue("user", "splashscreendisable", disabled); 32 Engine.ConfigDB_WriteValueToFile("user", "splashscreendisable", disabled, "config/user.cfg"); 33 let version = Engine.GetFileMTime("gui/splashscreen/splashscreen.txt"); 31 34 Engine.ConfigDB_CreateValue("user", "splashscreenversion", version); 32 35 Engine.ConfigDB_WriteValueToFile("user", "splashscreenversion", version, "config/user.cfg"); 33 36 Engine.PopGuiPageCB();