update fonts and some gui
This commit is contained in:
+15
-39
@@ -38,6 +38,8 @@ extends Control
|
||||
@onready var random_spawn_label = $LobbyPanel/TopBar/SettingsSection/RandomSpawnLabel
|
||||
@onready var enable_timer_check = $LobbyPanel/TopBar/SettingsSection/EnableTimerCheck
|
||||
@onready var enable_timer_label = $LobbyPanel/TopBar/SettingsSection/EnableTimerLabel
|
||||
@onready var scarcity_option = $LobbyPanel/TopBar/SettingsSection/ScarcityOption
|
||||
@onready var scarcity_label = $LobbyPanel/TopBar/SettingsSection/ScarcityLabel
|
||||
|
||||
# UI References - Player Slots
|
||||
@onready var players_container = $LobbyPanel/PlayersContainer
|
||||
@@ -69,10 +71,6 @@ var admin_panel_instance: Control
|
||||
# Store current match ID for copy function
|
||||
var current_match_id: String = ""
|
||||
|
||||
# Scarcity Controls (Injected via code since we can't edit scene)
|
||||
var scarcity_option: OptionButton
|
||||
var scarcity_label: Label
|
||||
|
||||
# Server Selection Controls (Now in tscn)
|
||||
# var server_option: OptionButton
|
||||
# var server_ip_input: LineEdit
|
||||
@@ -85,9 +83,6 @@ func _ready():
|
||||
# Load character textures
|
||||
_load_character_textures()
|
||||
|
||||
# Inject Scarcity UI
|
||||
call_deferred("_setup_scarcity_ui")
|
||||
|
||||
# Server config UI is now in tscn
|
||||
|
||||
# Get player slot references
|
||||
@@ -147,6 +142,9 @@ func _ready():
|
||||
ready_btn.toggled.connect(_on_ready_toggled)
|
||||
start_game_btn.pressed.connect(_on_start_game_pressed)
|
||||
|
||||
if scarcity_option:
|
||||
scarcity_option.item_selected.connect(_on_scarcity_selected)
|
||||
|
||||
# Connect LobbyManager signals
|
||||
LobbyManager.room_list_updated.connect(_on_room_list_updated)
|
||||
LobbyManager.room_joined.connect(_on_room_joined)
|
||||
@@ -176,10 +174,16 @@ func _ready():
|
||||
# =============================================================================
|
||||
|
||||
func _load_character_textures() -> void:
|
||||
"""Load character expression textures for preview."""
|
||||
var characters = ["Bob", "Gatot", "Masbro", "Oldpop"]
|
||||
"""Load character preview textures."""
|
||||
var characters = {
|
||||
"Copper": "res://assets/graphics/character_selection/sc_characters/sc_copper.png",
|
||||
"Dabro": "res://assets/graphics/character_selection/sc_characters/sc_dabro.png",
|
||||
"Gatot": "res://assets/graphics/character_selection/sc_characters/sc_gatot.png",
|
||||
"Pip": "res://assets/graphics/character_selection/sc_characters/sc_pip.png",
|
||||
"Random": "res://assets/graphics/character_selection/sc_characters/sc_unknown.png"
|
||||
}
|
||||
for char_name in characters:
|
||||
var tex_path = "res://assets/characters/%s_%s-expression.png" % [char_name, char_name.to_lower()]
|
||||
var tex_path = characters[char_name]
|
||||
if ResourceLoader.exists(tex_path):
|
||||
character_textures[char_name] = load(tex_path)
|
||||
else:
|
||||
@@ -199,33 +203,6 @@ func _on_server_ip_submitted(new_text: String) -> void:
|
||||
if server_option and server_option.selected == 1:
|
||||
NakamaManager.set_server(new_text.strip_edges())
|
||||
|
||||
func _setup_scarcity_ui() -> void:
|
||||
"""Inject scarcity controls into SettingsSection."""
|
||||
if not duration_option: return
|
||||
|
||||
var settings_section = duration_option.get_parent()
|
||||
if not settings_section: return
|
||||
|
||||
# Create OptionButton for Host
|
||||
scarcity_option = OptionButton.new()
|
||||
scarcity_option.add_item("Normal") # ID 0
|
||||
scarcity_option.add_item("Aggressive") # ID 1
|
||||
scarcity_option.add_item("Chaos") # ID 2
|
||||
scarcity_option.selected = 0
|
||||
scarcity_option.tooltip_text = "Select Scarcity Mode"
|
||||
scarcity_option.name = "ScarcityOption"
|
||||
scarcity_option.item_selected.connect(_on_scarcity_selected)
|
||||
|
||||
# Create Label for Clients
|
||||
scarcity_label = Label.new()
|
||||
scarcity_label.text = "Normal"
|
||||
scarcity_label.name = "ScarcityLabel"
|
||||
# Copy style from duration_text_label if possible, usually fine default
|
||||
|
||||
# Add to scene
|
||||
settings_section.add_child(scarcity_option)
|
||||
settings_section.add_child(scarcity_label)
|
||||
|
||||
func _setup_player_slots() -> void:
|
||||
"""Get references to all player slot nodes."""
|
||||
player_slots.clear()
|
||||
@@ -418,7 +395,6 @@ func _on_room_list_updated(rooms: Array) -> void:
|
||||
func _on_room_joined(room_data: Dictionary) -> void:
|
||||
_show_panel("lobby")
|
||||
current_match_id = room_data.get("match_id", "")
|
||||
room_name_header.text = "ROOM: %s" % room_data.get("room_name", "Unknown")
|
||||
match_id_display.text = "ID: %s" % _truncate_id(current_match_id)
|
||||
|
||||
# Configure host-specific UI
|
||||
@@ -579,7 +555,7 @@ func _update_player_slots() -> void:
|
||||
|
||||
# Use a character for bot preview
|
||||
var char_preview = slot.get_node_or_null("CharacterPreview%d" % slot_num)
|
||||
var bot_characters = ["Bob", "Gatot", "Masbro", "Oldpop"]
|
||||
var bot_characters = ["Copper", "Dabro", "Gatot", "Pip"]
|
||||
var bot_char = bot_characters[(i) % bot_characters.size()]
|
||||
if char_preview and character_textures.has(bot_char):
|
||||
char_preview.texture = character_textures[bot_char]
|
||||
|
||||
Reference in New Issue
Block a user