feat: Implement powerup inventory UI, settings menu, and foundational managers for input and game settings.

This commit is contained in:
Yogi Wiguna
2026-03-10 12:52:53 +08:00
parent da7192ac07
commit e1e928389c
12 changed files with 723 additions and 98 deletions
+26 -1
View File
@@ -6,6 +6,7 @@ extends Control
@onready var create_room_btn = $MainMenuPanel/VBoxContainer/ButtonSection/CreateRoomBtn
@onready var browse_rooms_btn = $MainMenuPanel/VBoxContainer/ButtonSection/BrowseRoomsBtn
@onready var main_menu_profile_btn = $MainMenuPanel/VBoxContainer/ButtonSection/ProfileBtn
@onready var lobby_settings_btn = $MainMenuPanel/VBoxContainer/ButtonSection/SettingsBtn
# UI References - Server Selection
@onready var server_option = $MainMenuPanel/VBoxContainer/ServerSelectionSection/ServerOption
@@ -34,6 +35,7 @@ extends Control
@onready var copy_id_btn = $LobbyPanel/TopBar/MatchIdContainer/CopyIdBtn
@onready var duration_option = $LobbyPanel/TopBar/SettingsSection/DurationOption
@onready var duration_text_label = $LobbyPanel/TopBar/SettingsSection/DurationTextLabel
@onready var lobby_top_settings_btn = $LobbyPanel/TopBar/ProfileSection/LobbySettingsBtn
@onready var random_spawn_check = $LobbyPanel/TopBar/SettingsSection/RandomSpawnCheck
@onready var random_spawn_label = $LobbyPanel/TopBar/SettingsSection/RandomSpawnLabel
@onready var enable_timer_check = $LobbyPanel/TopBar/SettingsSection/EnableTimerCheck
@@ -114,6 +116,8 @@ func _ready():
browse_rooms_btn.pressed.connect(_on_browse_rooms_pressed)
if main_menu_profile_btn:
main_menu_profile_btn.pressed.connect(_on_profile_btn_pressed)
if lobby_settings_btn:
lobby_settings_btn.pressed.connect(_on_settings_pressed)
# Connect Server Selection signals
if server_option:
@@ -133,7 +137,10 @@ func _ready():
# Connect button signals - Lobby
profile_btn.pressed.connect(_on_profile_btn_pressed)
logout_btn.pressed.connect(_on_logout_pressed)
if logout_btn:
logout_btn.pressed.connect(_on_logout_pressed)
if lobby_top_settings_btn:
lobby_top_settings_btn.pressed.connect(_on_settings_pressed)
copy_id_btn.pressed.connect(_on_copy_id_pressed)
duration_option.item_selected.connect(_on_duration_selected)
random_spawn_check.toggled.connect(_on_random_spawn_toggled)
@@ -406,6 +413,24 @@ func _on_logout_pressed() -> void:
AuthManager.logout()
_go_to_login()
func _on_settings_pressed():
var settings_menu = get_node_or_null("SettingsMenu")
if not settings_menu:
var scene = load("res://scenes/ui/settings_menu.tscn")
if scene:
settings_menu = scene.instantiate()
settings_menu.name = "SettingsMenu"
add_child(settings_menu)
# Connect close button
var close_btn = settings_menu.get_node_or_null("PanelContainer/VBoxContainer/Header/CloseButton")
if close_btn:
# settings_menu.gd handles basic visibility, but we can override or add to it
pass
if settings_menu:
settings_menu.open()
func _go_to_login() -> void:
if get_tree():
get_tree().change_scene_to_file("res://scenes/ui/login_screen.tscn")