diff --git a/app/views/editor/level/modals/TerrainRandomizeModal.coffee b/app/views/editor/level/modals/TerrainRandomizeModal.coffee index 607ed92c6..31958e8d0 100644 --- a/app/views/editor/level/modals/TerrainRandomizeModal.coffee +++ b/app/views/editor/level/modals/TerrainRandomizeModal.coffee @@ -3,6 +3,10 @@ template = require 'templates/editor/level/modal/terrain_randomize' CocoModel = require 'models/CocoModel' clusters = { + 'hero': { + 'thangs': ['Hero Placeholder'] + 'margin': 1 + } 'rocks': { 'thangs': ['Rock 1', 'Rock 2', 'Rock 3', 'Rock 4', 'Rock 5', 'Rock Cluster 1', 'Rock Cluster 2', 'Rock Cluster 3'] 'margin': 1 @@ -97,6 +101,14 @@ presets = { 'thickness': [2,2] 'cluster': 'dungeon_wall' } + 'hero': { + 'num': [1, 1] + 'width': 2 + 'height': 2 + 'clusters': { + 'hero': [1, 1] + } + } 'Barrels': { 'num': [1,1] 'width': [8, 12] @@ -130,6 +142,14 @@ presets = { 'thickness': [2,2] 'cluster': 'indoor_wall' } + 'hero': { + 'num': [1, 1] + 'width': 2 + 'height': 2 + 'clusters': { + 'hero': [1, 1] + } + } 'furniture': { 'num':[1,2] 'width': 15 @@ -148,6 +168,14 @@ presets = { 'borderThickness':3 'floors':'grass_floor' 'decorations': { + 'hero': { + 'num': [1, 1] + 'width': 2 + 'height': 2 + 'clusters': { + 'hero': [1, 1] + } + } 'house': { 'num':[1,2] #min-max 'width': 15 diff --git a/app/views/editor/level/thangs/ThangsTabView.coffee b/app/views/editor/level/thangs/ThangsTabView.coffee index 35a4b00ac..8a1e07508 100644 --- a/app/views/editor/level/thangs/ThangsTabView.coffee +++ b/app/views/editor/level/thangs/ThangsTabView.coffee @@ -259,7 +259,7 @@ module.exports = class ThangsTabView extends CocoView # We alt-clicked, so create a clone addThang @selectAddThangType e.thang.spriteName, @selectedExtantThang else if @justAdded() - console.log 'Skipping double insert due to extra selection event, since we just added', (new Date() - @lastAddTime), 'ms ago.' + # Skip double insert due to extra selection event null else if e.thang and not (@addThangSprite and @addThangType.get('name') in overlappableThangTypeNames) # We clicked on a Thang (or its Treema), so select the Thang @@ -426,7 +426,11 @@ module.exports = class ThangsTabView extends CocoView addThang: (thangType, pos, batchInsert=false) -> @$el.find('#randomize-button').hide() if batchInsert - thangID = "Random #{thangType.get('name')} #{@thangsBatch.length}" + if thangType.get('name') is 'Hero Placeholder' + thangID = 'Hero Placeholder' + return if @level.get('type') isnt 'hero' or @thangsTreema.get "id=#{thangID}" + else + thangID = "Random #{thangType.get('name')} #{@thangsBatch.length}" else thangID = Thang.nextID(thangType.get('name'), @world) until thangID and not @thangsTreema.get "id=#{thangID}" if @cloneSourceThang