feat: Add right hand/foot editor options, Flintstones Water Buffalo Lodge hat, hide controls in world editor, and easy main menu sound toggle
checkpoint / checkpoint (push) Successful in 6m19s

This commit is contained in:
2026-09-20 11:40:41 +00:00
parent 034a6901a9
commit 62fa0b0067
18 changed files with 601 additions and 20 deletions
+58 -13
View File
@@ -94,9 +94,11 @@ static func _update_sound_button(btn: Button) -> void:
var audio_mgr: Node = main_loop.root.get_node_or_null("AudioManager") if main_loop is SceneTree else null
var enabled: bool = audio_mgr.is_sound_enabled() if audio_mgr and audio_mgr.has_method("is_sound_enabled") else true
if enabled:
btn.text = "🔊 Sound: ON"
btn.text = "🔊 Sound: ON [M]"
btn.tooltip_text = "Sound is enabled. Click or press [M] to mute."
else:
btn.text = "🔇 Sound: OFF"
btn.text = "🔇 Sound: OFF [M]"
btn.tooltip_text = "Sound is muted. Click or press [M] to unmute."
func _ready() -> void:
@@ -149,7 +151,7 @@ func _ready() -> void:
var sound_btn := Button.new()
sound_btn.name = "SoundButton"
sound_btn.set_anchors_preset(Control.PRESET_TOP_RIGHT)
sound_btn.offset_left = -440
sound_btn.offset_left = -460
sound_btn.offset_top = 10
sound_btn.offset_right = -310
sound_btn.offset_bottom = 38
@@ -161,16 +163,6 @@ func _ready() -> void:
audio_mgr.toggle_sound()
_update_sound_button(sound_btn)
)
var audio_singleton = get_node_or_null("/root/AudioManager")
if audio_singleton and audio_singleton.has_signal("sound_toggled"):
var on_toggled = func(_enabled: bool):
if is_instance_valid(sound_btn):
_update_sound_button(sound_btn)
audio_singleton.sound_toggled.connect(on_toggled)
sound_btn.tree_exiting.connect(func():
if is_instance_valid(audio_singleton) and audio_singleton.sound_toggled.is_connected(on_toggled):
audio_singleton.sound_toggled.disconnect(on_toggled)
)
add_child(sound_btn)
# Cache node references.
@@ -178,6 +170,50 @@ func _ready() -> void:
_login_button = $CenterContainer/VBoxContainer/AuthButtonsRow/LoginButton
_register_button = $CenterContainer/VBoxContainer/AuthButtonsRow/RegisterButton
_auth_panel = $CenterContainer/VBoxContainer/AuthPanel
# Prominent sound button in AuthButtonsRow on the logged-out start screen
var auth_sound_btn := Button.new()
auth_sound_btn.name = "AuthSoundButton"
auth_sound_btn.size_flags_horizontal = Control.SIZE_EXPAND_FILL
auth_sound_btn.add_theme_font_size_override("font_size", 13)
_update_sound_button(auth_sound_btn)
auth_sound_btn.pressed.connect(func():
var audio_mgr = get_node_or_null("/root/AudioManager")
if audio_mgr and audio_mgr.has_method("toggle_sound"):
audio_mgr.toggle_sound()
_update_sound_button(auth_sound_btn)
)
_auth_buttons_row.add_child(auth_sound_btn)
# Sound toggle also inside AuthPanel so user can toggle sound without closing the auth form
var panel_sound_btn := Button.new()
panel_sound_btn.name = "PanelSoundButton"
panel_sound_btn.size_flags_horizontal = Control.SIZE_EXPAND_FILL
panel_sound_btn.add_theme_font_size_override("font_size", 12)
_update_sound_button(panel_sound_btn)
panel_sound_btn.pressed.connect(func():
var audio_mgr = get_node_or_null("/root/AudioManager")
if audio_mgr and audio_mgr.has_method("toggle_sound"):
audio_mgr.toggle_sound()
_update_sound_button(panel_sound_btn)
)
var auth_vbox = $CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox
auth_vbox.add_child(panel_sound_btn)
var audio_singleton = get_node_or_null("/root/AudioManager")
if audio_singleton and audio_singleton.has_signal("sound_toggled"):
var on_toggled = func(_enabled: bool):
if is_instance_valid(sound_btn):
_update_sound_button(sound_btn)
if is_instance_valid(auth_sound_btn):
_update_sound_button(auth_sound_btn)
if is_instance_valid(panel_sound_btn):
_update_sound_button(panel_sound_btn)
audio_singleton.sound_toggled.connect(on_toggled)
tree_exiting.connect(func():
if is_instance_valid(audio_singleton) and audio_singleton.sound_toggled.is_connected(on_toggled):
audio_singleton.sound_toggled.disconnect(on_toggled)
)
_auth_mode_label = $CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/AuthModeLabel
_username_edit = $CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/UsernameEdit
_password_edit = $CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/PasswordEdit
@@ -512,6 +548,15 @@ func _clear_status() -> void:
func _unhandled_input(event: InputEvent) -> void:
if event is InputEventKey and event.pressed and not event.echo:
if event.keycode == KEY_M:
var focus_owner := get_viewport().gui_get_focus_owner()
if not (focus_owner is LineEdit or focus_owner is TextEdit):
var audio_mgr = get_node_or_null("/root/AudioManager")
if audio_mgr and audio_mgr.has_method("toggle_sound"):
audio_mgr.toggle_sound()
get_viewport().set_input_as_handled()
return
if event.is_action_pressed("ui_cancel"):
if has_node("ControlsModal"):
get_node("ControlsModal").queue_free()