Index: binaries/data/mods/public/gui/common/styles.xml
===================================================================
--- binaries/data/mods/public/gui/common/styles.xml
+++ binaries/data/mods/public/gui/common/styles.xml
@@ -204,4 +204,17 @@
text_valign="center"
/>
+
+
Index: binaries/data/mods/public/gui/gamesetup/gamesetup.js
===================================================================
--- binaries/data/mods/public/gui/gamesetup/gamesetup.js
+++ binaries/data/mods/public/gui/gamesetup/gamesetup.js
@@ -176,6 +176,11 @@
var g_IsController;
/**
+ * Whether this is a tutorial.
+ */
+var g_IsTutorial;
+
+/**
* To report the game to the lobby bot.
*/
var g_ServerName;
@@ -265,6 +270,7 @@
g_IsNetworked = attribs.type != "offline";
g_IsController = attribs.type != "client";
+ g_IsTutorial = attribs.tutorial && attribs.tutorial == true;
g_ServerName = attribs.serverName;
g_ServerPort = attribs.serverPort;
@@ -970,6 +976,9 @@
*/
function loadPersistMatchSettings()
{
+ if (g_IsTutorial)
+ return;
+
if (Engine.ConfigDB_GetValue("user", "persistmatchsettings") != "true")
return;
@@ -1023,6 +1032,8 @@
function savePersistMatchSettings()
{
+ if (g_IsTutorial)
+ return;
let attributes = Engine.ConfigDB_GetValue("user", "persistmatchsettings") == "true" ? g_GameAttributes : {};
Engine.WriteJSONFile(g_IsNetworked ? g_MatchSettings_MP : g_MatchSettings_SP, attributes);
}
@@ -1095,12 +1106,18 @@
else if (g_LoadingState == 1)
{
Engine.GetGUIObjectByName("loadingWindow").hidden = true;
- Engine.GetGUIObjectByName("setupWindow").hidden = false;
+ Engine.GetGUIObjectByName("setupWindow").hidden = g_IsTutorial;
initGUIObjects();
++g_LoadingState;
}
else if (g_LoadingState == 2)
{
+ if (g_IsTutorial)
+ {
+ launchTutorial();
+ return;
+ }
+
while (true)
{
let message = Engine.PollNetworkClient();
@@ -1375,12 +1392,18 @@
Engine.StartGame(g_GameAttributes, playerID);
Engine.SwitchGuiPage("page_loading.xml", {
"attribs": g_GameAttributes,
- "isNetworked" : g_IsNetworked,
+ "isNetworked": g_IsNetworked,
"playerAssignments": g_PlayerAssignments
});
}
}
+function launchTutorial()
+{
+ selectMap("maps/tutorials/starting_economy_walkthrough");
+ launchGame();
+}
+
/**
* Don't set any attributes here, just show the changes in the GUI.
*
Index: binaries/data/mods/public/gui/pregame/mainmenu.xml
===================================================================
--- binaries/data/mods/public/gui/pregame/mainmenu.xml
+++ binaries/data/mods/public/gui/pregame/mainmenu.xml
@@ -4,6 +4,7 @@
+
@@ -156,11 +157,25 @@
+
+
+