mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Added the rest of the custom TreemaNodes to the SystemsTabView as well.
This commit is contained in:
parent
8e17a54dc3
commit
8042f27ba7
2 changed files with 26 additions and 3 deletions
|
@ -82,7 +82,7 @@ module.exports = class LevelEditView extends RootView
|
|||
@insertSubView new SettingsTabView supermodel: @supermodel
|
||||
@insertSubView new ScriptsTabView world: @world, supermodel: @supermodel, files: @files
|
||||
@insertSubView new ComponentsTabView supermodel: @supermodel
|
||||
@insertSubView new SystemsTabView supermodel: @supermodel
|
||||
@insertSubView new SystemsTabView supermodel: @supermodel, world: @world
|
||||
@insertSubView new RelatedAchievementsView supermodel: @supermodel, level: @level
|
||||
@insertSubView new ComponentsDocumentationView lazy: true # Don't give it the supermodel, it'll pollute it!
|
||||
@insertSubView new SystemsDocumentationView lazy: true # Don't give it the supermodel, it'll pollute it!
|
||||
|
|
|
@ -5,7 +5,7 @@ LevelSystem = require 'models/LevelSystem'
|
|||
LevelSystemEditView = require './LevelSystemEditView'
|
||||
NewLevelSystemModal = require './NewLevelSystemModal'
|
||||
AddLevelSystemModal = require './AddLevelSystemModal'
|
||||
{ThangTypeNode} = require './../treema_nodes'
|
||||
nodes = require '../treema_nodes'
|
||||
|
||||
module.exports = class SystemsTabView extends CocoView
|
||||
id: 'systems-tab-view'
|
||||
|
@ -48,18 +48,41 @@ module.exports = class SystemsTabView extends CocoView
|
|||
systems = @buildDefaultSystems()
|
||||
insertedDefaults = true
|
||||
systems = @getSortedByName systems
|
||||
thangs = if @level? then @level.get('thangs') else []
|
||||
thangIDs = _.filter(_.pluck(thangs, 'id'))
|
||||
teams = _.filter(_.pluck(thangs, 'team'))
|
||||
superteams = _.filter(_.pluck(thangs, 'superteam'))
|
||||
superteams = _.union(teams, superteams)
|
||||
treemaOptions =
|
||||
supermodel: @supermodel
|
||||
schema: Level.schema.properties.systems
|
||||
data: systems
|
||||
readOnly: me.get('anonymous')
|
||||
world: @options.world
|
||||
view: @
|
||||
thangIDs: thangIDs
|
||||
teams: teams
|
||||
superteams: superteams
|
||||
callbacks:
|
||||
change: @onSystemsChanged
|
||||
select: @onSystemSelected
|
||||
nodeClasses:
|
||||
'level-system': LevelSystemNode
|
||||
'level-system-configuration': LevelSystemConfigurationNode
|
||||
'thang-type': ThangTypeNode # Not until we actually want CocoSprite IndieSprites
|
||||
'point2d': nodes.WorldPointNode
|
||||
'viewport': nodes.WorldViewportNode
|
||||
'bounds': nodes.WorldBoundsNode
|
||||
'radians': nodes.RadiansNode
|
||||
'team': nodes.TeamNode
|
||||
'superteam': nodes.SuperteamNode
|
||||
'meters': nodes.MetersNode
|
||||
'kilograms': nodes.KilogramsNode
|
||||
'seconds': nodes.SecondsNode
|
||||
'speed': nodes.SpeedNode
|
||||
'acceleration': nodes.AccelerationNode
|
||||
'thang-type': nodes.ThangTypeNode
|
||||
'item-thang-type': nodes.ItemThangTypeNode
|
||||
|
||||
@systemsTreema = @$el.find('#systems-treema').treema treemaOptions
|
||||
@systemsTreema.build()
|
||||
@systemsTreema.open()
|
||||
|
|
Loading…
Reference in a new issue