From 39c465720433f3c6f991c2ec362e69c8f60c7cae Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Sat, 8 Mar 2014 15:43:56 -0800 Subject: [PATCH] Fixed HUD showing actions backwardly. Added rank numbering to leaderboard. --- app/templates/play/ladder/ladder_tab.jade | 6 ++++-- app/views/play/level/hud_view.coffee | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/templates/play/ladder/ladder_tab.jade b/app/templates/play/ladder/ladder_tab.jade index c3090caa3..9fc48c340 100644 --- a/app/templates/play/ladder/ladder_tab.jade +++ b/app/templates/play/ladder/ladder_tab.jade @@ -3,17 +3,19 @@ div#columns.row div.column.col-md-6 table.table.table-bordered.table-condensed.table-hover tr - th(colspan=3, style="color: #{team.primaryColor}") + th(colspan=4, style="color: #{team.primaryColor}") span= team.name span Leaderboard tr + th Rank th Score th.name-col-cell Name th - for session in team.leaderboard.topPlayers.models + for session, rank in team.leaderboard.topPlayers.models - var myRow = session.get('creator') == me.id tr(class=myRow ? "success" : "") + td.rank-cell= rank + 1 td.score-cell= Math.round(session.get('totalScore') * 100) td.name-col-cell= session.get('creatorName') || "Anonymous" td diff --git a/app/views/play/level/hud_view.coffee b/app/views/play/level/hud_view.coffee index 1951e3539..662c9fc8f 100644 --- a/app/views/play/level/hud_view.coffee +++ b/app/views/play/level/hud_view.coffee @@ -151,7 +151,7 @@ module.exports = class HUDView extends View createActions: -> actions = @$el.find('.thang-actions tbody').empty() showActions = @thang.world and not _.isEmpty(@thang.actions) and 'action' in @thang.hudProperties ? [] - @$el.find('.thang-actions').toggleClass 'secret', showActions + @$el.find('.thang-actions').toggleClass 'secret', not showActions return unless showActions @buildActionTimespans() for actionName, action of @thang.actions