Index: binaries/data/config/default.cfg =================================================================== --- binaries/data/config/default.cfg +++ binaries/data/config/default.cfg @@ -236,6 +236,10 @@ ;9 = ;10 = +[hotkey.loading] +previoustip = "LeftArrow" +nexttip = "RightArrow" + [hotkey.profile] toggle = "F11" ; Enable/disable real-time profiler save = "Shift+F11" ; Save current profiler data to logs/profile.txt Index: binaries/data/mods/public/gui/loading/loading.js =================================================================== --- binaries/data/mods/public/gui/loading/loading.js +++ binaries/data/mods/public/gui/loading/loading.js @@ -14,43 +14,42 @@ var g_TipsImagePath = "loading/tips/"; var g_Data; +var g_TipIndex = 0; +var g_Tips; var g_EndPieceWidth = 16; function init(data) { g_Data = data; - Engine.SetCursor("cursor-wait"); - let tipFile = pickRandom(listFiles(g_TipsTextPath, ".txt", false)); - - if (tipFile) - { - let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n"); - Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift(); - Engine.GetGUIObjectByName("tipText").caption = tipText.join("\n"); - Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png"; - } - else - error("Failed to find any matching tips for the loading screen."); - // janwas: main loop now sets progress / description, but that won't // happen until the first timeslice completes, so set initial values. let loadingMapName = Engine.GetGUIObjectByName("loadingMapName"); if (data) { + g_Tips = listFiles(g_TipsTextPath, ".txt", false); + let tipControlsEnabled = !data.isNetworked && g_Tips && g_Tips.length > 0; + Engine.GetGUIObjectByName("prevTipButton").hidden = !tipControlsEnabled; + Engine.GetGUIObjectByName("nextTipButton").hidden = !tipControlsEnabled; + nextTip(); + + if(!tipControlsEnabled) + Engine.SetCursor("cursor-wait"); + let mapName = translate(data.attribs.settings.Name); switch (data.attribs.mapType) { + case "random": + loadingMapName.caption = sprintf(translate("Generating ΓÇ£%(map)sΓÇ¥"), { "map": mapName }); + break; + case "skirmish": case "scenario": - loadingMapName.caption = sprintf(translate("Loading ΓÇ£%(map)sΓÇ¥"), { "map": mapName }); + default: + loadingMapName.caption = sprintf(translate("Loading ΓÇ£%(map)sΓÇ¥"), { "map": mapName }); break; - - case "random": - loadingMapName.caption = sprintf(translate("Generating ΓÇ£%(map)sΓÇ¥"), { "map": mapName }); - break; } } @@ -72,9 +71,6 @@ Engine.GetGUIObjectByName("progressbar").caption = progress; // display current progress Engine.GetGUIObjectByName("progressText").caption = progress + "%"; - // Displays detailed loading info rather than a percent - // Engine.GetGUIObjectByName("progressText").caption = g_LoadDescription; // display current progess details - // Keep curved right edge of progress bar in sync with the rest of the progress bar let middle = Engine.GetGUIObjectByName("progressbar"); let rightSide = Engine.GetGUIObjectByName("progressbar_right"); @@ -94,7 +90,46 @@ */ function reallyStartGame() { + // Do not show the buttons in multiplayer. The check is done above when deciding whether to display the buttons. + if (Engine.GetGUIObjectByName("prevTipButton").hidden && Engine.GetGUIObjectByName("prevTipButton").hidden) + { + Engine.SwitchGuiPage("page_session.xml", g_Data); + Engine.ResetCursor(); + return; + } + + Engine.GetGUIObjectByName("startGameButton").hidden = false; + Engine.SetPaused(true); +} + +function startGame() +{ + Engine.SetPaused(false); Engine.SwitchGuiPage("page_session.xml", g_Data); +} - Engine.ResetCursor(); +function nextTip() +{ + updateTip((g_TipIndex + 1) % g_Tips.length); } + +function prevTip() +{ + updateTip((g_Tips.length + g_TipIndex - 1) % g_Tips.length); +} + + +function updateTip(nextTipIndex) +{ + g_TipIndex = nextTipIndex; + let tipFile = g_Tips[g_TipIndex]; + if (tipFile) + { + let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n"); + Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift(); + Engine.GetGUIObjectByName("tipText").caption = tipText.join("\n"); + Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png"; + } + else + error("Failed to find any matching tips for the loading screen."); +} Index: binaries/data/mods/public/gui/loading/loading.xml =================================================================== --- binaries/data/mods/public/gui/loading/loading.xml +++ binaries/data/mods/public/gui/loading/loading.xml @@ -40,6 +40,18 @@ + + + + Previous + prevTip(); + + + + + Next + nextTip(); + @@ -47,4 +59,10 @@ + + + Index: binaries/data/mods/public/gui/manual/intro.txt =================================================================== --- binaries/data/mods/public/gui/manual/intro.txt +++ binaries/data/mods/public/gui/manual/intro.txt @@ -52,6 +52,10 @@ Tab, Alt + S: Switch to the next tab. Shift + Tab, Alt + W: Switch to the previous tab. +[font="sans-bold-14"]Loadin screen +Left arrow: switch back to the previous tip +Right arrow: switch to the next tip. + [font="sans-bold-14"]In Game [font="sans-14"]Double Left Click \[on unit]: Select all of your units of the same kind on the screen (even if they're different ranks) Triple Left Click \[on unit]: Select all of your units of the same kind and the same rank on the screen