diff --git a/binaries/data/mods/public/gui/summary/.summary.js.swp b/binaries/data/mods/public/gui/summary/.summary.js.swp
new file mode 100644
index 0000000..0ae8bf3
Binary files /dev/null and b/binaries/data/mods/public/gui/summary/.summary.js.swp differ
diff --git a/binaries/data/mods/public/gui/summary/summary.js b/binaries/data/mods/public/gui/summary/summary.js
index 186d371..0d9ee5b 100644
a
|
b
|
function init(data)
|
91 | 91 | getGUIObjectByName("militaryScoreHeading").size = left + " 16 " + (left + width) + " 100%"; left += width; |
92 | 92 | getGUIObjectByName("explorationScoreHeading").size = left + " 16 " + (left + width) + " 100%"; left += width; |
93 | 93 | getGUIObjectByName("totalScoreHeading").size = left + " 16 " + (left + width) + " 100%"; left += width; |
| 94 | getGUIObjectByName("teamHeading").size = left + " 16 " + (left + width) + " 100%"; left += width; |
| 95 | getGUIObjectByName("teamScoreHeading").size = left + " 16 " + (left + width) + " 100%"; left += width; |
94 | 96 | |
95 | 97 | left = 50; |
96 | 98 | getGUIObjectByName("playerName1Heading").size = left + " 26 " + (left + playerNameHeadingWidth) + " 100%"; left += playerNameHeadingWidth; |
… |
… |
function init(data)
|
127 | 129 | getGUIObjectByName("barterEfficiencyHeading").size = left + " 16 " + (left + width) + " 100%"; left += width; |
128 | 130 | getGUIObjectByName("tradeIncomeHeading").size = left + " 16 " + (left + width) + " 100%"; left += width; |
129 | 131 | |
| 132 | //Calculate player scores and team scores. |
| 133 | //playerScoresWhatever[i] stores the scores for the player i. |
| 134 | var playerScoreValueEconomy = new Array(); |
| 135 | var playerScoreValueMilitary = new Array(); |
| 136 | var playerScoreValueExploration = new Array(); |
| 137 | var playerScoreValueTotal = new Array(); |
| 138 | var teamScoreValue = new Array(); |
| 139 | for (var i = 0; i < maxPlayers; ++i) |
| 140 | { |
| 141 | teamScoreValue[i] = 0; |
| 142 | } |
| 143 | for (var i = 0; i < maxPlayers; ++i) |
| 144 | { |
| 145 | var playerState = data.playerStates[i+1]; |
| 146 | playerScoreValueEconomy[i] = Math.round((playerState.statistics.resourcesGathered.food |
| 147 | + playerState.statistics.resourcesGathered.wood + |
| 148 | playerState.statistics.resourcesGathered.stone + |
| 149 | playerState.statistics.resourcesGathered.metal) / 10); |
| 150 | playerScoreValueMilitary[i] = Math.round((playerState.statistics.enemyUnitsKilledValue |
| 151 | + playerState.statistics.enemyBuildingsDestroyedValue) / 10); |
| 152 | playerScoreValueExploration[i] = playerState.statistics.percentMapExplored * 10; |
| 153 | playerScoreValueTotal[i] = playerScoreValueEconomy[i] + playerScoreValueMilitary[i] + playerScoreValueExploration[i]; |
| 154 | if (playerState.team != -1) |
| 155 | { |
| 156 | teamScoreValue[playerState.team] += playerScoreValueTotal[i] + playerState.statistics.tradeIncome; |
| 157 | } |
| 158 | } |
| 159 | |
130 | 160 | // Show counters |
131 | 161 | for (var i = 0; i < MAX_SLOTS; ++i) |
132 | 162 | { |
… |
… |
function init(data)
|
160 | 190 | var militaryScore = getGUIObjectByName("militaryScore["+i+"]"); |
161 | 191 | var explorationScore = getGUIObjectByName("explorationScore["+i+"]"); |
162 | 192 | var totalScore = getGUIObjectByName("totalScore["+i+"]"); |
| 193 | var team = getGUIObjectByName("team["+i+"]"); |
| 194 | var teamScore = getGUIObjectByName("teamScore["+i+"]"); |
163 | 195 | |
164 | 196 | var unitsTrained = getGUIObjectByName("unitsTrained["+i+"]"); |
165 | 197 | var unitsLost = getGUIObjectByName("unitsLost["+i+"]"); |
… |
… |
function init(data)
|
195 | 227 | militaryScore.size = left + " 2 " + (left + width) + " 100%"; left += width; |
196 | 228 | explorationScore.size = left + " 2 " + (left + width) + " 100%"; left += width; |
197 | 229 | totalScore.size = left + " 2 " + (left + width) + " 100%"; left += width; |
| 230 | team.size = left + " 2 " + (left + width) + " 100%"; left += width; |
| 231 | teamScore.size = left + " 2 " + (left + width) + " 100%"; left += width; |
198 | 232 | var size = getGUIObjectByName("playerBox0["+i+"]").size; |
199 | 233 | size.right = left + 10; |
200 | 234 | getGUIObjectByName("playerBox0["+i+"]").size = size; |
… |
… |
function init(data)
|
242 | 276 | getGUIObjectByName("playerBox4["+i+"]").size = size; |
243 | 277 | |
244 | 278 | // display counters |
245 | | economyScore.caption = Math.round((playerState.statistics.resourcesGathered.food + playerState.statistics.resourcesGathered.wood + |
246 | | playerState.statistics.resourcesGathered.stone + playerState.statistics.resourcesGathered.metal) / 10); |
247 | | militaryScore.caption = Math.round((playerState.statistics.enemyUnitsKilledValue + playerState.statistics.enemyBuildingsDestroyedValue) / 10); |
248 | | explorationScore.caption = playerState.statistics.percentMapExplored * 10; |
249 | | totalScore.caption = Number(economyScore.caption) + Number(militaryScore.caption) + Number(explorationScore.caption); |
| 279 | economyScore.caption = playerScoreValueEconomy[i]; |
| 280 | militaryScore.caption = playerScoreValueMilitary[i]; |
| 281 | explorationScore.caption = playerScoreValueExploration[i]; |
| 282 | totalScore.caption = playerScoreValueTotal[i]; |
| 283 | if (playerState.team == -1) { |
| 284 | team.caption = 'None' |
| 285 | teamScore.caption = totalScore.caption; |
| 286 | } else { |
| 287 | team.caption = playerState.team + 1; |
| 288 | teamScore.caption = teamScoreValue[playerState.team]; |
| 289 | } |
250 | 290 | |
251 | 291 | unitsTrained.caption = playerState.statistics.unitsTrained; |
252 | 292 | unitsLost.caption = playerState.statistics.unitsLost; |
diff --git a/binaries/data/mods/public/gui/summary/summary.xml b/binaries/data/mods/public/gui/summary/summary.xml
index 718d1ff..0cbc70d 100644
a
|
b
|
|
100 | 100 | <object name="totalScoreHeading" type="text" style="CenteredTabLabelText"> |
101 | 101 | Total score |
102 | 102 | </object> |
| 103 | <object name="teamHeading" type="text" style="CenteredTabLabelText"> |
| 104 | Team |
| 105 | </object> |
| 106 | <object name="teamScoreHeading" type="text" style="CenteredTabLabelText"> |
| 107 | Team score |
| 108 | </object> |
103 | 109 | </object> |
104 | 110 | |
105 | 111 | <object size="0 65 100% 100%-50"> |
… |
… |
|
112 | 118 | <object name="militaryScore[n]" type="text" style="CenteredLabelText"/> |
113 | 119 | <object name="explorationScore[n]" type="text" style="CenteredLabelText"/> |
114 | 120 | <object name="totalScore[n]" type="text" style="CenteredLabelText"/> |
| 121 | <object name="team[n]" type="text" style="CenteredLabelText"/> |
| 122 | <object name="teamScore[n]" type="text" style="CenteredLabelText"/> |
115 | 123 | </object> |
116 | 124 | </repeat> |
117 | 125 | </object> |