Ticket #3216: t3216_capture_statistics_style.patch
File t3216_capture_statistics_style.patch, 3.3 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/gui/summary/counters.js
128 128 for (let w in counters) 129 129 { 130 130 let total = { 131 "c ": 0,132 "l ": 0,133 "d ": 0131 "constructed": 0, 132 "lost": 0, 133 "destroyed": 0 134 134 }; 135 135 136 136 for (let p = 0; p < g_Teams[t]; ++p) … … 141 141 142 142 let splitCaption = caption.split("/"); 143 143 144 total.c += (+splitCaption[0]);145 total.l += (+splitCaption[1]);146 total.d += (+splitCaption[2]);144 total.constructed += (+splitCaption[0]); 145 total.lost += (+splitCaption[1]); 146 total.destroyed += (+splitCaption[2]); 147 147 } 148 148 149 let teamTotal = g_TrainedColor + total.c + '[/color] / ' +150 g_LostColor + total.l + '[/color] / ' + g_KilledColor + total.d + '[/color]';149 let teamTotal = g_TrainedColor + total.constructed + '[/color] / ' + 150 g_LostColor + total.lost + '[/color] / ' + g_KilledColor + total.destroyed + '[/color]'; 151 151 152 152 Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + w + "]").caption = teamTotal; 153 153 } … … 211 211 let teamTotal = "undefined"; 212 212 213 213 let total = { 214 i : 0,215 o : 0214 income : 0, 215 outcome : 0 216 216 }; 217 217 218 218 for (let p = 0; p < g_Teams[t]; ++p) … … 222 222 caption = caption.replace(/\[([\w\' \\\"\/\=]*)\]|\s/g, ""); 223 223 224 224 if (w >= 6) 225 total.i += (+caption);225 total.income += (+caption); 226 226 else 227 227 { 228 228 let splitCaption = caption.split("/"); 229 229 230 total.i += (+splitCaption[0]);231 total.o += (+splitCaption[1]);230 total.income += (+splitCaption[0]); 231 total.outcome += (+splitCaption[1]); 232 232 } 233 233 } 234 234 235 235 if (w >= 6) 236 teamTotal = total.i ;236 teamTotal = total.income; 237 237 else 238 teamTotal = g_IncomeColor + total.i + "[/color] / " + g_OutcomeColor + total.o+ "[/color]";238 teamTotal = g_IncomeColor + total.income + "[/color] / " + g_OutcomeColor + total.outcome + "[/color]"; 239 239 240 240 Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + w + "]").caption = teamTotal; 241 241 } … … 280 280 let teamTotal = "undefined"; 281 281 282 282 let total = { 283 "i ": 0,284 "o ": 0283 "income": 0, 284 "outcome": 0 285 285 }; 286 286 287 287 for (let p = 0; p < g_Teams[t]; ++p) … … 291 291 caption = caption.replace(/\[([\w\' \\\"\/\=]*)\]|\s|\+|\%/g, ""); 292 292 293 293 if (w >= 4) 294 total.i += (+caption);294 total.income += (+caption); 295 295 else 296 296 { 297 297 let splitCaption = caption.split("-"); 298 total.i += (+splitCaption[0]);299 total.o += (+splitCaption[1]);298 total.income += (+splitCaption[0]); 299 total.outcome += (+splitCaption[1]); 300 300 } 301 301 } 302 302 … … 303 303 if (w == 4) 304 304 teamTotal = Math.floor(g_TeamHelperData[t].totalSold > 0 ? (g_TeamHelperData[t].totalBought / g_TeamHelperData[t].totalSold) * 100 : 0) + "%" 305 305 else if (w > 4) 306 teamTotal = total.i ;306 teamTotal = total.income; 307 307 else 308 teamTotal = g_IncomeColor + '+' + total.i + '[/color] ' + g_OutcomeColor + '-' + total.o+ '[/color]';308 teamTotal = g_IncomeColor + '+' + total.income + '[/color] ' + g_OutcomeColor + '-' + total.outcome + '[/color]'; 309 309 310 310 Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + w + "]").caption = teamTotal; 311 311 }