diff --git a/app/lib/world/world.coffee b/app/lib/world/world.coffee index f94a6d26a..ca61daddb 100644 --- a/app/lib/world/world.coffee +++ b/app/lib/world/world.coffee @@ -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) diff --git a/app/styles/editor/level/thangs_tab.sass b/app/styles/editor/level/thangs_tab.sass index 0bbf859e1..e8175462f 100644 --- a/app/styles/editor/level/thangs_tab.sass +++ b/app/styles/editor/level/thangs_tab.sass @@ -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 diff --git a/app/templates/editor/level/thangs_tab.jade b/app/templates/editor/level/thangs_tab.jade index 54eb93f7e..3cb870ddd 100644 --- a/app/templates/editor/level/thangs_tab.jade +++ b/app/templates/editor/level/thangs_tab.jade @@ -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 diff --git a/app/views/editor/level/thangs/ThangsTabView.coffee b/app/views/editor/level/thangs/ThangsTabView.coffee index 45d652a94..5f28b1279 100644 --- a/app/views/editor/level/thangs/ThangsTabView.coffee +++ b/app/views/editor/level/thangs/ThangsTabView.coffee @@ -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] diff --git a/server/commons/Handler.coffee b/server/commons/Handler.coffee index d55dcadbe..55b45884f 100644 --- a/server/commons/Handler.coffee +++ b/server/commons/Handler.coffee @@ -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 -