mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-30 19:06:59 -05:00
Fixed HUD showing actions backwardly. Added rank numbering to leaderboard.
This commit is contained in:
parent
b3964571e1
commit
39c4657204
2 changed files with 5 additions and 3 deletions
|
@ -3,17 +3,19 @@ div#columns.row
|
||||||
div.column.col-md-6
|
div.column.col-md-6
|
||||||
table.table.table-bordered.table-condensed.table-hover
|
table.table.table-bordered.table-condensed.table-hover
|
||||||
tr
|
tr
|
||||||
th(colspan=3, style="color: #{team.primaryColor}")
|
th(colspan=4, style="color: #{team.primaryColor}")
|
||||||
span= team.name
|
span= team.name
|
||||||
span Leaderboard
|
span Leaderboard
|
||||||
tr
|
tr
|
||||||
|
th Rank
|
||||||
th Score
|
th Score
|
||||||
th.name-col-cell Name
|
th.name-col-cell Name
|
||||||
th
|
th
|
||||||
|
|
||||||
for session in team.leaderboard.topPlayers.models
|
for session, rank in team.leaderboard.topPlayers.models
|
||||||
- var myRow = session.get('creator') == me.id
|
- var myRow = session.get('creator') == me.id
|
||||||
tr(class=myRow ? "success" : "")
|
tr(class=myRow ? "success" : "")
|
||||||
|
td.rank-cell= rank + 1
|
||||||
td.score-cell= Math.round(session.get('totalScore') * 100)
|
td.score-cell= Math.round(session.get('totalScore') * 100)
|
||||||
td.name-col-cell= session.get('creatorName') || "Anonymous"
|
td.name-col-cell= session.get('creatorName') || "Anonymous"
|
||||||
td
|
td
|
||||||
|
|
|
@ -151,7 +151,7 @@ module.exports = class HUDView extends View
|
||||||
createActions: ->
|
createActions: ->
|
||||||
actions = @$el.find('.thang-actions tbody').empty()
|
actions = @$el.find('.thang-actions tbody').empty()
|
||||||
showActions = @thang.world and not _.isEmpty(@thang.actions) and 'action' in @thang.hudProperties ? []
|
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
|
return unless showActions
|
||||||
@buildActionTimespans()
|
@buildActionTimespans()
|
||||||
for actionName, action of @thang.actions
|
for actionName, action of @thang.actions
|
||||||
|
|
Loading…
Reference in a new issue