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,16 @@
pauseGame();
let extendedSimState = Engine.GuiInterfaceCall("GetExtendedSimulationState");
+ let playersToShow = [];
+
+ playersToShow = extendedSimState.players.filter((state,player) =>
+ g_IsObserver || player == 0 || player == g_ViewedPlayer ||
+ extendedSimState.players[g_ViewedPlayer].hasSharedLos && g_Players[player].isMutualAlly[g_ViewedPlayer]);
+
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,18 @@
debug.caption = text.replace(/\[/g, "\\[");
}
+function getAllyStatTooltip(resource)
+{
+ let playersState = GetSimState().players;
+
+ return playersState.map((state, player) => sprintf(translate("\n%(playername)s: %(statValue)s"),{
+ "playername": colorizePlayernameByID(player),
+ "statValue": resource == "pop" ? state.popCount + "/" + state.popLimit : state.resourceCounts[resource]
+ })).filter((state, player) =>
+ player != 0 && player != g_ViewedPlayer &&
+ (g_IsObserver || playersState[g_ViewedPlayer].hasSharedLos && g_Players[player].isMutualAlly[g_ViewedPlayer])).join("");
+}
+
function updatePlayerDisplay()
{
let playerState = GetSimState().players[g_ViewedPlayer];
@@ -939,13 +950,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": cmpTechnologyManager ? cmpTechnologyManager.IsTechnologyResearched("unlock_shared_los") : null,
"hasSharedDropsites": cmpPlayer.HasSharedDropsites(),
"phase": phase,
"isAlly": allies,