Add help button to problem alert
This commit is contained in:
parent
eadde0590e
commit
f1d7fb5fbd
6 changed files with 17 additions and 1 deletions
app
locale
styles/play/level/tome
templates/play/level/tome
views/play
|
@ -270,6 +270,7 @@
|
||||||
loading_ready: "Ready!"
|
loading_ready: "Ready!"
|
||||||
loading_start: "Start Level"
|
loading_start: "Start Level"
|
||||||
problem_alert_title: "Fix Your Code"
|
problem_alert_title: "Fix Your Code"
|
||||||
|
problem_alert_help: "Help"
|
||||||
time_current: "Now:"
|
time_current: "Now:"
|
||||||
time_total: "Max:"
|
time_total: "Max:"
|
||||||
time_goto: "Go to:"
|
time_goto: "Go to:"
|
||||||
|
|
|
@ -63,6 +63,9 @@
|
||||||
|
|
||||||
&.alert-info
|
&.alert-info
|
||||||
border-image-source: url(/images/level/code_editor_info_background.png)
|
border-image-source: url(/images/level/code_editor_info_background.png)
|
||||||
|
|
||||||
|
#problem-alert-help-button
|
||||||
|
float: right
|
||||||
|
|
||||||
html.no-borderimage
|
html.no-borderimage
|
||||||
.problem-alert
|
.problem-alert
|
||||||
|
|
|
@ -6,3 +6,4 @@ if hint
|
||||||
span.problem-subtitle!= message
|
span.problem-subtitle!= message
|
||||||
else
|
else
|
||||||
span.problem-title!= message
|
span.problem-title!= message
|
||||||
|
button.btn.btn-lg.btn-info.banner#problem-alert-help-button(data-i18n="play_level.problem_alert_help")
|
||||||
|
|
|
@ -240,7 +240,7 @@ module.exports = class PlayLevelView extends RootView
|
||||||
@insertSubView new HUDView {level: @level}
|
@insertSubView new HUDView {level: @level}
|
||||||
@insertSubView new LevelDialogueView {level: @level}
|
@insertSubView new LevelDialogueView {level: @level}
|
||||||
@insertSubView new ChatView levelID: @levelID, sessionID: @session.id, session: @session
|
@insertSubView new ChatView levelID: @levelID, sessionID: @session.id, session: @session
|
||||||
@insertSubView new ProblemAlertView {}
|
@insertSubView new ProblemAlertView session: @session, level: @level, supermodel: @supermodel
|
||||||
worldName = utils.i18n @level.attributes, 'name'
|
worldName = utils.i18n @level.attributes, 'name'
|
||||||
@controlBar = @insertSubView new ControlBarView {worldName: worldName, session: @session, level: @level, supermodel: @supermodel}
|
@controlBar = @insertSubView new ControlBarView {worldName: worldName, session: @session, level: @level, supermodel: @supermodel}
|
||||||
#_.delay (=> Backbone.Mediator.publish('level:set-debug', debug: true)), 5000 if @isIPadApp() # if me.displayName() is 'Nick'
|
#_.delay (=> Backbone.Mediator.publish('level:set-debug', debug: true)), 5000 if @isIPadApp() # if me.displayName() is 'Nick'
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
CocoView = require 'views/core/CocoView'
|
CocoView = require 'views/core/CocoView'
|
||||||
|
GameMenuModal = require 'views/play/menu/GameMenuModal'
|
||||||
template = require 'templates/play/level/tome/problem_alert'
|
template = require 'templates/play/level/tome/problem_alert'
|
||||||
{me} = require 'core/auth'
|
{me} = require 'core/auth'
|
||||||
|
|
||||||
|
@ -17,9 +18,13 @@ module.exports = class ProblemAlertView extends CocoView
|
||||||
|
|
||||||
events:
|
events:
|
||||||
'click .close': 'onRemoveClicked'
|
'click .close': 'onRemoveClicked'
|
||||||
|
'click #problem-alert-help-button': 'onClickProblemAlertHelp'
|
||||||
|
|
||||||
constructor: (options) ->
|
constructor: (options) ->
|
||||||
super options
|
super options
|
||||||
|
@level = options.level
|
||||||
|
@session = options.session
|
||||||
|
@supermodel = options.supermodel
|
||||||
if options.problem?
|
if options.problem?
|
||||||
@problem = options.problem
|
@problem = options.problem
|
||||||
@onWindowResize()
|
@onWindowResize()
|
||||||
|
@ -69,6 +74,7 @@ module.exports = class ProblemAlertView extends CocoView
|
||||||
@onWindowResize()
|
@onWindowResize()
|
||||||
@render()
|
@render()
|
||||||
@onJiggleProblemAlert()
|
@onJiggleProblemAlert()
|
||||||
|
application.tracker?.trackEvent 'Show problem alert', levelID: @level.get('slug')
|
||||||
|
|
||||||
onJiggleProblemAlert: ->
|
onJiggleProblemAlert: ->
|
||||||
return unless @problem?
|
return unless @problem?
|
||||||
|
@ -83,6 +89,10 @@ module.exports = class ProblemAlertView extends CocoView
|
||||||
return unless @$el.is(':visible')
|
return unless @$el.is(':visible')
|
||||||
@onRemoveClicked()
|
@onRemoveClicked()
|
||||||
|
|
||||||
|
onClickProblemAlertHelp: ->
|
||||||
|
application.tracker?.trackEvent 'Problem alert help clicked', levelID: @level.get('slug')
|
||||||
|
@openModalView new GameMenuModal showTab: 'guide', level: @level, session: @session, supermodel: @supermodel
|
||||||
|
|
||||||
onRemoveClicked: ->
|
onRemoveClicked: ->
|
||||||
@playSound 'menu-button-click'
|
@playSound 'menu-button-click'
|
||||||
@$el.hide()
|
@$el.hide()
|
||||||
|
|
|
@ -50,6 +50,7 @@ module.exports = class GameMenuModal extends ModalView
|
||||||
if @options.showTab
|
if @options.showTab
|
||||||
firstView = switch @options.showTab
|
firstView = switch @options.showTab
|
||||||
when 'multiplayer' then @subviews.multiplayer_view
|
when 'multiplayer' then @subviews.multiplayer_view
|
||||||
|
when 'guide' then @subviews.guide_view
|
||||||
unless firstView?
|
unless firstView?
|
||||||
firstView = (@subviews.options_view)
|
firstView = (@subviews.options_view)
|
||||||
firstView.$el.addClass 'active'
|
firstView.$el.addClass 'active'
|
||||||
|
|
Reference in a new issue