Ticket #2116: patch_splashscreen.7.diff

File patch_splashscreen.7.diff, 6.0 KB (added by Itms, 10 years ago)
  • binaries/data/config/default.cfg

     
    2121windowed = false
    2222
    2323; Enable/disable the splashscreen
    24 splashscreenenable = true
     24splashscreendisable = false
     25; Splashscreen version (date of last modification). By default, 0 to force splashscreen to appear at first launch.
     26splashscreenversion = 0
    2527
    2628; Pause the game on window focus loss (Only applicable to single player mode)
    2729pauseonfocusloss = true
  • binaries/data/mods/public/gui/options/options.js

     
    77    [
    88        [translate("Windowed Mode"), translate("Start 0 A.D. in a window"), {"config":"windowed"}, "boolean"],
    99        [translate("Background Pause"), translate("Pause single player games when window loses focus"), {"config":"pauseonfocusloss"}, "boolean"],
     10        [translate("Disable Welcome Screen"), translate("If you disable this screen completely, you may miss important announcements.\nYou can still launch it using the main menu."), {"config":"splashscreendisable"}, "boolean"],
    1011        [translate("Developer Overlay"), translate("Show overlay in-game with options such as reveal map, control all units, and change perspective. Designed for use by developers"), {"config":"developeroverlay.enable"}, "boolean"],
    1112    ],
    1213    "graphicsSetting":
  • binaries/data/mods/public/gui/pregame/mainmenu.js

     
    158158    {
    159159        g_ShowSplashScreens = false;
    160160
    161         if (Engine.ConfigDB_GetValue("user", "splashscreenenable") !== "false")
    162             Engine.PushGuiPage("page_splashscreen.xml", { "page": "splashscreen", callback : "SplashScreenClosedCallback" } );
     161        if (Engine.ConfigDB_GetValue("user", "splashscreendisable") !== "true"
     162            && Engine.ConfigDB_GetValue("user", "splashscreenversion") < Engine.GetFileMTime("gui/splashscreen/splashscreen.txt"))
     163            Engine.PushGuiPage("page_splashscreen.xml", { "page": "splashscreen", callback : "SplashScreenClosedCallback" } );
    163164        else
    164165            ShowRenderPathMessage();
    165166    }
  • binaries/data/mods/public/gui/pregame/mainmenu.xml

     
    328328                        pressedScenarioEditorButton();
    329329                    </action>
    330330                </object>
     331
     332                <object name="submenuWelcomeScreenButton"
     333                    style="StoneButtonFancy"
     334                    type="button"
     335                    size="0 96 100% 124"
     336                    tooltip_style="pgToolTip"
     337                >
     338                    <translatableAttribute id="caption">Welcome Screen</translatableAttribute>
     339                    <translatableAttribute id="tooltip">Show the Welcome Screen. Useful if you hid it by mistake.</translatableAttribute>
     340                    <action on="Press">
     341                        <![CDATA[
     342                        closeMenu();
     343                        Engine.PushGuiPage("page_splashscreen.xml", { "page": "splashscreen", callback : "SplashScreenClosedCallback" } );
     344                        ]]>
     345                    </action>
     346                </object>
    331347            </object>
    332348        </object><!-- end of submenu -->
    333349
     
    427443                    <translatableAttribute id="tooltip">Game options and scenario design tools.</translatableAttribute>
    428444                    <action on="Press">
    429445                        closeMenu();
    430                         openMenu("submenuToolsAndOptions", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 3);
     446                        openMenu("submenuToolsAndOptions", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 4);
    431447                    </action>
    432448                </object>
    433449
  • 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"));
    45}
    56
    67function openURL(url)
  • binaries/data/mods/public/gui/splashscreen/splashscreen.xml

     
    1919                        <object name="displaySplashScreenText" size="20 0 100% 100%" type="text" style="ModernLeftLabelText">
    2020                            <translatableAttribute id="caption">Show this message in the future</translatableAttribute>
    2121                        </object>
    22                         <object name="displaySplashScreen" checked="true" size="0 50%-8 16 50%+8" type="checkbox" style="ModernTickBox"/>
     22                        <object name="displaySplashScreen" size="0 50%-8 16 50%+8" type="checkbox" style="ModernTickBox"/>
    2323                    </object>
    2424                </object>
    2525            </object>
    2626        <object name="btnOK" type="button" style="StoneButton" tooltip_style="snToolTip" size="20 100%-42 184 100%-14">
    2727            <translatableAttribute id="caption">OK</translatableAttribute>
    2828            <action on="Press"><![CDATA[
    29             Engine.ConfigDB_CreateValue("user", "splashscreenenable", Engine.GetGUIObjectByName("displaySplashScreen").checked ? "true" : "false");
     29            if (Engine.GetGUIObjectByName("displaySplashScreen").checked)
     30                Engine.ConfigDB_CreateValue("user", "splashscreenversion", 0);
     31            else
     32                Engine.ConfigDB_CreateValue("user", "splashscreenversion", Engine.GetFileMTime("gui/splashscreen/splashscreen.txt"));
    3033            Engine.ConfigDB_WriteFile("user", "config/user.cfg");
    3134            Engine.PopGuiPageCB();
    3235            ]]></action>