mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-05-01 16:33:38 -04:00
Added a thing which highlights the guide every 5 minutes until clicked. Fixed #11.
This commit is contained in:
parent
d8e6c7f550
commit
c4a56dc9a5
1 changed files with 15 additions and 1 deletions
|
@ -24,7 +24,7 @@ module.exports = class ControlBarView extends View
|
||||||
'click #restart-button': ->
|
'click #restart-button': ->
|
||||||
window.tracker?.trackEvent 'Clicked Restart', level: @worldName, label: @worldName
|
window.tracker?.trackEvent 'Clicked Restart', level: @worldName, label: @worldName
|
||||||
@showRestartModal()
|
@showRestartModal()
|
||||||
|
|
||||||
'click #next-game-button': ->
|
'click #next-game-button': ->
|
||||||
Backbone.Mediator.publish 'next-game-pressed'
|
Backbone.Mediator.publish 'next-game-pressed'
|
||||||
|
|
||||||
|
@ -64,9 +64,23 @@ module.exports = class ControlBarView extends View
|
||||||
c.homeLink = "/play/ladder/" + levelID
|
c.homeLink = "/play/ladder/" + levelID
|
||||||
c
|
c
|
||||||
|
|
||||||
|
afterRender: ->
|
||||||
|
super()
|
||||||
|
@guideHighlightInterval ?= setInterval @onGuideHighlight, 5 * 60 * 1000
|
||||||
|
|
||||||
|
destroy: ->
|
||||||
|
clearInterval @guideHighlightInterval if @guideHighlightInterval
|
||||||
|
super()
|
||||||
|
|
||||||
|
onGuideHighlight: =>
|
||||||
|
return if @destroyed or @guideShownOnce
|
||||||
|
@$el.find('#docs-button').hide().show('highlight', 4000)
|
||||||
|
|
||||||
showGuideModal: ->
|
showGuideModal: ->
|
||||||
options = {docs: @level.get('documentation'), supermodel: @supermodel}
|
options = {docs: @level.get('documentation'), supermodel: @supermodel}
|
||||||
@openModalView(new DocsModal(options))
|
@openModalView(new DocsModal(options))
|
||||||
|
clearInterval @guideHighlightInterval
|
||||||
|
@guideHighlightInterval = null
|
||||||
|
|
||||||
showMultiplayerModal: ->
|
showMultiplayerModal: ->
|
||||||
@openModalView(new MultiplayerModal(session: @session, playableTeams: @playableTeams, level: @level, ladderGame: @ladderGame))
|
@openModalView(new MultiplayerModal(session: @session, playableTeams: @playableTeams, level: @level, ladderGame: @ladderGame))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue