Simulator now pleads for you to help simulate when your match is being ranked.
This commit is contained in:
parent
b8dc4ed939
commit
8a5a45950f
7 changed files with 31 additions and 23 deletions
app
locale
styles/play/common
templates/play/common
views/play
server/queues
|
@ -656,6 +656,7 @@
|
|||
rank_submitted: "Submitted for Ranking"
|
||||
rank_failed: "Failed to Rank"
|
||||
rank_being_ranked: "Game Being Ranked"
|
||||
help_simulate: "Help simulate games?"
|
||||
code_being_simulated: "Your new code is being simulated by other players for ranking. This will refresh as new matches come in."
|
||||
no_ranked_matches_pre: "No ranked matches for the "
|
||||
no_ranked_matches_post: " team! Play against some competitors and then come back here to get your game ranked."
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
.ladder-submission-view
|
||||
h3
|
||||
text-decoration: underline
|
||||
.help-simulate
|
||||
font-weight: normal
|
||||
float: right
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
button.btn.btn-success.rank-button
|
||||
span(data-i18n="ladder.rank_no_code").unavailable.hidden No New Code to Rank
|
||||
span(data-i18n="ladder.rank_my_game").rank.hidden Rank My Game!
|
||||
span(data-i18n="ladder.rank_submitting").submitting.hidden Submitting...
|
||||
span(data-i18n="ladder.rank_submitted").submitted.hidden Submitted for Ranking
|
||||
span(data-i18n="ladder.rank_failed").failed.hidden Failed to Rank
|
||||
span(data-i18n="ladder.rank_being_ranked").ranking.hidden Game Being Ranked
|
||||
span(data-i18n="ladder.rank_no_code").unavailable.secret No New Code to Rank
|
||||
span(data-i18n="ladder.rank_my_game").rank.secret Rank My Game!
|
||||
span(data-i18n="ladder.rank_submitting").submitting.secret Submitting...
|
||||
span(data-i18n="ladder.rank_submitted").submitted.secret Submitted for Ranking
|
||||
span(data-i18n="ladder.rank_failed").failed.secret Failed to Rank
|
||||
span(data-i18n="ladder.rank_being_ranked").ranking.secret Game Being Ranked
|
||||
|
||||
a(href=simulateURL, data-i18n="ladder.help_simulate").help-simulate.secret Help simulate games?
|
|
@ -2,11 +2,12 @@ CocoView = require 'views/kinds/CocoView'
|
|||
template = require 'templates/play/common/ladder_submission'
|
||||
|
||||
module.exports = class LadderSubmissionView extends CocoView
|
||||
class: "ladder-submission-view"
|
||||
className: "ladder-submission-view"
|
||||
template: template
|
||||
|
||||
events:
|
||||
'click .rank-button': 'rankSession'
|
||||
'click .help-simulate': 'onHelpSimulate'
|
||||
|
||||
constructor: (options) ->
|
||||
super options
|
||||
|
@ -16,7 +17,8 @@ module.exports = class LadderSubmissionView extends CocoView
|
|||
getRenderData: ->
|
||||
ctx = super()
|
||||
ctx.readyToRank = @session?.readyToRank()
|
||||
ctx.isRanking = @ession?.get('isRanking')
|
||||
ctx.isRanking = @session?.get('isRanking')
|
||||
ctx.simulateURL = "/play/ladder/#{@level.get('slug')}#simulate"
|
||||
ctx
|
||||
|
||||
afterRender: ->
|
||||
|
@ -34,9 +36,11 @@ module.exports = class LadderSubmissionView extends CocoView
|
|||
@setRankingButtonText rankingState
|
||||
|
||||
setRankingButtonText: (spanClass) ->
|
||||
@rankButton.find('span').addClass('hidden')
|
||||
@rankButton.find(".#{spanClass}").removeClass('hidden')
|
||||
@rankButton.find('span').hide()
|
||||
@rankButton.find(".#{spanClass}").show()
|
||||
@rankButton.toggleClass 'disabled', spanClass isnt 'rank'
|
||||
helpSimulate = spanClass in ['submitted', 'ranking']
|
||||
@$el.find('.help-simulate').toggle(helpSimulate, 'slow')
|
||||
|
||||
rankSession: (e) ->
|
||||
return unless @session.readyToRank()
|
||||
|
@ -86,3 +90,5 @@ module.exports = class LadderSubmissionView extends CocoView
|
|||
transpiledCode[thang][spellID] = aether.transpile spell
|
||||
transpiledCode
|
||||
|
||||
onHelpSimulate: ->
|
||||
$('a[href="#simulate"]').tab('show')
|
||||
|
|
|
@ -91,7 +91,7 @@ module.exports = class MyMatchesTabView extends CocoView
|
|||
session = _.find @sessions.models, {id: sessionID}
|
||||
ladderSubmissionView = new LadderSubmissionView session: session, level: @level
|
||||
@insertSubView ladderSubmissionView, placeholder
|
||||
ladderSubmissionView.$el.find('.rank-button').addClass 'btn-block'
|
||||
ladderSubmissionView.$el.find('.rank-button').addClass 'btn-block btn-lg'
|
||||
|
||||
@$el.find('.score-chart-wrapper').each (i, el) =>
|
||||
scoreWrapper = $(el)
|
||||
|
|
|
@ -667,5 +667,3 @@ retrieveOldSessionData = (sessionID, callback) ->
|
|||
markSessionAsDoneRanking = (sessionID, cb) ->
|
||||
#console.log "Marking session as done ranking..."
|
||||
LevelSession.update {"_id":sessionID}, {"isRanking":false}, cb
|
||||
|
||||
|
||||
|
|
Reference in a new issue