Ticket #4391: splashscreen.patch

File splashscreen.patch, 4.0 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": "If you disable this screen, you may miss important announcements. It will nonetheless be reenabled 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

     
    1616            <object name="displaySplashScreenText" size="30 100%-30 100% 100%-8" type="text" style="ModernLeftLabelText">
    1717                <translatableAttribute id="caption">Show this message in the future</translatableAttribute>
    1818            </object>
    19             <object name="displaySplashScreen" size="8 100%-30 22 100%-8" type="checkbox" style="ModernTickBox"/>
     19            <object name="displaySplashScreen" size="8 100%-30 22 100%-8" type="checkbox" style="ModernTickBox">
     20                <action on="Press">
     21                    let disabled = "" + !this.checked;
     22                    Engine.ConfigDB_CreateValue("user", "splashscreendisable", disabled);
     23                    Engine.ConfigDB_WriteValueToFile("user", "splashscreendisable", disabled, "config/user.cfg");
     24                </action>
     25            </object>
    2026        </object>
    2127        <object type="button" style="ModernButtonRed" size="50%+5 100%-45 100%-18 100%-17">
    2228            <translatableAttribute id="caption">Known Issues (web)</translatableAttribute>
     
    2733        <object name="btnOK" type="button" style="ModernButtonRed" size="18 100%-45 50%-5 100%-17" hotkey="cancel">
    2834            <translatableAttribute id="caption">OK</translatableAttribute>
    2935            <action on="Press"><![CDATA[
    30             let version = Engine.GetGUIObjectByName("displaySplashScreen").checked ? 0 : Engine.GetFileMTime("gui/splashscreen/splashscreen.txt");
     36            let version = Engine.GetFileMTime("gui/splashscreen/splashscreen.txt");
    3137            Engine.ConfigDB_CreateValue("user", "splashscreenversion", version);
    3238            Engine.ConfigDB_WriteValueToFile("user", "splashscreenversion", version, "config/user.cfg");
    3339            Engine.PopGuiPageCB();