X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=xonstat%2Ftemplates%2Fscoreboard.mako;h=7bdf54142a1335634608dfb3e6651653e8873b88;hb=a76d85fe97bcbf2428cd7b15f13a3f75d7adb350;hp=1f9098a29416ddada9ed94cde6261198a3e95e62;hpb=2cd8fdca0ac34a55306faf7da630942888214740;p=xonotic%2Fxonstat.git
diff --git a/xonstat/templates/scoreboard.mako b/xonstat/templates/scoreboard.mako
old mode 100755
new mode 100644
index 1f9098a..7bdf541
--- a/xonstat/templates/scoreboard.mako
+++ b/xonstat/templates/scoreboard.mako
@@ -1,87 +1,343 @@
-<%def name="scoreboard(game_type_cd, pgstats)">
-
-
-##### CTF #####
-% if game_type_cd == 'ctf':
-
+<%def name="scoreboard(game_type_cd, pgstats, show_elo=False, show_latency=False)">
+
+ ${scoreboard_header(game_type_cd, pgstats[0])}
+
+ % for pgstat in pgstats:
+
+ % if show_latency and pgstat.avg_latency is not None:
+
+ ${int(round(pgstat.avg_latency))}
+ |
+ % elif show_latency:
+ - |
+ % endif
-% for pgstat in pgstats:
-
-
+ |
% if pgstat.player_id > 2:
-
- ${pgstat.nick_html_colors()}
+
+ ${pgstat.nick_html_colors()|n}
% else:
- ${pgstat.nick_html_colors()}
- % endif
- |
- ${pgstat.kills} |
- ${pgstat.captures} |
- ${pgstat.pickups} |
- ${pgstat.carrier_frags} |
- ${pgstat.returns} |
- ${pgstat.score} |
-
- % if pgstat.player_id > 1:
-
- View
-
+ ${pgstat.nick_html_colors()|n}
% endif
- |
-
-% endfor
-% endif
-
-##### DM #####
-% if game_type_cd == 'dm':
-
+
-% for pgstat in pgstats:
-
-
- % if pgstat.player_id > 2:
-
- ${pgstat.nick_html_colors()}
-
+ ${scoreboard_row(game_type_cd, pgstat)}
+
+ % if game_type_cd != 'cts':
+ | ${pgstat.score} |
+ % endif
+
+ % if show_elo:
+ % if pgstat.elo_delta is not None:
+ ${round(pgstat.elo_delta,2)} |
% else:
- ${pgstat.nick_html_colors()}
+ - |
% endif
-
- ${pgstat.kills} |
- ${pgstat.deaths} |
- ${pgstat.suicides} |
- ${pgstat.score} |
-
- % if pgstat.player_id > 1:
-
- View
-
- % endif
- |
+ % endif
-% endfor
+ % endfor
+
+
+%def>
+
+##### SCOREBOARD HEADER #####
+<%def name="scoreboard_header(game_type_cd, pgstat)">
+% if game_type_cd == 'as':
+
+
+ % if show_latency:
+ Ping |
+ % endif
+ Nick |
+ Kills |
+ Deaths |
+ Suicides |
+ Objectives |
+ Score |
+ % if show_elo:
+ Elo Change |
+ % endif
+
+
+% endif
+
+% if game_type_cd in 'ca' 'dm' 'duel' 'rune' 'tdm':
+
+
+ % if show_latency:
+ Ping |
+ % endif
+ Nick |
+ Kills |
+ Deaths |
+ Suicides |
+ Score |
+ % if show_elo:
+ Elo Change |
+ % endif
+
+
+% endif
+
+% if game_type_cd == 'cq':
+
+
+ % if show_latency:
+ Ping |
+ % endif
+ Nick |
+ Kills |
+ Deaths |
+ Captured |
+ Released |
+ Score |
+ % if show_elo:
+ Elo Change |
+ % endif
+
+
+% endif
+
+% if game_type_cd == 'cts':
+
+
+ % if show_latency:
+ Ping |
+ % endif
+ Nick |
+ Fastest Time |
+ Deaths |
+
+
+% endif
+
+% if game_type_cd == 'ctf':
+
+
+ % if show_latency:
+ Ping |
+ % endif
+ Nick |
+ Kills |
+ Caps |
+ Pickups |
+ FCK |
+ Returns |
+ Score |
+ % if show_elo:
+ Elo Change |
+ % endif
+
+
+% endif
+
+% if game_type_cd == 'dom':
+
+
+ % if show_latency:
+ Ping |
+ % endif
+ Nick |
+ Kills |
+ Deaths |
+ Takes |
+ Ticks |
+ Score |
+ % if show_elo:
+ Elo Change |
+ % endif
+
+
+% endif
+
+% if game_type_cd in 'ft' 'freezetag':
+
+
+ % if show_latency:
+ Ping |
+ % endif
+ Nick |
+ Kills |
+ Deaths |
+ Revivals |
+ Score |
+ % if show_elo:
+ Elo Change |
+ % endif
+
+
+% endif
+
+% if game_type_cd in 'ka' 'keepaway':
+
+
+ % if show_latency:
+ Ping |
+ % endif
+ Nick |
+ Kills |
+ Deaths |
+ Pickups |
+ BC Time |
+ BC Kills |
+ Score |
+ % if show_elo:
+ Elo Change |
+ % endif
+
+
+% endif
+
+% if game_type_cd == 'kh':
+
+
+ % if show_latency:
+ Ping |
+ % endif
+ Nick |
+ Kills |
+ Deaths |
+ Pickups |
+ Caps |
+ Losses |
+ KC Kills |
+ Score |
+ % if show_elo:
+ Elo Change |
+ % endif
+
+
+% endif
+
+% if game_type_cd in 'nb' 'nexball':
+
+
+ % if show_latency:
+ Ping |
+ % endif
+ Nick |
+ Goals |
+ Faults |
+ Score |
+ % if show_elo:
+ Elo Change |
+ % endif
+
+
+% endif
+
+% if game_type_cd == 'rc':
+
+
+ % if show_latency:
+ Ping |
+ % endif
+ Nick |
+ Laps |
+ Fastest Lap |
+ Time |
+
+
+% endif
+
+%def>
+
+##### SCOREBOARD ROWS #####
+<%def name="scoreboard_row(game_type_cd, pgstat)">
+% if game_type_cd == 'as':
+ ${pgstat.kills} |
+ ${pgstat.deaths} |
+ ${pgstat.suicides} |
+ ${pgstat.collects} |
+% endif
+
+% if game_type_cd in 'ca' 'dm' 'duel' 'rune' 'tdm':
+ ${pgstat.kills} |
+ ${pgstat.deaths} |
+ ${pgstat.suicides} |
+% endif
+
+% if game_type_cd == 'cq':
+ ${pgstat.kills} |
+ ${pgstat.deaths} |
+ ${pgstat.captures} |
+ ${pgstat.drops} |
+% endif
+
+% if game_type_cd == 'cts':
+ % if pgstat.fastest is not None:
+ ${round(float(pgstat.fastest.seconds) + (pgstat.fastest.microseconds/1000000.0), 2)} |
+ % else:
+ - |
+ % endif
+
+ ${pgstat.deaths} |
+% endif
+
+% if game_type_cd == 'ctf':
+ ${pgstat.kills} |
+ ${pgstat.captures} |
+ ${pgstat.pickups} |
+ ${pgstat.carrier_frags} |
+ ${pgstat.returns} |
+% endif
+
+% if game_type_cd == 'dom':
+ ${pgstat.kills} |
+ ${pgstat.deaths} |
+ ${pgstat.pickups} |
+ ${pgstat.drops} |
+% endif
+
+% if game_type_cd in 'ft' 'freezetag':
+ ${pgstat.kills} |
+ ${pgstat.deaths} |
+ ${pgstat.revivals} |
+% endif
+
+% if game_type_cd in 'ka' 'keepaway':
+ ${pgstat.kills} |
+ ${pgstat.deaths} |
+ ${pgstat.pickups} |
+
+ % if pgstat.time is not None:
+ ${round(float(pgstat.time.seconds) + (pgstat.time.microseconds/1000000.0), 2)} |
+ % else:
+ - |
+ % endif
+
+ ${pgstat.carrier_frags} |
+% endif
+
+% if game_type_cd == 'kh':
+ ${pgstat.kills} |
+ ${pgstat.deaths} |
+ ${pgstat.pickups} |
+ ${pgstat.captures} |
+ ${pgstat.drops} |
+ ${pgstat.carrier_frags} |
+% endif
+
+% if game_type_cd in 'nb' 'nexball':
+ ${pgstat.captures} |
+ ${pgstat.drops} |
+% endif
+
+% if game_type_cd == 'rc':
+ ${pgstat.laps} |
+
+ % if pgstat.fastest is not None:
+ ${round(float(pgstat.fastest.seconds) + (pgstat.fastest.microseconds/1000000.0), 2)} |
+ % else:
+ - |
+ % endif
+
+ % if pgstat.time is not None:
+ ${round(float(pgstat.time.seconds) + (pgstat.time.microseconds/1000000.0), 2)} |
+ % else:
+ - |
+ % endif
% endif
-
%def>