Fixed #1062. Added Item kind to level editor Thang filters.

This commit is contained in:
Nick Winter 2014-08-06 08:24:50 -07:00
parent 852dabc17a
commit 4d4e321265
5 changed files with 12 additions and 5 deletions

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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]

View file

@ -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