X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=xonstat%2Ftemplates%2Faccuracy.mako;h=3c1e007c33dbf41f0301ca9b62f7d26ef92d651f;hb=ae2353788574f4d3858d631a932e83b2e1638401;hp=a540023e05cd3177d890b42f41725d5297034eac;hpb=b9d4f27df1c593ac374a6482d1d6893b9bd91217;p=xonotic%2Fxonstat.git
diff --git a/xonstat/templates/accuracy.mako b/xonstat/templates/accuracy.mako
old mode 100755
new mode 100644
index a540023..3c1e007
--- a/xonstat/templates/accuracy.mako
+++ b/xonstat/templates/accuracy.mako
@@ -10,41 +10,46 @@
## [3] = Max damage
## [4] = Hit
## [5] = Fired
+## [6] = Frags
-
-
-% for weapon_stat in weapon_stats:
-<%
-if weapon_stat[3] > 0:
- damage_pct = round(float(weapon_stat[2])/weapon_stat[3]*100, 2)
-else:
- damage_pct = 0
-if weapon_stat[5] > 0:
- hit_pct = round(float(weapon_stat[4])/weapon_stat[5]*100, 2)
-else:
- hit_pct = 0
-%>
-
- ## Note: the name of the image must match up with the weapon_cd
- ## entry of that weapon, else this won't work
- ![](${request.static_url() |
- ${weapon_stat[0]} |
- ${weapon_stat[4]} |
- ${weapon_stat[5]} |
- ${hit_pct}% |
- ${weapon_stat[2]} |
- ${weapon_stat[3]} |
- ${damage_pct}% |
-
-% endfor
+
+
+ |
+ Weapon |
+ Frags |
+ Accuracy |
+ Damage |
+
+
+ <%
+ total_damage = 0
+ for weapon_stat in weapon_stats:
+ total_damage += weapon_stat[2]
+ if total_damage == 0:
+ total_damage = 1
+ %>
+
+ % for weapon_stat in weapon_stats:
+ <%
+ if weapon_stat[3] > 0:
+ damage_pct = round(float(weapon_stat[2])/weapon_stat[3]*100, 2)
+ else:
+ damage_pct = 0
+
+ if weapon_stat[5] > 0:
+ hit_pct = round(float(weapon_stat[4])/weapon_stat[5]*100, 2)
+ else:
+ hit_pct = 0
+ %>
+
+ ## Note: the name of the image must match up with the weapon_cd
+ ## entry of that weapon, else this won't work
+ |
+ ${weapon_stat[0]} |
+ ${weapon_stat[6]} |
+ ${weapon_stat[4]}/${weapon_stat[5]} (${hit_pct}%) |
+ ${weapon_stat[2]} (${round(float(weapon_stat[2])/total_damage*100, 2)}%) |
+
+ % endfor
%def>