From 5e857d502ab70ecf2611e742f3f4cb04249a48ff Mon Sep 17 00:00:00 2001 From: Christian 'ketura' McCarty Date: Thu, 15 Aug 2024 19:11:03 -0500 Subject: [PATCH] *More* stats fixes. --- .../src/main/web/js/gemp-022/statsUi.js | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/statsUi.js b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/statsUi.js index d5e666b15..b84c7e516 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/statsUi.js +++ b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/statsUi.js @@ -63,36 +63,36 @@ var StatsUI = Class.extend({ var comps = 0; var total = 0; - json.Stats.sort((a,b) => { return b.count - a.count; }) + json.Stats.sort((a,b) => { return b.Count - a.Count; }) json["Stats"].forEach(item => { - if(item.casual) { - casuals += item.count; + if(item.Casual) { + casuals += item.Count; } else { - comps += item.count; + comps += item.Count; } - total += item.count; + total += item.Count; }); json["Stats"].forEach(item => { - var test = getPercentage(item.count, total); + var test = getPercentage(item.Count, total); - if(item.casual) { + if(item.Casual) { casualStats.append("" - + "" + item.format + "" - + "" + item.count + "" - + "" + getPercentage(item.count, casuals) + "" - + "" + getPercentage(item.count, total) + "" + + "" + item.Format + "" + + "" + item.Count + "" + + "" + getPercentage(item.Count, casuals) + "" + + "" + getPercentage(item.Count, total) + "" + ""); } else { compStats.append("" - + "" + item.format + "" - + "" + item.count + "" - + "" + getPercentage(item.count, comps) + "" - + "" + getPercentage(item.count, total) + "" + + "" + item.Format + "" + + "" + item.Count + "" + + "" + getPercentage(item.Count, comps) + "" + + "" + getPercentage(item.Count, total) + "" + ""); } });