mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 01:55:38 -05:00
Hid world map level icons for now. Hid play counts when fewer than 20 players. Disabled Zatanna for now until it can stop doing this.this.moveRight()(). Disabled hover debugger for new hero levels for now. Fixed bug with victory modal not allowing replay of completed non-hero levels.
This commit is contained in:
parent
33080e5a65
commit
e109cbbbdc
7 changed files with 27 additions and 21 deletions
|
@ -10,10 +10,10 @@
|
|||
a(href=level.type == 'hero' ? '#' : level.disabled ? "/play" : "/play/#{level.levelPath || 'level'}/#{level.id}", disabled=level.disabled, data-level-id=level.id, data-level-path=level.levelPath || 'level', data-level-name=level.name)
|
||||
div(style="left: #{level.x}%; bottom: #{level.y}%", class="level-shadow" + (next ? " next" : "") + " " + levelStatusMap[level.id] || "")
|
||||
.level-info-container(data-level-id=level.id)
|
||||
if level.image
|
||||
img.level-image(src="#{level.image}", alt="#{level.name}")
|
||||
else
|
||||
img.level-image(src="/images/generic-icon.png", alt="#{level.name}")
|
||||
//if level.image
|
||||
// img.level-image(src="#{level.image}", alt="#{level.name}")
|
||||
//else
|
||||
// img.level-image(src="/images/generic-icon.png", alt="#{level.name}")
|
||||
div(class="level-info " + (levelStatusMap[level.id] || ""))
|
||||
h3= level.name + (level.disabled ? " (Coming soon!)" : "")
|
||||
.level-description= level.description
|
||||
|
@ -21,7 +21,7 @@
|
|||
each i in Array(level.difficulty)
|
||||
i.icon-star
|
||||
- var playCount = levelPlayCountMap[level.id]
|
||||
if playCount
|
||||
if playCount && playCount > 20
|
||||
div
|
||||
span.spr #{playCount.sessions}
|
||||
span(data-i18n="play.players") players
|
||||
|
|
|
@ -574,7 +574,7 @@ hero = [
|
|||
{
|
||||
name: 'The Final Kithmaze'
|
||||
type: 'hero'
|
||||
difficulty: 2
|
||||
difficulty: 1
|
||||
id: 'the-final-kithmaze'
|
||||
image: '/file/db/level/526bda3fe79aefde2a003e36/mobile_artillery_icon.png'
|
||||
description: 'To escape you must find your way through an Elder Kithman\'s maze.'
|
||||
|
|
|
@ -49,11 +49,14 @@ module.exports = class LevelLoadingView extends CocoView
|
|||
|
||||
startUnveiling: (e) ->
|
||||
Backbone.Mediator.publish 'level:loading-view-unveiling', {}
|
||||
_.delay @onClickStartLevel, 1000 # If they never mouse-up for the click (or a modal shows up and interrupts the click), do it anyway.
|
||||
|
||||
onClickStartLevel: (e) ->
|
||||
onClickStartLevel: (e) =>
|
||||
return if @destroyed
|
||||
@unveil()
|
||||
|
||||
unveil: ->
|
||||
return if @$el.hasClass 'unveiled'
|
||||
@$el.addClass 'unveiled'
|
||||
loadingDetails = @$el.find('.loading-details')
|
||||
duration = parseFloat loadingDetails.css 'transition-duration'
|
||||
|
|
|
@ -329,7 +329,7 @@ module.exports = class PlayLevelView extends RootView
|
|||
onLevelStarted: ->
|
||||
return unless @surface?
|
||||
@loadingView.showReady()
|
||||
if window.currentModal and not window.currentModal.destroyed
|
||||
if window.currentModal and not window.currentModal.destroyed and window.currentModal.constructor isnt VictoryModal
|
||||
return Backbone.Mediator.subscribeOnce 'modal:closed', @onLevelStarted, @
|
||||
@surface.showLevel()
|
||||
if @otherSession and @level.get('type', true) isnt 'hero'
|
||||
|
|
|
@ -41,7 +41,7 @@ module.exports = class Spell
|
|||
@source = sessionSource
|
||||
@thangs = {}
|
||||
if @canRead() # We can avoid creating these views if we'll never use them.
|
||||
@view = new SpellView {spell: @, session: @session, worker: @worker}
|
||||
@view = new SpellView {spell: @, level: options.level, session: @session, worker: @worker}
|
||||
@view.render() # Get it ready and code loaded in advance
|
||||
@tabView = new SpellListTabEntryView spell: @, supermodel: @supermodel, language: @language
|
||||
@tabView.render()
|
||||
|
|
|
@ -100,11 +100,11 @@ module.exports = class SpellView extends CocoView
|
|||
@toggleControls null, @writable
|
||||
@aceSession.selection.on 'changeCursor', @onCursorActivity
|
||||
$(@ace.container).find('.ace_gutter').on 'click', '.ace_error, .ace_warning, .ace_info', @onAnnotationClick
|
||||
@zatanna = new Zatanna @ace,
|
||||
|
||||
liveCompletion: aceConfig.liveCompletion ? true
|
||||
completers:
|
||||
keywords: false
|
||||
# TODO: restore Zatanna when it totally stops the this.this.moveRight()(); problem
|
||||
#@zatanna = new Zatanna @ace,
|
||||
# liveCompletion: aceConfig.liveCompletion ? true
|
||||
# completers:
|
||||
# keywords: false
|
||||
|
||||
createACEShortcuts: ->
|
||||
@aceCommands = aceCommands = []
|
||||
|
@ -192,6 +192,7 @@ module.exports = class SpellView extends CocoView
|
|||
@ace.clearSelection()
|
||||
|
||||
addZatannaSnippets: (e) ->
|
||||
return unless @zatanna
|
||||
snippetEntries = []
|
||||
for owner, props of e.propGroups
|
||||
for prop in props
|
||||
|
@ -250,6 +251,7 @@ module.exports = class SpellView extends CocoView
|
|||
@createToolbarView()
|
||||
|
||||
createDebugView: ->
|
||||
return if @options.level.get('type', true) is 'hero' # We'll turn this on later, maybe, but not yet.
|
||||
@debugView = new SpellDebugView ace: @ace, thang: @thang, spell:@spell
|
||||
@$el.append @debugView.render().$el.hide()
|
||||
|
||||
|
@ -258,7 +260,7 @@ module.exports = class SpellView extends CocoView
|
|||
@$el.append @toolbarView.render().$el
|
||||
|
||||
onMouseOut: (e) ->
|
||||
@debugView.onMouseOut e
|
||||
@debugView?.onMouseOut e
|
||||
|
||||
getSource: ->
|
||||
@ace.getValue() # could also do @firepad.getText()
|
||||
|
@ -269,7 +271,7 @@ module.exports = class SpellView extends CocoView
|
|||
@thang = thang
|
||||
@spellThang = @spell.thangs[@thang.id]
|
||||
@createDebugView() unless @debugView
|
||||
@debugView.thang = @thang
|
||||
@debugView?.thang = @thang
|
||||
@toolbarView?.toggleFlow false
|
||||
@updateAether false, false
|
||||
# @addZatannaSnippets()
|
||||
|
@ -589,7 +591,7 @@ module.exports = class SpellView extends CocoView
|
|||
@decoratedGutter[row] = ''
|
||||
if not executed.length or (@spell.name is 'plan' and @spellThang.castAether.metrics.statementsExecuted < 20)
|
||||
@toolbarView?.toggleFlow false
|
||||
@debugView.setVariableStates {}
|
||||
@debugView?.setVariableStates {}
|
||||
return
|
||||
lastExecuted = _.last executed
|
||||
@toolbarView?.toggleFlow true
|
||||
|
@ -606,7 +608,7 @@ module.exports = class SpellView extends CocoView
|
|||
marked[start.row] = true
|
||||
markerType = 'fullLine'
|
||||
else
|
||||
@debugView.setVariableStates state.variables
|
||||
@debugView?.setVariableStates state.variables
|
||||
gotVariableStates = true
|
||||
markerType = 'text'
|
||||
markerRange = new Range start.row, start.col, end.row, end.col
|
||||
|
@ -618,7 +620,7 @@ module.exports = class SpellView extends CocoView
|
|||
@aceSession.removeGutterDecoration start.row, @decoratedGutter[start.row] if @decoratedGutter[start.row] isnt ''
|
||||
@aceSession.addGutterDecoration start.row, clazz
|
||||
@decoratedGutter[start.row] = clazz
|
||||
@debugView.setVariableStates {} unless gotVariableStates
|
||||
@debugView?.setVariableStates {} unless gotVariableStates
|
||||
null
|
||||
|
||||
highlightComments: ->
|
||||
|
@ -676,12 +678,12 @@ module.exports = class SpellView extends CocoView
|
|||
@ace.setDisplayIndentGuides aceConfig.indentGuides # default false
|
||||
@ace.setShowInvisibles aceConfig.invisibles # default false
|
||||
@ace.setKeyboardHandler @keyBindings[aceConfig.keyBindings ? 'default']
|
||||
@zatanna.set 'liveCompletion', (aceConfig.liveCompletion ? false)
|
||||
@zatanna?.set 'liveCompletion', (aceConfig.liveCompletion ? false)
|
||||
|
||||
onChangeLanguage: (e) ->
|
||||
return unless @spell.canWrite()
|
||||
@aceSession.setMode @editModes[e.language]
|
||||
# @zatanna.set 'language', @editModes[e.language].substr('ace/mode/')
|
||||
# @zatanna?.set 'language', @editModes[e.language].substr('ace/mode/')
|
||||
wasDefault = @getSource() is @spell.originalSource
|
||||
@spell.setLanguage e.language
|
||||
@reloadCode true if wasDefault
|
||||
|
|
|
@ -137,6 +137,7 @@ module.exports = class TomeView extends CocoView
|
|||
spectateView: @options.spectateView
|
||||
spectateOpponentCodeLanguage: @options.spectateOpponentCodeLanguage
|
||||
levelID: @options.levelID
|
||||
level: @options.level
|
||||
|
||||
for thangID, spellKeys of @thangSpells
|
||||
thang = world.getThangByID thangID
|
||||
|
|
Loading…
Reference in a new issue