Hid play/pause button for first few levels. Hid submit button until run once or won for a few more levels.

This commit is contained in:
Nick Winter 2014-10-14 11:11:56 -07:00
parent b7fe9398d5
commit ee9e32af51
5 changed files with 16 additions and 14 deletions

View file

@ -74,7 +74,7 @@ PointSchema = c.object {title: 'Point', description: 'An {x, y} coordinate point
x: {title: 'x', description: 'The x coordinate.', type: 'number'} x: {title: 'x', description: 'The x coordinate.', type: 'number'}
y: {title: 'y', description: 'The y coordinate.', type: 'number'} y: {title: 'y', description: 'The y coordinate.', type: 'number'}
SpriteCommandSchema = c.object {title: 'Thang Command', description: 'Make a target Thang move or say something, or select/deselect it.', required: ['id'], default: {id: 'Captain Anya'}}, SpriteCommandSchema = c.object {title: 'Thang Command', description: 'Make a target Thang move or say something, or select/deselect it.', required: ['id'], default: {id: 'Hero Placeholder'}},
id: thang id: thang
select: {title: 'Select', description: 'Select or deselect this Thang.', type: 'boolean'} select: {title: 'Select', description: 'Select or deselect this Thang.', type: 'boolean'}
say: c.object {title: 'Say', description: 'Make this Thang say a message.', required: ['text'], default: { mood: 'explain' }}, say: c.object {title: 'Say', description: 'Make this Thang say a message.', required: ['text'], default: { mood: 'explain' }},

View file

@ -124,6 +124,7 @@ module.exports = class LevelPlaybackView extends CocoView
@goto = t 'play_level.time_goto' @goto = t 'play_level.time_goto'
@current = t 'play_level.time_current' @current = t 'play_level.time_current'
@total = t 'play_level.time_total' @total = t 'play_level.time_total'
@$el.find('#play-button').css('visibility', 'hidden') if @options.levelID in ['dungeons-of-kithgard', 'gems-in-the-deep', 'shadow-guard', 'true-names'] # Don't show for first few levels, confuses new players.
updatePopupContent: -> updatePopupContent: ->
@timePopup?.updateContent "<h2>#{@timeToString @newTime}</h2>#{@formatTime(@current, @currentTime)}<br/>#{@formatTime(@total, @totalTime)}" @timePopup?.updateContent "<h2>#{@timeToString @newTime}</h2>#{@formatTime(@current, @currentTime)}<br/>#{@formatTime(@total, @totalTime)}"

View file

@ -268,7 +268,7 @@ module.exports = class PlayLevelView extends RootView
insertSubviews: -> insertSubviews: ->
@insertSubView @tome = new TomeView levelID: @levelID, session: @session, otherSession: @otherSession, thangs: @world.thangs, supermodel: @supermodel, level: @level @insertSubView @tome = new TomeView levelID: @levelID, session: @session, otherSession: @otherSession, thangs: @world.thangs, supermodel: @supermodel, level: @level
@insertSubView new LevelPlaybackView session: @session @insertSubView new LevelPlaybackView session: @session, levelID: @levelID
@insertSubView new GoalsView {} @insertSubView new GoalsView {}
@insertSubView new LevelFlagsView world: @world if @levelID is 'sky-span' # TODO: figure out when flags are available @insertSubView new LevelFlagsView world: @world if @levelID is 'sky-span' # TODO: figure out when flags are available
@insertSubView new GoldView {} @insertSubView new GoldView {}

View file

@ -11,6 +11,7 @@ module.exports = class HeroVictoryModal extends ModalView
id: 'hero-victory-modal' id: 'hero-victory-modal'
template: template template: template
closeButton: false closeButton: false
closesOnClickOutside: false
constructor: (options) -> constructor: (options) ->
super(options) super(options)
@ -105,7 +106,7 @@ module.exports = class HeroVictoryModal extends ModalView
) )
panel.delay(500) panel.delay(500)
panel.queue(-> complete()) panel.queue(-> complete())
@animationComplete = !@animatedPanels.length @animationComplete = not @animatedPanels.length
beginAnimateNumbers: -> beginAnimateNumbers: ->
@numericalItemPanels = _.map(@animatedPanels.find('.numerical'), (panel) -> { @numericalItemPanels = _.map(@animatedPanels.find('.numerical'), (panel) -> {
@ -142,4 +143,4 @@ module.exports = class HeroVictoryModal extends ModalView
updateSavingProgressStatus: -> updateSavingProgressStatus: ->
return unless @animationComplete return unless @animationComplete
@$el.find('#saving-progress-label').toggleClass('hide', @readyToContinue) @$el.find('#saving-progress-label').toggleClass('hide', @readyToContinue)
@$el.find('#continue-button').toggleClass('hide', !@readyToContinue) @$el.find('#continue-button').toggleClass('hide', not @readyToContinue)

View file

@ -42,7 +42,7 @@ module.exports = class CastButtonView extends CocoView
#delay = me.get('autocastDelay') # No more autocast #delay = me.get('autocastDelay') # No more autocast
delay = 90019001 delay = 90019001
@setAutocastDelay delay @setAutocastDelay delay
@$el.find('.submit-button').hide() if @options.levelID is 'dungeons-of-kithgard' @$el.find('.submit-button').hide() if @options.levelID in ['dungeons-of-kithgard', 'gems-in-the-deep', 'shadow-guard', 'true-names']
attachTo: (spellView) -> attachTo: (spellView) ->
@$el.detach().prependTo(spellView.toolbarView.$el).show() @$el.detach().prependTo(spellView.toolbarView.$el).show()
@ -83,7 +83,7 @@ module.exports = class CastButtonView extends CocoView
onNewGoalStates: (e) -> onNewGoalStates: (e) ->
@winnable = e.overallStatus is 'success' @winnable = e.overallStatus is 'success'
@$el.toggleClass 'winnable', @winnable @$el.toggleClass 'winnable', @winnable
if @winnable if @winnable or (@hasCastOnce and @options.levelID isnt 'dungeons-of-kithgard') # Show once 1) we think they will win or 2) they have hit run once. (Only #1 on the fist level.)
@$el.find('.submit-button').show() # In case we hid it, like on the first level. @$el.find('.submit-button').show() # In case we hid it, like on the first level.
onGoalsCalculated: (e) -> onGoalsCalculated: (e) ->
@ -104,7 +104,7 @@ module.exports = class CastButtonView extends CocoView
else if castable else if castable
s = $.i18n.t('play_level.tome_cast_button_run') s = $.i18n.t('play_level.tome_cast_button_run')
s = $.i18n.t('play_level.tome_cast_button_casting') if s is 'Run' and me.get('preferredLanguage').split('-')[0] isnt 'en' # Temporary, if tome_cast_button_running isn't translated. s = $.i18n.t('play_level.tome_cast_button_casting') if s is 'Run' and me.get('preferredLanguage').split('-')[0] isnt 'en' # Temporary, if tome_cast_button_running isn't translated.
unless @options.levelID in ['dungeons-of-kithgard', 'gems-in-the-deep', 'shadow-guard', 'true-names'] # Hide for first few. unless @options.levelID in ['dungeons-of-kithgard', 'gems-in-the-deep', 'shadow-guard', 'true-names', 'the-raised-sword', 'the-first-kithmaze'] # Hide for first few.
s += ' ' + @castShortcut s += ' ' + @castShortcut
else else
s = $.i18n.t('play_level.tome_cast_button_ran') s = $.i18n.t('play_level.tome_cast_button_ran')