mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 15:48:11 -05:00
Fixed #1062. Added Item kind to level editor Thang filters.
This commit is contained in:
parent
852dabc17a
commit
4d4e321265
5 changed files with 12 additions and 5 deletions
|
@ -240,7 +240,7 @@ module.exports = class World
|
|||
calculateBounds: ->
|
||||
bounds = {left: 0, top: 0, right: 0, bottom: 0}
|
||||
hasLand = _.some @thangs, 'isLand'
|
||||
for thang in @thangs when thang.isLand or not hasLand # Look at Lands only
|
||||
for thang in @thangs when thang.isLand or (not hasLand and thang.rectangle) # Look at Lands only
|
||||
rect = thang.rectangle().axisAlignedBoundingBox()
|
||||
bounds.left = Math.min(bounds.left, rect.x - rect.width / 2)
|
||||
bounds.right = Math.max(bounds.right, rect.x + rect.width / 2)
|
||||
|
|
|
@ -110,6 +110,12 @@ $mobile: 1050px
|
|||
.treema-node.treema-Wall
|
||||
display: block
|
||||
|
||||
&.hide-except-Item
|
||||
.treema-node
|
||||
display: none
|
||||
.treema-node.treema-Item
|
||||
display: block
|
||||
|
||||
&.hide-except-Misc
|
||||
.treema-node
|
||||
display: none
|
||||
|
|
|
@ -15,6 +15,8 @@ button.navbar-toggle.toggle.btn-primary#thangs-palette-toggle(type="button", dat
|
|||
i.icon-globe
|
||||
button.btn.btn-primary(value="Doodad", title="Doodad")
|
||||
i.icon-leaf
|
||||
button.btn.btn-primary(value="Item", title="Item")
|
||||
i.icon-gift
|
||||
button.btn.btn-primary(value="Misc", title="Misc")
|
||||
i.icon-question-sign
|
||||
.editor-nano-container.nano
|
||||
|
|
|
@ -116,7 +116,7 @@ module.exports = class ThangsTabView extends CocoView
|
|||
$(window).resize @onWindowResize
|
||||
@addThangsView = @insertSubView new AddThangsView world: @world, supermodel: @supermodel
|
||||
@buildInterface() # refactor to not have this trigger when this view re-renders?
|
||||
if @thangsTreema.data.length
|
||||
if @thangsTreema.data.length
|
||||
@$el.find('#canvas-overlay').css('display', 'none')
|
||||
|
||||
onFilterExtantThangs: (e) ->
|
||||
|
@ -500,7 +500,7 @@ class ThangNode extends TreemaObjectNode
|
|||
s = "#{@data.thangType}"
|
||||
if isObjectID s
|
||||
unless name = ThangNode.thangNameMap[s]
|
||||
thangType = _.find @settings.supermodel.getModels(ThangType), (m) -> m.get('original') is s
|
||||
thangType = _.find @settings.supermodel.getModels(ThangType), (m) -> m.get('original') is s and m.get('kind')
|
||||
name = ThangNode.thangNameMap[s] = thangType.get 'name'
|
||||
ThangNode.thangKindMap[s] = thangType.get 'kind'
|
||||
kind = ThangNode.thangKindMap[s]
|
||||
|
|
|
@ -166,7 +166,7 @@ module.exports = class Handler
|
|||
ids = ids.split(',') if _.isString ids
|
||||
ids = _.uniq ids
|
||||
|
||||
project = {name:1, original:1}
|
||||
project = {name:1, original:1, kind:1}
|
||||
sort = {'version.major':-1, 'version.minor':-1}
|
||||
|
||||
makeFunc = (id) =>
|
||||
|
@ -450,4 +450,3 @@ module.exports = class Handler
|
|||
projection = {}
|
||||
projection[field] = 0 for field in model.privateProperties
|
||||
projection
|
||||
|
||||
|
|
Loading…
Reference in a new issue