Ticket #4406: ai-info-v2.patch
File ai-info-v2.patch, 8.5 KB (added by , 7 years ago) |
---|
-
binaries/data/config/default.cfg
29 29 ; Show detailed tooltips (Unit stats) 30 30 showdetailedtooltips = false 31 31 32 ; Enable/disable the splashscreen33 splashscreendisable = false34 35 ; Splashscreen version (date of last modification). By default, 0 to force splashscreen to appear at first launch.36 splashscreenversion = 037 38 32 ; Pause the game on window focus loss (Only applicable to single player mode) 39 33 pauseonfocusloss = true 40 34 … … 327 321 [gui] 328 322 cursorblinkrate = 0.5 ; Cursor blink rate in seconds (0.0 to disable blinking) 329 323 scale = 1.0 ; GUI scaling factor, for improved compatibility with 4K displays 324 enablesplashscreen = true ; Enable/disable the splashscreen 325 splashscreenversion = 0 ; Splashscreen version (date of last modification). By default, 0 to force splashscreen to appear at first launch 326 enablespinfo = true ; Enable/Disable tips for SP newcomers 330 327 331 328 [gui.menu] 332 329 limitfps = true ; Limit FPS in the menus and loading screen -
binaries/data/mods/public/gui/gamesetup/gamesetup.js
303 303 304 304 if (g_IsNetworked) 305 305 Engine.GetGUIObjectByName("chatInput").focus(); 306 else 307 initSPInfo(); 306 308 307 309 if (g_IsController) 308 310 { … … 340 342 g_GameAttributes.mapFilter = "default"; 341 343 } 342 344 345 function initSPInfo() 346 { 347 if (Engine.ConfigDB_GetValue("user", "gui.enablespinfo") !== "true") 348 return; 349 350 let tips = Engine.ReadJSONFile("gui/gamesetup/singleplayerTips.json"); 351 Engine.GetGUIObjectByName("spInfo").hidden = false; 352 Engine.GetGUIObjectByName("displaySPInfo").checked = true; 353 Engine.GetGUIObjectByName("aiInfo").caption = Engine.TranslateLines(tips.ai); 354 } 355 343 356 /** 344 357 * Remove empty space in case of hidden options (like cheats, rating or wonder duration) 345 358 */ … … 1998 2011 g_LastGameStanza = stanza; 1999 2012 Engine.SendRegisterGame(stanza); 2000 2013 } 2014 2015 function saveSPInfoSetting() 2016 { 2017 let enabled = String(Engine.GetGUIObjectByName("displaySPInfo").checked); 2018 Engine.ConfigDB_CreateValue("user", "gui.enablespinfo", enabled); 2019 Engine.ConfigDB_WriteValueToFile("user", "gui.enablespinfo", enabled, "config/user.cfg"); 2020 } -
binaries/data/mods/public/gui/gamesetup/gamesetup.xml
133 133 </object> 134 134 </object> 135 135 <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="spInfo" hidden="true"> 138 <object size="4 10 28 34" type="image" sprite="ModernGear"/> 139 <object name="aiInfo" 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="displaySPInfo" size="8 100%-30 22 100%-8" type="checkbox" style="ModernTickBox"> 144 <action on="Press">saveSPInfoSetting();</action> 145 </object> 146 </object> 136 147 <!-- Map selection --> 137 148 138 149 <object size="100%-425 355 100%-285 470" name="mapTypeTooltip"> -
binaries/data/mods/public/gui/gamesetup/singleplayerTips.json
1 { 2 "ai": "Although 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." 3 } -
binaries/data/mods/public/gui/options/options.json
27 27 }, 28 28 { 29 29 "type": "boolean", 30 "label": " Disable Welcome Screen",30 "label": "Enable Welcome Screen", 31 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 "parameters": { "config": " splashscreendisable" }32 "parameters": { "config": "gui.enablesplashscreen" } 33 33 }, 34 34 { 35 35 "type": "boolean", 36 "label": "Enable SP info panel", 37 "tooltip": "Show the SP info panel with some tips for newcomers.", 38 "parameters": { "config": "gui.enablespinfo" } 39 }, 40 { 41 "type": "boolean", 36 42 "label": "Detailed Tooltips", 37 43 "tooltip": "Show detailed tooltips for trainable units in unit-producing buildings.", 38 44 "parameters": { "config": "showdetailedtooltips" } -
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" ||132 Engine.ConfigDB_GetValue("user", " splashscreenversion") < Engine.GetFileMTime("gui/splashscreen/splashscreen.txt"))131 if (Engine.ConfigDB_GetValue("user", "gui.enablesplashscreen") === "true" || 132 Engine.ConfigDB_GetValue("user", "gui.splashscreenversion") < Engine.GetFileMTime("gui/splashscreen/splashscreen.txt")) 133 133 Engine.PushGuiPage("page_splashscreen.xml", { "page": "splashscreen", callback : "SplashScreenClosedCallback" } ); 134 134 else 135 135 ShowRenderPathMessage(); -
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", " splashscreendisable") !== "true";4 Engine.GetGUIObjectByName("displaySplashScreen").checked = Engine.ConfigDB_GetValue("user", "gui.enablesplashscreen") === "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 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.enablesplashscreen", enabled); 32 Engine.ConfigDB_WriteValueToFile("user", "gui.enablesplashscreen", enabled, "config/user.cfg"); 33 33 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.splashscreenversion", version); 35 Engine.ConfigDB_WriteValueToFile("user", "gui.splashscreenversion", version, "config/user.cfg"); 36 36 Engine.PopGuiPageCB(); 37 37 ]]></action> 38 38 </object>