Ticket #4406: ai-info-v3.patch

File ai-info-v3.patch, 9.2 KB (added by mimo, 7 years ago)
  • binaries/data/config/default.cfg

     
    2929; Show detailed tooltips (Unit stats)
    3030showdetailedtooltips = false
    3131
    32 ; Enable/disable the splashscreen
    33 splashscreendisable = false
    34 
    35 ; Splashscreen version (date of last modification). By default, 0 to force splashscreen to appear at first launch.
    36 splashscreenversion = 0
    37 
    3832; Pause the game on window focus loss (Only applicable to single player mode)
    3933pauseonfocusloss = true
    4034
     
    328322cursorblinkrate = 0.5             ; Cursor blink rate in seconds (0.0 to disable blinking)
    329323scale = 1.0                       ; GUI scaling factor, for improved compatibility with 4K displays
    330324
     325[gui.gamesetup]
     326enabletips = true                 ; Enable/Disable tips during gamesetup (for newcomers)
     327
    331328[gui.menu]
    332329limitfps = true                   ; Limit FPS in the menus and loading screen
    333330
     
    341338blinkduration = 1.7               ; The blink duration while pinging
    342339pingduration = 50.0               ; The duration for which an entity will be pinged after an attack notification
    343340
     341[gui.splashscreen]
     342enable = true                     ; Enable/disable the splashscreen
     343version = 0                       ; Splashscreen version (date of last modification). By default, 0 to force splashscreen to appear at first launch
     344
    344345[joystick]        ; EXPERIMENTAL: joystick/gamepad settings
    345346enable = false
    346347deadzone = 8192
  • binaries/data/mods/public/gui/gamesetup/ai.txt

     
     1Although reasonably easy for an experienced player, the default AI level is quite challenging for new players before they master the basic mechanisms of the game. It is advised to start by playing against a lower level (sandbox or very easy) when beginning with the game. Changing the AI level is done by clicking on the gear icon next to each AI player in the player selection panel above.
  • binaries/data/mods/public/gui/gamesetup/gamesetup.js

     
    303303
    304304    if (g_IsNetworked)
    305305        Engine.GetGUIObjectByName("chatInput").focus();
     306    else
     307        initSPTips();
    306308
    307309    if (g_IsController)
    308310    {
     
    340342    g_GameAttributes.mapFilter = "default";
    341343}
    342344
     345function initSPTips()
     346{
     347    if (Engine.ConfigDB_GetValue("user", "gui.gamesetup.enabletips") !== "true")
     348        return;
     349
     350    Engine.GetGUIObjectByName("spTips").hidden = false;
     351    Engine.GetGUIObjectByName("displaySPTips").checked = true;
     352    Engine.GetGUIObjectByName("aiTips").caption = Engine.TranslateLines(Engine.ReadFile("gui/gamesetup/ai.txt"));
     353}
     354
     355function saveSPTipsSetting()
     356{
     357    let enabled = String(Engine.GetGUIObjectByName("displaySPTips").checked);
     358    Engine.ConfigDB_CreateValue("user", "gui.gamesetup.enabletips", enabled);
     359    Engine.ConfigDB_WriteValueToFile("user", "gui.gamesetup.enabletips", enabled, "config/user.cfg");
     360}
     361
    343362/**
    344363 * Remove empty space in case of hidden options (like cheats, rating or wonder duration)
    345364 */
  • binaries/data/mods/public/gui/gamesetup/gamesetup.xml

     
    133133                </object>
    134134            </object>
    135135            <object size="24 64 100%-460 358" type="image" sprite="CoverFillDark" name="playerAssignmentsPanelCover" hidden="true"/>
     136
     137            <object size="24 370 560 520" type="image" name="spTips" hidden="true">
     138                <object size="4 10 28 34" type="image" sprite="ModernGear"/>
     139                <object name="aiTips" type="text" style="ModernLeftLabelText" size="32 0 100%-20 100%-32"/>
     140                <object size="30 100%-30 100% 100%-8" type="text" style="ModernLeftLabelText">
     141                    <translatableAttribute id="caption">Show this message in the future</translatableAttribute>
     142                </object>
     143                <object name="displaySPTips" size="8 100%-30 22 100%-8" type="checkbox" style="ModernTickBox">
     144                    <action on="Press">saveSPTipsSetting();</action>
     145                </object>
     146            </object>
    136147            <!-- Map selection -->
    137148
    138149            <object size="100%-425 355 100%-285 470" name="mapTypeTooltip">
  • binaries/data/mods/public/gui/options/options.json

     
    2727        },
    2828        {
    2929            "type": "boolean",
    30             "label": "Disable Welcome Screen",
     30            "label": "Enable Welcome Screen",
    3131            "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             "parameters": { "config": "splashscreendisable" }
     32            "parameters": { "config": "gui.splashscreen.enable" }
    3333        },
    3434        {
    3535            "type": "boolean",
     36            "label": "Enable Game Setting Tips",
     37            "tooltip": "Show tips when setting a game.",
     38            "parameters": { "config": "gui.gamesetup.enabletips" }
     39        },
     40        {
     41            "type": "boolean",
    3642            "label": "Detailed Tooltips",
    3743            "tooltip": "Show detailed tooltips for trainable units in unit-producing buildings.",
    3844            "parameters": { "config": "showdetailedtooltips" }
  • binaries/data/mods/public/gui/pregame/mainmenu.js

     
    128128    {
    129129        g_ShowSplashScreens = false;
    130130
    131         if (Engine.ConfigDB_GetValue("user", "splashscreendisable") !== "true" ||
    132             Engine.ConfigDB_GetValue("user", "splashscreenversion") < Engine.GetFileMTime("gui/splashscreen/splashscreen.txt"))
     131        if (Engine.ConfigDB_GetValue("user", "gui.splashscreen.enable") === "true" ||
     132            Engine.ConfigDB_GetValue("user", "gui.splashscreen.version") < Engine.GetFileMTime("gui/splashscreen/splashscreen.txt"))
    133133            Engine.PushGuiPage("page_splashscreen.xml", { "page": "splashscreen", callback : "SplashScreenClosedCallback" } );
    134134        else
    135135            ShowRenderPathMessage();
  • 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", "splashscreendisable") !== "true";
     4    Engine.GetGUIObjectByName("displaySplashScreen").checked = Engine.ConfigDB_GetValue("user", "gui.splashscreen.enable") === "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 disabled = "" + !Engine.GetGUIObjectByName("displaySplashScreen").checked;
    31             Engine.ConfigDB_CreateValue("user", "splashscreendisable", disabled);
    32             Engine.ConfigDB_WriteValueToFile("user", "splashscreendisable", disabled, "config/user.cfg");
     30            let enabled = String(Engine.GetGUIObjectByName("displaySplashScreen").checked);
     31            Engine.ConfigDB_CreateValue("user", "gui.splashscreen.enable", enabled);
     32            Engine.ConfigDB_WriteValueToFile("user", "gui.splashscreen.enable", enabled, "config/user.cfg");
    3333            let version = Engine.GetFileMTime("gui/splashscreen/splashscreen.txt");
    34             Engine.ConfigDB_CreateValue("user", "splashscreenversion", version);
    35             Engine.ConfigDB_WriteValueToFile("user", "splashscreenversion", version, "config/user.cfg");
     34            Engine.ConfigDB_CreateValue("user", "gui.splashscreen.version", version);
     35            Engine.ConfigDB_WriteValueToFile("user", "gui.splashscreen.version", version, "config/user.cfg");
    3636            Engine.PopGuiPageCB();
    3737            ]]></action>
    3838        </object>
  • binaries/data/mods/public/l10n/messages.json

     
    349349            {
    350350                "extractor": "txt",
    351351                "filemasks": [
     352                    "gui/gamesetup/**.txt",
    352353                    "gui/splashscreen/splashscreen.txt",
    353354                    "gui/text/tips/**.txt"
    354355                ],