Index: binaries/data/mods/public/gui/session/menu.js
===================================================================
--- binaries/data/mods/public/gui/session/menu.js (revision 18470)
+++ binaries/data/mods/public/gui/session/menu.js (working copy)
@@ -617,10 +617,19 @@
pauseGame();
let extendedSimState = Engine.GuiInterfaceCall("GetExtendedSimulationState");
+ let playersToShow = [];
+
+ if (g_ViewedPlayer < 1 || extendedSimState.players[g_ViewedPlayer].state != "active")
+ playersToShow = extendedSimState.players;
+ else
+ for (let player in g_Players)
+ if (player == 0 || player == g_ViewedPlayer || extendedSimState.players[g_ViewedPlayer].hasSharedLos && g_Players[player].isMutualAlly[g_ViewedPlayer])
+ playersToShow.push(extendedSimState.players[player]);
+
Engine.PushGuiPage("page_summary.xml", {
"sim": {
"mapSettings": g_GameAttributes.settings,
- "playerStates": extendedSimState.players,
+ "playerStates": playersToShow,
"timeElapsed" : extendedSimState.timeElapsed
},
"gui": {
Index: binaries/data/mods/public/gui/session/menu.xml
===================================================================
--- binaries/data/mods/public/gui/session/menu.xml (revision 18470)
+++ binaries/data/mods/public/gui/session/menu.xml (working copy)
@@ -48,7 +48,6 @@
style="StoneButtonFancy"
size="0 96 100% 124"
tooltip_style="sessionToolTip"
- enabled="false"
>
Summary
openGameSummary();
Index: binaries/data/mods/public/gui/session/session.js
===================================================================
--- binaries/data/mods/public/gui/session/session.js (revision 18470)
+++ binaries/data/mods/public/gui/session/session.js (working copy)
@@ -480,7 +480,6 @@
// Disable stuff observers shouldn't use
Engine.GetGUIObjectByName("pauseButton").enabled = !g_IsObserver || !g_IsNetworked;
Engine.GetGUIObjectByName("menuResignButton").enabled = !g_IsObserver;
- Engine.GetGUIObjectByName("summaryButton").enabled = g_IsObserver;
}
function reportPerformance(time)
@@ -933,6 +932,21 @@
debug.caption = text.replace(/\[/g, "\\[");
}
+function getAllyStatTooltip(resource)
+{
+ let playersState = GetSimState().players;
+ let ret = "";
+ for (let player in playersState)
+ if (player != 0 && player != g_ViewedPlayer &&
+ (g_ViewedPlayer < 1 || playersState[g_ViewedPlayer].state != "active" ||
+ playersState[g_ViewedPlayer].hasSharedLos && g_Players[player].isMutualAlly[g_ViewedPlayer]))
+ ret += '\n[color="'+ rgbToGuiColor(g_Players[player].color) +'"]' + playersState[player].name + '[/color]: ' +
+ (resource == "pop" ?
+ (playersState[player].popCount + "/" + playersState[player].popLimit) :
+ playersState[player].resourceCounts[resource]);
+ return ret;
+}
+
function updatePlayerDisplay()
{
let playerState = GetSimState().players[g_ViewedPlayer];
@@ -939,13 +953,21 @@
if (!playerState)
return;
- Engine.GetGUIObjectByName("resourceFood").caption = Math.floor(playerState.resourceCounts.food);
- Engine.GetGUIObjectByName("resourceWood").caption = Math.floor(playerState.resourceCounts.wood);
- Engine.GetGUIObjectByName("resourceStone").caption = Math.floor(playerState.resourceCounts.stone);
- Engine.GetGUIObjectByName("resourceMetal").caption = Math.floor(playerState.resourceCounts.metal);
+ let translatedResources = {
+ "food": translate("Food"),
+ "wood": translate("Wood"),
+ "stone": translate("Stone"),
+ "metal": translate("Metal")
+ }
+ for (let res of RESOURCES)
+ {
+ Engine.GetGUIObjectByName("resource_" + res).caption = Math.floor(playerState.resourceCounts[res]);
+ Engine.GetGUIObjectByName(res).tooltip = translatedResources[res] + getAllyStatTooltip(res);
+ }
Engine.GetGUIObjectByName("resourcePop").caption = playerState.popCount + "/" + playerState.popLimit;
Engine.GetGUIObjectByName("population").tooltip = translate("Population (current / limit)") + "\n" +
- sprintf(translate("Maximum population: %(popCap)s"), { "popCap": playerState.popMax });
+ sprintf(translate("Maximum population: %(popCap)s"), { "popCap": playerState.popMax }) +
+ getAllyStatTooltip("pop");
g_IsTrainingBlocked = playerState.trainingBlocked;
}
Index: binaries/data/mods/public/gui/session/top_panel/resource_food.xml
===================================================================
--- binaries/data/mods/public/gui/session/top_panel/resource_food.xml (revision 18470)
+++ binaries/data/mods/public/gui/session/top_panel/resource_food.xml (working copy)
@@ -1,6 +1,5 @@
Index: binaries/data/mods/public/gui/session/top_panel/resource_metal.xml
===================================================================
--- binaries/data/mods/public/gui/session/top_panel/resource_metal.xml (revision 18470)
+++ binaries/data/mods/public/gui/session/top_panel/resource_metal.xml (working copy)
@@ -1,6 +1,5 @@
- Metal
-
+
Index: binaries/data/mods/public/gui/session/top_panel/resource_stone.xml
===================================================================
--- binaries/data/mods/public/gui/session/top_panel/resource_stone.xml (revision 18470)
+++ binaries/data/mods/public/gui/session/top_panel/resource_stone.xml (working copy)
@@ -1,6 +1,5 @@
- Stone
-
+
Index: binaries/data/mods/public/gui/session/top_panel/resource_wood.xml
===================================================================
--- binaries/data/mods/public/gui/session/top_panel/resource_wood.xml (revision 18470)
+++ binaries/data/mods/public/gui/session/top_panel/resource_wood.xml (working copy)
@@ -1,6 +1,5 @@
- Wood
-
+
Index: binaries/data/mods/public/simulation/components/GuiInterface.js
===================================================================
--- binaries/data/mods/public/simulation/components/GuiInterface.js (revision 18470)
+++ binaries/data/mods/public/simulation/components/GuiInterface.js (working copy)
@@ -106,6 +106,7 @@
"teamsLocked": cmpPlayer.GetLockTeams(),
"cheatsEnabled": cmpPlayer.GetCheatsEnabled(),
"disabledTemplates": cmpPlayer.GetDisabledTemplates(),
+ "hasSharedLos": cmpPlayer.HasSharedLos(),
"hasSharedDropsites": cmpPlayer.HasSharedDropsites(),
"phase": phase,
"isAlly": allies,
Index: binaries/data/mods/public/simulation/components/Player.js
===================================================================
--- binaries/data/mods/public/simulation/components/Player.js (revision 18470)
+++ binaries/data/mods/public/simulation/components/Player.js (working copy)
@@ -34,6 +34,7 @@
this.teamsLocked = false;
this.state = "active"; // game state - one of "active", "defeated", "won"
this.diplomacy = []; // array of diplomatic stances for this player with respect to other players (including gaia and self)
+ this.sharedLos = false;
this.sharedDropsites = false;
this.formations = [];
this.startCam = undefined;
@@ -545,6 +546,11 @@
return this.startCam !== undefined;
};
+Player.prototype.HasSharedLos = function()
+{
+ return this.sharedLos;
+};
+
Player.prototype.HasSharedDropsites = function()
{
return this.sharedDropsites;
@@ -702,7 +708,10 @@
Player.prototype.OnResearchFinished = function(msg)
{
if (msg.tech == this.template.SharedLosTech)
+ {
this.UpdateSharedLos();
+ this.sharedLos = true;
+ }
else if (msg.tech == this.template.SharedDropsitesTech)
this.sharedDropsites = true;
};