- Add RectangleShape2D to Character and InteractiveObject collision areas - Fix HUD button signal connections in _ready() - Fix character_placed signal emitting global_position - Extract DEFAULT_DRAG_RADIUS constant in DragDropComponent - Type Variant on JSON parsed variable in SaveManager - Extract music symbol constants in HUD - Refactor duplicated drag input code in InputManager Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
21 lines
603 B
GDScript
21 lines
603 B
GDScript
## HUD — heads-up display with back button and music toggle.
|
|
extends CanvasLayer
|
|
|
|
const MUSIC_ON_SYMBOL: String = "♪"
|
|
const MUSIC_OFF_SYMBOL: String = "✕"
|
|
|
|
var _music_enabled: bool = true
|
|
|
|
|
|
func _on_back_button_pressed() -> void:
|
|
get_tree().quit()
|
|
|
|
|
|
func _on_music_toggle_pressed() -> void:
|
|
_music_enabled = not _music_enabled
|
|
var volume: float = AudioManager.DEFAULT_MUSIC_VOLUME if _music_enabled else 0.0
|
|
AudioManager.set_music_volume(volume)
|
|
var btn: Button = get_node_or_null("MusicToggle") as Button
|
|
if btn != null:
|
|
btn.text = MUSIC_ON_SYMBOL if _music_enabled else MUSIC_OFF_SYMBOL
|