Don't show optional goals if playing level as type 'course' ()

This commit is contained in:
Catsync 2016-06-24 11:32:50 -04:00 committed by Nick Winter
parent c6fcf588f7
commit f1d17ebcba
3 changed files with 7 additions and 1 deletions

View file

@ -30,6 +30,10 @@ module.exports = class LevelGoalsView extends CocoView
@mouseEntered = false
@updatePlacement()
constructor: (options) ->
super options
@level = options.level
onNewGoalStates: (e) ->
firstRun = not @previousGoalStatus?
@previousGoalStatus ?= {}
@ -45,6 +49,7 @@ module.exports = class LevelGoalsView extends CocoView
goals = []
for goal in e.goals
state = e.goalStates[goal.id]
continue if goal.optional and @level.get('type', true) is 'course'
if goal.hiddenGoal
continue if goal.optional and state.status isnt 'success'
continue if not goal.optional and state.status isnt 'failure'

View file

@ -59,6 +59,7 @@ module.exports = class LevelLoadingView extends CocoView
goalList = goalContainer.find('ul')
goalCount = 0
for goalID, goal of @level.get('goals') when (not goal.team or goal.team is (e.team or 'humans')) and not goal.hiddenGoal
continue if goal.optional and @level.get('type', true) is 'course'
name = utils.i18n goal, 'name'
goalList.append $('<li>' + name + '</li>')
++goalCount

View file

@ -264,7 +264,7 @@ module.exports = class PlayLevelView extends RootView
@hintsState = new HintsState({ hidden: true }, { @session, @level })
@insertSubView @tome = new TomeView { @levelID, @session, @otherSession, thangs: @world.thangs, @supermodel, @level, @observing, @courseID, @courseInstanceID, @god, @hintsState }
@insertSubView new LevelPlaybackView session: @session, level: @level
@insertSubView new GoalsView {}
@insertSubView new GoalsView {level: @level}
@insertSubView new LevelFlagsView levelID: @levelID, world: @world if @$el.hasClass 'flags'
@insertSubView new GoldView {} unless @level.get('slug') in ['wakka-maul']
@insertSubView new HUDView {level: @level}