mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-05-03 17:33:31 -04:00
Hack LevelEditor to load web-dev levels
This commit is contained in:
parent
be50657530
commit
5b16da099a
1 changed files with 7 additions and 0 deletions
|
@ -76,6 +76,13 @@ module.exports = class LevelLoader extends CocoClass
|
||||||
@sessionDependenciesRegistered = {}
|
@sessionDependenciesRegistered = {}
|
||||||
if @level.isType('web-dev')
|
if @level.isType('web-dev')
|
||||||
@headless = true
|
@headless = true
|
||||||
|
if @sessionless
|
||||||
|
# When loading a web-dev level in the level editor, pretend it's a normal hero level so we can put down our placeholder Thang.
|
||||||
|
# TODO: avoid this whole roundabout Thang-based way of doing web-dev levels
|
||||||
|
originalGet = @level.get
|
||||||
|
@level.get = ->
|
||||||
|
return 'hero' if arguments[0] is 'type'
|
||||||
|
originalGet.apply @, arguments
|
||||||
if (@courseID and not @level.isType('course', 'course-ladder')) or window.serverConfig.picoCTF
|
if (@courseID and not @level.isType('course', 'course-ladder')) or window.serverConfig.picoCTF
|
||||||
# Because we now use original hero levels for both hero and course levels, we fake being a course level in this context.
|
# Because we now use original hero levels for both hero and course levels, we fake being a course level in this context.
|
||||||
originalGet = @level.get
|
originalGet = @level.get
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue