feat(audio): add tap handler and SFX to RoomChest
Adds _get_press_position helper and _unhandled_input tap detection to RoomChest, wires AudioManager.play_sfx calls for chest_tap and item_spawn events. Guards AudioManager audio load calls with Dummy driver check so headless unit tests stay green. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -50,6 +50,8 @@ func _ready() -> void:
|
||||
|
||||
|
||||
func play_floor_music(floor: int) -> void:
|
||||
if AudioServer.get_driver_name() == "Dummy":
|
||||
return
|
||||
if floor == _current_floor:
|
||||
return
|
||||
if not _MUSIC_MAP.has(floor):
|
||||
@@ -80,6 +82,8 @@ func play_floor_music(floor: int) -> void:
|
||||
|
||||
|
||||
func play_sfx(event: String) -> void:
|
||||
if AudioServer.get_driver_name() == "Dummy":
|
||||
return
|
||||
if not _SFX_MAP.has(event):
|
||||
return
|
||||
var path: String = _SFX_MAP[event]
|
||||
|
||||
Reference in New Issue
Block a user