Making all code languages load for level editor to avoid busted level previews. Added CoffeeScript compiler to web worker so we can use Referee extraCode.

This commit is contained in:
Nick Winter 2015-03-04 11:28:30 -08:00
parent 29582cecdf
commit 60db16b1c3
3 changed files with 12 additions and 2 deletions

View file

@ -29,6 +29,14 @@ storage = require 'core/storage'
require 'vendor/coffeescript' # this is tenuous, since the LevelSession and LevelComponent models are what compile the code require 'vendor/coffeescript' # this is tenuous, since the LevelSession and LevelComponent models are what compile the code
require 'vendor/treema' require 'vendor/treema'
# Make sure that all of our Aethers are loaded, so that if we try to preview the level, it will work.
require 'vendor/aether-javascript'
require 'vendor/aether-python'
require 'vendor/aether-coffeescript'
require 'vendor/aether-lua'
require 'vendor/aether-clojure'
require 'vendor/aether-io'
module.exports = class LevelEditView extends RootView module.exports = class LevelEditView extends RootView
id: 'editor-level-view' id: 'editor-level-view'
className: 'editor' className: 'editor'

View file

@ -210,6 +210,7 @@ module.exports = class SpellPaletteView extends CocoView
for owner, storages of propStorage for owner, storages of propStorage
if props = component.config[storages] if props = component.config[storages]
for prop in _.sortBy(props) when prop[0] isnt '_' and not itemsByProp[prop] # no private properties for prop in _.sortBy(props) when prop[0] isnt '_' and not itemsByProp[prop] # no private properties
continue if prop is 'moveXY' and @options.level.get('slug') is 'slalom' # Hide for Slalom
propsByItem[item.get('name')] ?= [] propsByItem[item.get('name')] ?= []
propsByItem[item.get('name')].push owner: owner, prop: prop, item: item propsByItem[item.get('name')].push owner: owner, prop: prop, item: item
itemsByProp[prop] = item itemsByProp[prop] = item
@ -220,8 +221,8 @@ module.exports = class SpellPaletteView extends CocoView
# Assign any unassigned properties to the hero itself. # Assign any unassigned properties to the hero itself.
for owner, storage of propStorage for owner, storage of propStorage
for prop in _.reject(@thang[storage] ? [], (prop) -> itemsByProp[prop] or prop[0] is '_') # no private properties for prop in _.reject(@thang[storage] ? [], (prop) -> itemsByProp[prop] or prop[0] is '_') # no private properties
if prop is 'say' and @options.level.get 'hidesSay' # Hide for Dungeon Campaign continue if prop is 'say' and @options.level.get 'hidesSay' # Hide for Dungeon Campaign
continue continue if prop is 'moveXY' and @options.level.get('slug') is 'slalom' # Hide for Slalom
propsByItem['Hero'] ?= [] propsByItem['Hero'] ?= []
propsByItem['Hero'].push owner: owner, prop: prop, item: itemThangTypes[@thang.spriteName] propsByItem['Hero'].push owner: owner, prop: prop, item: itemThangTypes[@thang.spriteName]
++propCount ++propCount

View file

@ -76,6 +76,7 @@ exports.config =
regJoin('^vendor/scripts/Box2dWeb-2.1.a.3') regJoin('^vendor/scripts/Box2dWeb-2.1.a.3')
regJoin('^vendor/scripts/string_score.js') regJoin('^vendor/scripts/string_score.js')
regJoin('^bower_components/underscore.string') regJoin('^bower_components/underscore.string')
regJoin('^vendor/scripts/coffeescript.js')
] ]
#- vendor.js, all the vendor libraries #- vendor.js, all the vendor libraries