Merge pull request #119 from rhc2104/remove-esc-prompt

If you have pressed esc, do not get prompted about it
This commit is contained in:
Michael Schmatz 2014-01-09 06:09:21 -08:00
commit df3e80dd17

View file

@ -22,6 +22,7 @@ module.exports = class HUDView extends View
'level-disable-controls': 'onDisableControls'
'level-enable-controls': 'onEnableControls'
'level:shift-space-pressed': 'onShiftSpacePressed'
'level:escape-pressed': 'onEscapePressed'
'god:new-world-created': 'onNewWorldCreated'
'surface:ticked': 'onTick'
'dialogue-sound-completed': 'onDialogueSoundCompleted'
@ -174,7 +175,7 @@ module.exports = class HUDView extends View
response.button = $('button:last', group)
else
s = $.i18n.t('play_level.hud_continue', defaultValue: "Continue (press shift-space)")
if @shiftSpacePressed > 4
if @shiftSpacePressed > 4 && !@escapePressed
group.append('<span class="hud-hint">Press esc to skip dialog</span>')
group.append($('<button class="btn btn-small banner with-dot">' + s + ' <div class="dot"></div></button>'))
@lastResponses = null
@ -206,6 +207,9 @@ module.exports = class HUDView extends View
r = @lastResponses[@lastResponses.length - 1]
_.delay (-> Backbone.Mediator.publish(r.channel, r.event)), 10
onEscapePressed: (e) ->
@escapePressed = true
animateEnterButton: =>
return unless @bubble
button = $('.enter', @bubble)