Index: binaries/data/mods/public/gui/common/network.js
===================================================================
--- binaries/data/mods/public/gui/common/network.js (revision 16944)
+++ binaries/data/mods/public/gui/common/network.js (working copy)
@@ -4,12 +4,13 @@
switch (id)
{
case 0: return translate("Unknown reason");
case 1: return translate("Unexpected shutdown");
case 2: return translate("Incorrect network protocol version");
- case 3: return translate("Game has already started");
- default: return sprintf(translate("\\[Invalid value %(id)s]"), { id: id });
+ case 3: return translate("Game is loading, please try later");
+ case 4: return translate("Game has already started, no observers allowed");
+ default: return sprintf(translate("\\[Invalid value %(id)s]"), { "id": id });
}
}
function reportDisconnect(reason)
{
Index: binaries/data/mods/public/gui/gamesetup/gamesetup.js
===================================================================
--- binaries/data/mods/public/gui/gamesetup/gamesetup.js (revision 16944)
+++ binaries/data/mods/public/gui/gamesetup/gamesetup.js (working copy)
@@ -152,10 +152,24 @@
var mapFilters = Engine.GetGUIObjectByName("mapFilterSelection");
mapFilters.list = getFilterNames();
mapFilters.list_data = getFilterIds();
g_GameAttributes.mapFilter = "default";
+ // For singleplayer reduce the size of more options dialog by three options (cheats, rated game, observer late join = 90px)
+ if (!g_IsNetworked)
+ {
+ Engine.GetGUIObjectByName("moreOptions").size = "50%-200 50%-195 50%+200 50%+160";
+ Engine.GetGUIObjectByName("hideMoreOptions").size = "50%-70 310 50%+70 336";
+ }
+ // For non-lobby multiplayergames reduce the size of the dialog by one option (rated game, 30px)
+ else if (g_IsNetworked && !Engine.HasXmppClient())
+ {
+ Engine.GetGUIObjectByName("moreOptions").size = "50%-200 50%-195 50%+200 50%+220";
+ Engine.GetGUIObjectByName("hideMoreOptions").size = "50%-70 370 50%+70 396";
+ Engine.GetGUIObjectByName("optionObserverLateJoin").size = "14 338 94% 366";
+ }
+
// Setup controls for host only
if (g_IsController)
{
mapTypes.selected = 0;
mapFilters.selected = 0;
@@ -253,10 +267,15 @@
Engine.GetGUIObjectByName("exploreMap").onPress = function() {
g_GameAttributes.settings.ExploreMap = this.checked;
updateGameAttributes();
};
+ Engine.GetGUIObjectByName("observerLateJoin").onPress = function() {
+ g_GameAttributes.settings.ObserverLateJoin = this.checked;
+ updateGameAttributes();
+ };
+
Engine.GetGUIObjectByName("disableTreasures").onPress = function() {
g_GameAttributes.settings.DisableTreasures = this.checked;
updateGameAttributes();
};
@@ -314,10 +333,11 @@
}
else
{
Engine.GetGUIObjectByName("optionCheats").hidden = false;
Engine.GetGUIObjectByName("enableCheats").checked = false;
+ Engine.GetGUIObjectByName("optionObserverLateJoin").hidden = false;
g_GameAttributes.settings.CheatsEnabled = false;
// Setup ranked option if we are connected to the lobby.
if (Engine.HasXmppClient())
{
Engine.GetGUIObjectByName("optionRating").hidden = false;
@@ -329,10 +349,13 @@
}
if (g_IsController)
{
Engine.GetGUIObjectByName("enableCheatsText").hidden = true;
Engine.GetGUIObjectByName("enableCheats").hidden = false;
+ Engine.GetGUIObjectByName("observerLateJoinText").hidden = true;
+ Engine.GetGUIObjectByName("observerLateJoin").hidden = false;
+
if (Engine.HasXmppClient())
{
Engine.GetGUIObjectByName("enableRatingText").hidden = true;
Engine.GetGUIObjectByName("enableRating").hidden = false;
}
@@ -1186,14 +1209,16 @@
var enableCheats = Engine.GetGUIObjectByName("enableCheats");
var enableRating = Engine.GetGUIObjectByName("enableRating");
var populationCap = Engine.GetGUIObjectByName("populationCap");
var startingResources = Engine.GetGUIObjectByName("startingResources");
var ceasefire = Engine.GetGUIObjectByName("ceasefire");
+ var observerLateJoin = Engine.GetGUIObjectByName("observerLateJoin");
var numPlayersText= Engine.GetGUIObjectByName("numPlayersText");
var mapSizeDesc = Engine.GetGUIObjectByName("mapSizeDesc");
var mapSizeText = Engine.GetGUIObjectByName("mapSizeText");
+ var observerLateJoinText = Engine.GetGUIObjectByName("observerLateJoinText");
var revealMapText = Engine.GetGUIObjectByName("revealMapText");
var exploreMapText = Engine.GetGUIObjectByName("exploreMapText");
var disableTreasuresText = Engine.GetGUIObjectByName("disableTreasuresText");
var victoryConditionText = Engine.GetGUIObjectByName("victoryConditionText");
var lockTeamsText = Engine.GetGUIObjectByName("lockTeamsText");
@@ -1220,10 +1245,14 @@
enableCheats.enabled = !enableRating.checked;
lockTeams.enabled = !enableRating.checked;
}
else
enableRatingText.caption = "Unknown";
+
+ observerLateJoin.checked = g_GameAttributes.settings.ObserverLateJoin;
+ observerLateJoinText.caption = observerLateJoin.checked ? translate("Yes") : translate("No");
+
gameSpeedText.caption = g_GameSpeeds.names[speedIdx];
gameSpeedBox.selected = speedIdx;
populationCap.selected = (mapSettings.PopulationCap !== undefined && POPULATION_CAP_DATA.indexOf(mapSettings.PopulationCap) != -1 ? POPULATION_CAP_DATA.indexOf(mapSettings.PopulationCap) : POPULATION_CAP_DEFAULTIDX);
populationCapText.caption = POPULATION_CAP[populationCap.selected];
startingResources.selected = (mapSettings.StartingResources !== undefined && STARTING_RESOURCES_DATA.indexOf(mapSettings.StartingResources) != -1 ? STARTING_RESOURCES_DATA.indexOf(mapSettings.StartingResources) : STARTING_RESOURCES_DEFAULTIDX);
Index: binaries/data/mods/public/gui/gamesetup/gamesetup.xml
===================================================================
--- binaries/data/mods/public/gui/gamesetup/gamesetup.xml (revision 16944)
+++ binaries/data/mods/public/gui/gamesetup/gamesetup.xml (working copy)
@@ -268,11 +268,11 @@
-