Fixed walls not updating when you edit them in the ThangsTabView.

This commit is contained in:
Scott Erickson 2014-10-03 11:21:05 -07:00
parent 3305a3d7db
commit cc04626a5a
2 changed files with 6 additions and 3 deletions
app
lib/surface
views/editor/level/thangs

View file

@ -238,13 +238,15 @@ module.exports = class LankBoss extends CocoClass
possiblyUpdatedWallLanks = (lank for lank in wallLanks when _.find updatedObstacles, (w2) -> lank is w2 or (Math.abs(lank.thang.pos.x - w2.thang.pos.x) + Math.abs(lank.thang.pos.y - w2.thang.pos.y)) <= 16) possiblyUpdatedWallLanks = (lank for lank in wallLanks when _.find updatedObstacles, (w2) -> lank is w2 or (Math.abs(lank.thang.pos.x - w2.thang.pos.x) + Math.abs(lank.thang.pos.y - w2.thang.pos.y)) <= 16)
else else
possiblyUpdatedWallLanks = wallLanks possiblyUpdatedWallLanks = wallLanks
#console.log 'updating up to', possiblyUpdatedWallLanks.length, 'of', wallLanks.length, 'wall lanks from updatedObstacles', updatedObstacles # console.log 'updating up to', possiblyUpdatedWallLanks.length, 'of', wallLanks.length, 'wall lanks from updatedObstacles', updatedObstacles
for wallLank in possiblyUpdatedWallLanks for wallLank in possiblyUpdatedWallLanks
wallLank.queueAction 'idle' if not wallLank.currentRootAction
wallLank.lockAction(false)
wallLank.updateActionDirection wallGrid wallLank.updateActionDirection wallGrid
wallLank.lockAction() wallLank.lockAction(true)
wallLank.updateScale() wallLank.updateScale()
wallLank.updatePosition() wallLank.updatePosition()
#console.log @wallGrid.toString() # console.log wallGrid.toString()
@cachedObstacles = true @cachedObstacles = true
lankFor: (thangID) -> @lanks[thangID] lankFor: (thangID) -> @lanks[thangID]

View file

@ -519,6 +519,7 @@ module.exports = class ThangsTabView extends CocoView
console.error 'Catastrophic error loading the level:', error console.error 'Catastrophic error loading the level:', error
thang.isSelectable = not thang.isLand for thang in @world.thangs # let us select walls and such thang.isSelectable = not thang.isLand for thang in @world.thangs # let us select walls and such
@surface?.setWorld @world @surface?.setWorld @world
@surface?.lankBoss.cachedObstacles = false
@selectAddThangType @addThangType, @cloneSourceThang if @addThangType # make another addThang sprite, since the World just refreshed @selectAddThangType @addThangType, @cloneSourceThang if @addThangType # make another addThang sprite, since the World just refreshed
# update selection, since the thangs have been remade # update selection, since the thangs have been remade