Ticket #4391: splashscreen-v2.patch

File splashscreen-v2.patch, 3.4 KB (added by mimo, 7 years ago)
  • binaries/data/mods/public/gui/options/options.json

     
    2828        {
    2929            "type": "boolean",
    3030            "label": "Disable Welcome Screen",
    31             "tooltip": "If you disable this screen completely, you may miss important announcements.\nYou can still launch it using the 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.",
    3232            "parameters": { "config": "splashscreendisable" }
    3333        },
    3434        {
  • binaries/data/mods/public/gui/pregame/mainmenu.js

     
    128128    {
    129129        g_ShowSplashScreens = false;
    130130
    131         if (Engine.ConfigDB_GetValue("user", "splashscreendisable") !== "true" &&
     131        if (Engine.ConfigDB_GetValue("user", "splashscreendisable") !== "true" ||
    132132            Engine.ConfigDB_GetValue("user", "splashscreenversion") < Engine.GetFileMTime("gui/splashscreen/splashscreen.txt"))
    133133            Engine.PushGuiPage("page_splashscreen.xml", { "page": "splashscreen", callback : "SplashScreenClosedCallback" } );
    134134        else
  • binaries/data/mods/public/gui/splashscreen/splashscreen.js

     
    11function init(data)
    22{
    33    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";
    55}
  • binaries/data/mods/public/gui/splashscreen/splashscreen.xml

     
    2727        <object name="btnOK" type="button" style="ModernButtonRed" size="18 100%-45 50%-5 100%-17" hotkey="cancel">
    2828            <translatableAttribute id="caption">OK</translatableAttribute>
    2929            <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");
    3134            Engine.ConfigDB_CreateValue("user", "splashscreenversion", version);
    3235            Engine.ConfigDB_WriteValueToFile("user", "splashscreenversion", version, "config/user.cfg");
    3336            Engine.PopGuiPageCB();