Don't play a selection sound when adding a Thang.

This commit is contained in:
Nick Winter 2014-10-07 12:04:55 -07:00
parent 5261a7d4d9
commit ff467d1f31

View file

@ -343,8 +343,8 @@ module.exports = class ThangsTabView extends CocoView
wasSelected = target.hasClass 'selected' wasSelected = target.hasClass 'selected'
@$el.find('.add-thangs-palette .add-thang-palette-icon.selected').removeClass('selected') @$el.find('.add-thangs-palette .add-thang-palette-icon.selected').removeClass('selected')
@selectAddThangType(if wasSelected then null else target.attr 'data-thang-type') unless key.alt or key.meta @selectAddThangType(if wasSelected then null else target.attr 'data-thang-type') unless key.alt or key.meta
@addThangLank?.playSound? 'selected'
target.addClass('selected') if @addThangType target.addClass('selected') if @addThangType
#false # was causing #1099, any reason to keep?
moveAddThangSelection: (direction) -> moveAddThangSelection: (direction) ->
return unless @addThangType return unless @addThangType
@ -366,7 +366,6 @@ module.exports = class ThangsTabView extends CocoView
@addThangLank = @surface.lankBoss.addThangToLanks thang, @surface.lankBoss.layerAdapters['Floating'] @addThangLank = @surface.lankBoss.addThangToLanks thang, @surface.lankBoss.layerAdapters['Floating']
@addThangLank.notOfThisWorld = true @addThangLank.notOfThisWorld = true
@addThangLank.sprite.alpha = 0.75 @addThangLank.sprite.alpha = 0.75
@addThangLank.playSound? 'selected'
pos ?= x: Math.round(@world.width / 2), y: Math.round(@world.height / 2) pos ?= x: Math.round(@world.width / 2), y: Math.round(@world.height / 2)
@adjustThangPos @addThangLank, thang, pos @adjustThangPos @addThangLank, thang, pos
else else