Standardize programmatic UI to scene-based instantiation (Phases 1-5)
Convert all screens that built UI nodes in GDScript into proper .tscn
scene files. Each component gets its own scene; parent screens use
preload + instantiate; data flows through setup() methods; actions use
signals. Eliminates ~1000 lines of boilerplate node-creation code.
Phase 1 — Simple row components (6 new scenes):
LeaderboardRow, NotificationRow, StarterDeckCard, DeckPickerButton,
StatRow, AbilityRow
Modifies: leaderboard_screen, account_screen, starter_deck_screen,
matchmaking_screen, card_detail_popup (GridContainer→VBox)
Phase 2 — Lobby browser rows (2 new scenes):
LobbyBrowserRow (signal join_requested), ActiveGameRow (signal spectate_requested)
Modifies: free_play_screen
Phase 3 — RulesEditorDialog (1 new scene):
Replaces 150+ line _open_rules_editor() in lobby_room_screen with
4-line instantiate pattern; signal confirmed(overrides)
Phase 4 — DeckEditorPanel.tscn:
Moves split-pane deck editor into scene file; removes _setup_ui(),
_make_left_pane(), _make_right_pane(); switches to @onready refs;
DecksView.tscn updated to instance the scene
Phase 5 — ChatOverlay.tscn:
Fully populates ChatPanel with header, 7 tab buttons, 7 content panes
(FriendsPane/PresencePane/GlobalPane/LobbyPane/GamePane/PartyPane/DmsPane),
and InputBar; removes _build_panel() and all _make_*/_build_*_tab()
functions from chat_overlay.gd; replaces with @onready refs and
_ready() wiring from scene children
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -49,3 +49,459 @@ offset_right = -16.0
|
||||
offset_bottom = -84.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
|
||||
[node name="RootVBox" type="VBoxContainer" parent="ChatPanel"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="Header" type="MarginContainer" parent="ChatPanel/RootVBox"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 12
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_top = 6
|
||||
theme_override_constants/margin_bottom = 6
|
||||
|
||||
[node name="HeaderInner" type="HBoxContainer" parent="ChatPanel/RootVBox/Header"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 4
|
||||
theme_override_constants/separation = 8
|
||||
|
||||
[node name="TitleLabel" type="Label" parent="ChatPanel/RootVBox/Header/HeaderInner"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Chat"
|
||||
theme_override_font_sizes/font_size = 15
|
||||
|
||||
[node name="CloseBtn" type="Button" parent="ChatPanel/RootVBox/Header/HeaderInner"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
flat = true
|
||||
text = "✕"
|
||||
theme_override_font_sizes/font_size = 14
|
||||
|
||||
[node name="HeaderSep" type="HSeparator" parent="ChatPanel/RootVBox"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TabBar" type="HBoxContainer" parent="ChatPanel/RootVBox"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
custom_minimum_size = Vector2(0, 28)
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="FriendsTabBtn" type="Button" parent="ChatPanel/RootVBox/TabBar"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
flat = true
|
||||
text = "Friends"
|
||||
theme_override_font_sizes/font_size = 11
|
||||
|
||||
[node name="PresenceTabBtn" type="Button" parent="ChatPanel/RootVBox/TabBar"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
flat = true
|
||||
text = "Presence"
|
||||
theme_override_font_sizes/font_size = 11
|
||||
|
||||
[node name="GlobalTabBtn" type="Button" parent="ChatPanel/RootVBox/TabBar"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
flat = true
|
||||
text = "Global"
|
||||
theme_override_font_sizes/font_size = 11
|
||||
|
||||
[node name="LobbyTabBtn" type="Button" parent="ChatPanel/RootVBox/TabBar"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
flat = true
|
||||
text = "Lobby"
|
||||
theme_override_font_sizes/font_size = 11
|
||||
|
||||
[node name="GameTabBtn" type="Button" parent="ChatPanel/RootVBox/TabBar"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
flat = true
|
||||
text = "Game"
|
||||
theme_override_font_sizes/font_size = 11
|
||||
|
||||
[node name="PartyTabBtn" type="Button" parent="ChatPanel/RootVBox/TabBar"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
flat = true
|
||||
text = "Party"
|
||||
theme_override_font_sizes/font_size = 11
|
||||
|
||||
[node name="DmsTabBtn" type="Button" parent="ChatPanel/RootVBox/TabBar"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
flat = true
|
||||
text = "DMs"
|
||||
theme_override_font_sizes/font_size = 11
|
||||
|
||||
[node name="TabSep" type="HSeparator" parent="ChatPanel/RootVBox"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ContentArea" type="Control" parent="ChatPanel/RootVBox"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="FriendsPane" type="VBoxContainer" parent="ChatPanel/RootVBox/ContentArea"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
visible = false
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="RequestsSection" type="VBoxContainer" parent="ChatPanel/RootVBox/ContentArea/FriendsPane"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
visible = false
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="ReqMargin" type="MarginContainer" parent="ChatPanel/RootVBox/ContentArea/FriendsPane/RequestsSection"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 10
|
||||
theme_override_constants/margin_top = 6
|
||||
theme_override_constants/margin_bottom = 2
|
||||
|
||||
[node name="ReqHeader" type="Label" parent="ChatPanel/RootVBox/ContentArea/FriendsPane/RequestsSection/ReqMargin"]
|
||||
layout_mode = 2
|
||||
text = "FRIEND REQUESTS"
|
||||
modulate = Color(0.52, 0.52, 0.58, 1)
|
||||
theme_override_font_sizes/font_size = 10
|
||||
|
||||
[node name="RequestsList" type="VBoxContainer" parent="ChatPanel/RootVBox/ContentArea/FriendsPane/RequestsSection"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="ReqSep" type="HSeparator" parent="ChatPanel/RootVBox/ContentArea/FriendsPane/RequestsSection"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="FriendsScroll" type="ScrollContainer" parent="ChatPanel/RootVBox/ContentArea/FriendsPane"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="FriendsList" type="VBoxContainer" parent="ChatPanel/RootVBox/ContentArea/FriendsPane/FriendsScroll"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="PresencePane" type="VBoxContainer" parent="ChatPanel/RootVBox/ContentArea"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
visible = false
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="StatusMargin" type="MarginContainer" parent="ChatPanel/RootVBox/ContentArea/PresencePane"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 12
|
||||
theme_override_constants/margin_right = 12
|
||||
theme_override_constants/margin_top = 8
|
||||
theme_override_constants/margin_bottom = 8
|
||||
|
||||
[node name="StatusHBox" type="HBoxContainer" parent="ChatPanel/RootVBox/ContentArea/PresencePane/StatusMargin"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 4
|
||||
theme_override_constants/separation = 8
|
||||
|
||||
[node name="StatusLabel" type="Label" parent="ChatPanel/RootVBox/ContentArea/PresencePane/StatusMargin/StatusHBox"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "My Status:"
|
||||
theme_override_font_sizes/font_size = 13
|
||||
|
||||
[node name="PresenceOption" type="OptionButton" parent="ChatPanel/RootVBox/ContentArea/PresencePane/StatusMargin/StatusHBox"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 12
|
||||
|
||||
[node name="PresenceSep" type="HSeparator" parent="ChatPanel/RootVBox/ContentArea/PresencePane"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="PresenceHeaderMargin" type="MarginContainer" parent="ChatPanel/RootVBox/ContentArea/PresencePane"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 10
|
||||
theme_override_constants/margin_top = 6
|
||||
theme_override_constants/margin_bottom = 2
|
||||
|
||||
[node name="PresenceHeaderLabel" type="Label" parent="ChatPanel/RootVBox/ContentArea/PresencePane/PresenceHeaderMargin"]
|
||||
layout_mode = 2
|
||||
text = "FRIENDS PRESENCE"
|
||||
modulate = Color(0.52, 0.52, 0.58, 1)
|
||||
theme_override_font_sizes/font_size = 10
|
||||
|
||||
[node name="PresenceScroll" type="ScrollContainer" parent="ChatPanel/RootVBox/ContentArea/PresencePane"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="PresenceList" type="VBoxContainer" parent="ChatPanel/RootVBox/ContentArea/PresencePane/PresenceScroll"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="GlobalPane" type="VBoxContainer" parent="ChatPanel/RootVBox/ContentArea"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
visible = false
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="GlobalScroll" type="ScrollContainer" parent="ChatPanel/RootVBox/ContentArea/GlobalPane"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="GlobalMargin" type="MarginContainer" parent="ChatPanel/RootVBox/ContentArea/GlobalPane/GlobalScroll"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_top = 4
|
||||
theme_override_constants/margin_bottom = 4
|
||||
|
||||
[node name="GlobalList" type="VBoxContainer" parent="ChatPanel/RootVBox/ContentArea/GlobalPane/GlobalScroll/GlobalMargin"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 2
|
||||
|
||||
[node name="LobbyPane" type="VBoxContainer" parent="ChatPanel/RootVBox/ContentArea"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
visible = false
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="LobbyScroll" type="ScrollContainer" parent="ChatPanel/RootVBox/ContentArea/LobbyPane"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="LobbyMargin" type="MarginContainer" parent="ChatPanel/RootVBox/ContentArea/LobbyPane/LobbyScroll"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_top = 4
|
||||
theme_override_constants/margin_bottom = 4
|
||||
|
||||
[node name="LobbyList" type="VBoxContainer" parent="ChatPanel/RootVBox/ContentArea/LobbyPane/LobbyScroll/LobbyMargin"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 2
|
||||
|
||||
[node name="GamePane" type="VBoxContainer" parent="ChatPanel/RootVBox/ContentArea"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
visible = false
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="GameScroll" type="ScrollContainer" parent="ChatPanel/RootVBox/ContentArea/GamePane"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="GameMargin" type="MarginContainer" parent="ChatPanel/RootVBox/ContentArea/GamePane/GameScroll"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_top = 4
|
||||
theme_override_constants/margin_bottom = 4
|
||||
|
||||
[node name="GameList" type="VBoxContainer" parent="ChatPanel/RootVBox/ContentArea/GamePane/GameScroll/GameMargin"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 2
|
||||
|
||||
[node name="PartyPane" type="VBoxContainer" parent="ChatPanel/RootVBox/ContentArea"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
visible = false
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="PartyActionBar" type="HBoxContainer" parent="ChatPanel/RootVBox/ContentArea/PartyPane"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
visible = false
|
||||
theme_override_constants/separation = 4
|
||||
|
||||
[node name="PartyActionMargin" type="MarginContainer" parent="ChatPanel/RootVBox/ContentArea/PartyPane/PartyActionBar"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_top = 4
|
||||
theme_override_constants/margin_bottom = 4
|
||||
|
||||
[node name="PartyActionInner" type="HBoxContainer" parent="ChatPanel/RootVBox/ContentArea/PartyPane/PartyActionBar/PartyActionMargin"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 6
|
||||
|
||||
[node name="PartyNameLabel" type="Label" parent="ChatPanel/RootVBox/ContentArea/PartyPane/PartyActionBar/PartyActionMargin/PartyActionInner"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Party"
|
||||
modulate = Color(0.42, 1.0, 0.58, 1)
|
||||
theme_override_font_sizes/font_size = 12
|
||||
|
||||
[node name="RenameBtn" type="Button" parent="ChatPanel/RootVBox/ContentArea/PartyPane/PartyActionBar/PartyActionMargin/PartyActionInner"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
flat = true
|
||||
text = "Rename"
|
||||
theme_override_font_sizes/font_size = 11
|
||||
|
||||
[node name="LeaveBtn" type="Button" parent="ChatPanel/RootVBox/ContentArea/PartyPane/PartyActionBar/PartyActionMargin/PartyActionInner"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
flat = true
|
||||
text = "Leave"
|
||||
modulate = Color(1.0, 0.38, 0.38, 1)
|
||||
theme_override_font_sizes/font_size = 11
|
||||
|
||||
[node name="PartyActionSep" type="HSeparator" parent="ChatPanel/RootVBox/ContentArea/PartyPane"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="PartyScroll" type="ScrollContainer" parent="ChatPanel/RootVBox/ContentArea/PartyPane"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="PartyMargin" type="MarginContainer" parent="ChatPanel/RootVBox/ContentArea/PartyPane/PartyScroll"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_top = 4
|
||||
theme_override_constants/margin_bottom = 4
|
||||
|
||||
[node name="PartyList" type="VBoxContainer" parent="ChatPanel/RootVBox/ContentArea/PartyPane/PartyScroll/PartyMargin"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 2
|
||||
|
||||
[node name="DmsPane" type="HBoxContainer" parent="ChatPanel/RootVBox/ContentArea"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
visible = false
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="DmConvArea" type="VBoxContainer" parent="ChatPanel/RootVBox/ContentArea/DmsPane"]
|
||||
layout_mode = 2
|
||||
custom_minimum_size = Vector2(110, 0)
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="DmConvScroll" type="ScrollContainer" parent="ChatPanel/RootVBox/ContentArea/DmsPane/DmConvArea"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="DmConvList" type="VBoxContainer" parent="ChatPanel/RootVBox/ContentArea/DmsPane/DmConvArea/DmConvScroll"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="DmVSep" type="VSeparator" parent="ChatPanel/RootVBox/ContentArea/DmsPane"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="DmMsgArea" type="VBoxContainer" parent="ChatPanel/RootVBox/ContentArea/DmsPane"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="DmMsgScroll" type="ScrollContainer" parent="ChatPanel/RootVBox/ContentArea/DmsPane/DmMsgArea"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="DmMsgMargin" type="MarginContainer" parent="ChatPanel/RootVBox/ContentArea/DmsPane/DmMsgArea/DmMsgScroll"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_top = 4
|
||||
theme_override_constants/margin_bottom = 4
|
||||
|
||||
[node name="DmMsgList" type="VBoxContainer" parent="ChatPanel/RootVBox/ContentArea/DmsPane/DmMsgArea/DmMsgScroll/DmMsgMargin"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 2
|
||||
|
||||
[node name="InputSep" type="HSeparator" parent="ChatPanel/RootVBox"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="InputBar" type="HBoxContainer" parent="ChatPanel/RootVBox"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
visible = false
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="InputMargin" type="MarginContainer" parent="ChatPanel/RootVBox/InputBar"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_top = 6
|
||||
theme_override_constants/margin_bottom = 6
|
||||
|
||||
[node name="InputInner" type="HBoxContainer" parent="ChatPanel/RootVBox/InputBar/InputMargin"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 6
|
||||
|
||||
[node name="MessageInput" type="LineEdit" parent="ChatPanel/RootVBox/InputBar/InputMargin/InputInner"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
placeholder_text = "Type a message..."
|
||||
max_length = 500
|
||||
theme_override_font_sizes/font_size = 13
|
||||
|
||||
[node name="SendBtn" type="Button" parent="ChatPanel/RootVBox/InputBar/InputMargin/InputInner"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
custom_minimum_size = Vector2(52, 0)
|
||||
text = "Send"
|
||||
theme_override_font_sizes/font_size = 12
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
extends CanvasLayer
|
||||
## Chat overlay — persists across all scenes as a child of the viewport root.
|
||||
##
|
||||
## Structure (built programmatically in _build_panel):
|
||||
## Structure (defined in ChatOverlay.tscn):
|
||||
## ChatBubble (Button, bottom-right) — toggles the panel
|
||||
## ChatPanel (PanelContainer)
|
||||
## VBox
|
||||
## RootVBox
|
||||
## Header — title + close button
|
||||
## TabBar — Friends | Presence | Global | Lobby | Game | DMs
|
||||
## ContentArea — one VBox per tab, only active one is visible
|
||||
## TabBar — Friends | Presence | Global | Lobby | Game | Party | DMs
|
||||
## ContentArea — one pane per tab, only active one is visible
|
||||
## InputBar — LineEdit + Send (hidden on Friends/Presence tabs)
|
||||
##
|
||||
## Message row format: [HH:MM] [source] SenderName: message text
|
||||
@@ -45,31 +45,29 @@ const SOURCE_COLORS := {
|
||||
@onready var _badge : Label = $ChatBubble/BadgeLabel
|
||||
@onready var _panel : PanelContainer = $ChatPanel
|
||||
|
||||
# ── Built programmatically ────────────────────────────────────────────────────
|
||||
@onready var _input_bar : HBoxContainer = %InputBar
|
||||
@onready var _message_input : LineEdit = %MessageInput
|
||||
|
||||
# Per-tab content refs
|
||||
@onready var _friends_list : VBoxContainer = %FriendsList
|
||||
@onready var _requests_section : VBoxContainer = %RequestsSection
|
||||
@onready var _requests_list : VBoxContainer = %RequestsList
|
||||
@onready var _presence_list : VBoxContainer = %PresenceList
|
||||
@onready var _presence_option : OptionButton = %PresenceOption
|
||||
@onready var _global_list : VBoxContainer = %GlobalList
|
||||
@onready var _lobby_list : VBoxContainer = %LobbyList
|
||||
@onready var _game_list : VBoxContainer = %GameList
|
||||
@onready var _dm_conv_list : VBoxContainer = %DmConvList
|
||||
@onready var _dm_msg_list : VBoxContainer = %DmMsgList
|
||||
@onready var _party_msg_list : VBoxContainer = %PartyList
|
||||
@onready var _party_action_bar : HBoxContainer = %PartyActionBar
|
||||
@onready var _party_name_lbl : Label = %PartyNameLabel
|
||||
|
||||
# ── State ─────────────────────────────────────────────────────────────────────
|
||||
|
||||
var _tab_buttons : Array[Button] = []
|
||||
var _content_nodes : Array[Control] = [] # one entry per Tab enum value
|
||||
|
||||
var _input_bar : HBoxContainer = null
|
||||
var _message_input : LineEdit = null
|
||||
var _send_button : Button = null
|
||||
|
||||
# Per-tab content refs
|
||||
var _friends_list : VBoxContainer = null
|
||||
var _requests_section : Control = null
|
||||
var _requests_list : VBoxContainer = null
|
||||
var _presence_list : VBoxContainer = null
|
||||
var _presence_option : OptionButton = null
|
||||
var _global_list : VBoxContainer = null
|
||||
var _lobby_list : VBoxContainer = null
|
||||
var _game_list : VBoxContainer = null
|
||||
var _dm_conv_list : VBoxContainer = null
|
||||
var _dm_msg_list : VBoxContainer = null
|
||||
var _party_msg_list : VBoxContainer = null
|
||||
var _party_action_bar : HBoxContainer = null
|
||||
|
||||
# ── State ─────────────────────────────────────────────────────────────────────
|
||||
|
||||
var _current_tab : Tab = Tab.GLOBAL
|
||||
var _active_channel : String = "" # channel_id used by the input bar
|
||||
var _active_dm : String = "" # channel_id of the open DM conversation
|
||||
@@ -80,10 +78,35 @@ var _muted : Dictionary = {} # account_id → true
|
||||
# ── Lifecycle ─────────────────────────────────────────────────────────────────
|
||||
|
||||
func _ready() -> void:
|
||||
_build_panel()
|
||||
# Populate tab button array from scene TabBar children (order matches Tab enum).
|
||||
for btn in %TabBar.get_children():
|
||||
_tab_buttons.append(btn as Button)
|
||||
for i in _tab_buttons.size():
|
||||
var idx := i
|
||||
_tab_buttons[i].pressed.connect(func() -> void: _show_tab(idx as Tab))
|
||||
|
||||
# Populate content pane array from scene ContentArea children (order matches Tab enum).
|
||||
for pane in %ContentArea.get_children():
|
||||
_content_nodes.append(pane as Control)
|
||||
|
||||
# Wire scene node signals.
|
||||
%CloseBtn.pressed.connect(func() -> void: _panel.visible = false)
|
||||
%RenameBtn.pressed.connect(_on_party_rename_pressed)
|
||||
%LeaveBtn.pressed.connect(_on_party_leave_pressed)
|
||||
%SendBtn.pressed.connect(_send_current_input)
|
||||
_message_input.text_submitted.connect(func(_text: String) -> void: _send_current_input())
|
||||
|
||||
# Populate presence option items.
|
||||
_presence_option.add_item("● Online", 0)
|
||||
_presence_option.add_item("◐ Away", 1)
|
||||
_presence_option.add_item("○ Offline", 2)
|
||||
_presence_option.selected = 0
|
||||
_presence_option.item_selected.connect(_on_own_presence_changed)
|
||||
|
||||
_style_bubble()
|
||||
_connect_chat_signals()
|
||||
_bubble.pressed.connect(_toggle_panel)
|
||||
_show_tab(Tab.GLOBAL)
|
||||
|
||||
|
||||
func _connect_chat_signals() -> void:
|
||||
@@ -119,123 +142,6 @@ func _style_bubble() -> void:
|
||||
badge_style.corner_radius_bottom_right = 6
|
||||
_badge.add_theme_stylebox_override("normal", badge_style)
|
||||
|
||||
# ── Build panel ───────────────────────────────────────────────────────────────
|
||||
|
||||
func _build_panel() -> void:
|
||||
var root_vbox := VBoxContainer.new()
|
||||
root_vbox.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||
root_vbox.add_theme_constant_override("separation", 0)
|
||||
_panel.add_child(root_vbox)
|
||||
|
||||
root_vbox.add_child(_make_header())
|
||||
root_vbox.add_child(_make_tab_bar())
|
||||
root_vbox.add_child(_make_separator())
|
||||
|
||||
# Content area — child controls fill it; only one is visible at a time.
|
||||
var content_area := Control.new()
|
||||
content_area.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
root_vbox.add_child(content_area)
|
||||
|
||||
for i in TAB_LABELS.size():
|
||||
var tab_node := _build_tab_content(i as Tab)
|
||||
tab_node.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||
tab_node.visible = false
|
||||
content_area.add_child(tab_node)
|
||||
_content_nodes.append(tab_node)
|
||||
|
||||
root_vbox.add_child(_make_separator())
|
||||
root_vbox.add_child(_make_input_bar())
|
||||
|
||||
_show_tab(Tab.GLOBAL)
|
||||
|
||||
|
||||
func _make_separator() -> HSeparator:
|
||||
return HSeparator.new()
|
||||
|
||||
|
||||
func _make_header() -> Control:
|
||||
var margin := MarginContainer.new()
|
||||
margin.add_theme_constant_override("margin_left", 12)
|
||||
margin.add_theme_constant_override("margin_right", 8)
|
||||
margin.add_theme_constant_override("margin_top", 6)
|
||||
margin.add_theme_constant_override("margin_bottom", 6)
|
||||
|
||||
var hbox := HBoxContainer.new()
|
||||
hbox.add_theme_constant_override("separation", 8)
|
||||
hbox.size_flags_vertical = Control.SIZE_SHRINK_CENTER
|
||||
margin.add_child(hbox)
|
||||
|
||||
var title := Label.new()
|
||||
title.text = "Chat"
|
||||
title.add_theme_font_size_override("font_size", 15)
|
||||
title.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
hbox.add_child(title)
|
||||
|
||||
var close_btn := Button.new()
|
||||
close_btn.text = "✕"
|
||||
close_btn.flat = true
|
||||
close_btn.add_theme_font_size_override("font_size", 14)
|
||||
close_btn.pressed.connect(func() -> void: _panel.visible = false)
|
||||
hbox.add_child(close_btn)
|
||||
|
||||
return margin
|
||||
|
||||
|
||||
func _make_tab_bar() -> Control:
|
||||
var hbox := HBoxContainer.new()
|
||||
hbox.add_theme_constant_override("separation", 0)
|
||||
hbox.custom_minimum_size = Vector2(0, 28)
|
||||
|
||||
for i in TAB_LABELS.size():
|
||||
var btn := Button.new()
|
||||
btn.text = TAB_LABELS[i]
|
||||
btn.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
btn.flat = true
|
||||
btn.add_theme_font_size_override("font_size", 11)
|
||||
var idx := i
|
||||
btn.pressed.connect(func() -> void: _show_tab(idx as Tab))
|
||||
_tab_buttons.append(btn)
|
||||
hbox.add_child(btn)
|
||||
|
||||
return hbox
|
||||
|
||||
|
||||
func _make_input_bar() -> Control:
|
||||
_input_bar = HBoxContainer.new()
|
||||
_input_bar.add_theme_constant_override("separation", 0)
|
||||
_input_bar.visible = false
|
||||
|
||||
var margin := MarginContainer.new()
|
||||
margin.add_theme_constant_override("margin_left", 8)
|
||||
margin.add_theme_constant_override("margin_right", 8)
|
||||
margin.add_theme_constant_override("margin_top", 6)
|
||||
margin.add_theme_constant_override("margin_bottom", 6)
|
||||
margin.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
_input_bar.add_child(margin)
|
||||
|
||||
var inner := HBoxContainer.new()
|
||||
inner.add_theme_constant_override("separation", 6)
|
||||
inner.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
margin.add_child(inner)
|
||||
|
||||
_message_input = LineEdit.new()
|
||||
_message_input.placeholder_text = "Type a message..."
|
||||
_message_input.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
_message_input.add_theme_font_size_override("font_size", 13)
|
||||
_message_input.max_length = 500
|
||||
_message_input.text_submitted.connect(func(_text: String) -> void:
|
||||
_send_current_input())
|
||||
inner.add_child(_message_input)
|
||||
|
||||
_send_button = Button.new()
|
||||
_send_button.text = "Send"
|
||||
_send_button.custom_minimum_size = Vector2(52, 0)
|
||||
_send_button.add_theme_font_size_override("font_size", 12)
|
||||
_send_button.pressed.connect(_send_current_input)
|
||||
inner.add_child(_send_button)
|
||||
|
||||
return _input_bar
|
||||
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if not _panel.visible or not _input_bar.visible:
|
||||
@@ -248,267 +154,6 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||
and (key.keycode == KEY_ENTER or key.keycode == KEY_KP_ENTER):
|
||||
_send_current_input()
|
||||
get_viewport().set_input_as_handled()
|
||||
# ── Tab builders ──────────────────────────────────────────────────────────────
|
||||
|
||||
func _build_tab_content(tab: Tab) -> Control:
|
||||
match tab:
|
||||
Tab.FRIENDS: return _build_friends_tab()
|
||||
Tab.PRESENCE: return _build_presence_tab()
|
||||
Tab.GLOBAL: return _build_channel_tab(Tab.GLOBAL)
|
||||
Tab.LOBBY: return _build_channel_tab(Tab.LOBBY)
|
||||
Tab.GAME: return _build_channel_tab(Tab.GAME)
|
||||
Tab.PARTY: return _build_party_tab()
|
||||
Tab.DMS: return _build_dms_tab()
|
||||
return Control.new()
|
||||
|
||||
|
||||
func _build_friends_tab() -> Control:
|
||||
var vbox := VBoxContainer.new()
|
||||
vbox.add_theme_constant_override("separation", 0)
|
||||
|
||||
# ── Pending requests (hidden when empty) ──────────────────────────────────
|
||||
_requests_section = VBoxContainer.new()
|
||||
_requests_section.visible = false
|
||||
vbox.add_child(_requests_section)
|
||||
|
||||
var req_margin := MarginContainer.new()
|
||||
req_margin.add_theme_constant_override("margin_left", 10)
|
||||
req_margin.add_theme_constant_override("margin_top", 6)
|
||||
req_margin.add_theme_constant_override("margin_bottom", 2)
|
||||
_requests_section.add_child(req_margin)
|
||||
|
||||
var req_header := Label.new()
|
||||
req_header.text = "FRIEND REQUESTS"
|
||||
req_header.add_theme_color_override("font_color", MUTED_COLOR)
|
||||
req_header.add_theme_font_size_override("font_size", 10)
|
||||
req_margin.add_child(req_header)
|
||||
|
||||
_requests_list = VBoxContainer.new()
|
||||
_requests_list.add_theme_constant_override("separation", 0)
|
||||
_requests_section.add_child(_requests_list)
|
||||
|
||||
_requests_section.add_child(_make_separator())
|
||||
|
||||
# ── Friends scroll ────────────────────────────────────────────────────────
|
||||
var scroll := ScrollContainer.new()
|
||||
scroll.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
scroll.horizontal_scroll_mode = ScrollContainer.SCROLL_MODE_DISABLED
|
||||
vbox.add_child(scroll)
|
||||
|
||||
_friends_list = VBoxContainer.new()
|
||||
_friends_list.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
_friends_list.add_theme_constant_override("separation", 0)
|
||||
scroll.add_child(_friends_list)
|
||||
|
||||
return vbox
|
||||
|
||||
|
||||
func _build_presence_tab() -> Control:
|
||||
var vbox := VBoxContainer.new()
|
||||
vbox.add_theme_constant_override("separation", 0)
|
||||
|
||||
# ── Own status selector ───────────────────────────────────────────────────
|
||||
var sm := MarginContainer.new()
|
||||
sm.add_theme_constant_override("margin_left", 12)
|
||||
sm.add_theme_constant_override("margin_right", 12)
|
||||
sm.add_theme_constant_override("margin_top", 8)
|
||||
sm.add_theme_constant_override("margin_bottom", 8)
|
||||
vbox.add_child(sm)
|
||||
|
||||
var shbox := HBoxContainer.new()
|
||||
shbox.add_theme_constant_override("separation", 8)
|
||||
shbox.size_flags_vertical = Control.SIZE_SHRINK_CENTER
|
||||
sm.add_child(shbox)
|
||||
|
||||
var slbl := Label.new()
|
||||
slbl.text = "My Status:"
|
||||
slbl.add_theme_font_size_override("font_size", 13)
|
||||
slbl.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
shbox.add_child(slbl)
|
||||
|
||||
_presence_option = OptionButton.new()
|
||||
_presence_option.add_item("● Online", 0)
|
||||
_presence_option.add_item("◐ Away", 1)
|
||||
_presence_option.add_item("○ Offline", 2)
|
||||
_presence_option.selected = 0
|
||||
_presence_option.add_theme_font_size_override("font_size", 12)
|
||||
_presence_option.item_selected.connect(_on_own_presence_changed)
|
||||
shbox.add_child(_presence_option)
|
||||
|
||||
vbox.add_child(_make_separator())
|
||||
|
||||
# ── Online friends list ───────────────────────────────────────────────────
|
||||
var lm := MarginContainer.new()
|
||||
lm.add_theme_constant_override("margin_left", 10)
|
||||
lm.add_theme_constant_override("margin_top", 6)
|
||||
lm.add_theme_constant_override("margin_bottom", 2)
|
||||
vbox.add_child(lm)
|
||||
|
||||
var llbl := Label.new()
|
||||
llbl.text = "FRIENDS PRESENCE"
|
||||
llbl.add_theme_color_override("font_color", MUTED_COLOR)
|
||||
llbl.add_theme_font_size_override("font_size", 10)
|
||||
lm.add_child(llbl)
|
||||
|
||||
var scroll := ScrollContainer.new()
|
||||
scroll.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
scroll.horizontal_scroll_mode = ScrollContainer.SCROLL_MODE_DISABLED
|
||||
vbox.add_child(scroll)
|
||||
|
||||
_presence_list = VBoxContainer.new()
|
||||
_presence_list.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
_presence_list.add_theme_constant_override("separation", 0)
|
||||
scroll.add_child(_presence_list)
|
||||
|
||||
return vbox
|
||||
|
||||
|
||||
func _build_channel_tab(tab: Tab) -> Control:
|
||||
var vbox := VBoxContainer.new()
|
||||
vbox.add_theme_constant_override("separation", 0)
|
||||
|
||||
var scroll := ScrollContainer.new()
|
||||
scroll.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
scroll.horizontal_scroll_mode = ScrollContainer.SCROLL_MODE_DISABLED
|
||||
vbox.add_child(scroll)
|
||||
|
||||
var outer_margin := MarginContainer.new()
|
||||
outer_margin.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
outer_margin.add_theme_constant_override("margin_left", 8)
|
||||
outer_margin.add_theme_constant_override("margin_right", 8)
|
||||
outer_margin.add_theme_constant_override("margin_top", 4)
|
||||
outer_margin.add_theme_constant_override("margin_bottom", 4)
|
||||
scroll.add_child(outer_margin)
|
||||
|
||||
var msg_list := VBoxContainer.new()
|
||||
msg_list.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
msg_list.add_theme_constant_override("separation", 2)
|
||||
outer_margin.add_child(msg_list)
|
||||
|
||||
match tab:
|
||||
Tab.GLOBAL: _global_list = msg_list
|
||||
Tab.LOBBY: _lobby_list = msg_list
|
||||
Tab.GAME: _game_list = msg_list
|
||||
|
||||
return vbox
|
||||
|
||||
|
||||
func _build_dms_tab() -> Control:
|
||||
var hbox := HBoxContainer.new()
|
||||
hbox.add_theme_constant_override("separation", 0)
|
||||
|
||||
# ── Left: conversation list ───────────────────────────────────────────────
|
||||
var left_vbox := VBoxContainer.new()
|
||||
left_vbox.custom_minimum_size = Vector2(110, 0)
|
||||
left_vbox.add_theme_constant_override("separation", 0)
|
||||
hbox.add_child(left_vbox)
|
||||
|
||||
var conv_scroll := ScrollContainer.new()
|
||||
conv_scroll.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
conv_scroll.horizontal_scroll_mode = ScrollContainer.SCROLL_MODE_DISABLED
|
||||
left_vbox.add_child(conv_scroll)
|
||||
|
||||
_dm_conv_list = VBoxContainer.new()
|
||||
_dm_conv_list.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
_dm_conv_list.add_theme_constant_override("separation", 0)
|
||||
conv_scroll.add_child(_dm_conv_list)
|
||||
|
||||
# ── Vertical divider ──────────────────────────────────────────────────────
|
||||
hbox.add_child(VSeparator.new())
|
||||
|
||||
# ── Right: message area ───────────────────────────────────────────────────
|
||||
var right_vbox := VBoxContainer.new()
|
||||
right_vbox.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
right_vbox.add_theme_constant_override("separation", 0)
|
||||
hbox.add_child(right_vbox)
|
||||
|
||||
var msg_scroll := ScrollContainer.new()
|
||||
msg_scroll.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
msg_scroll.horizontal_scroll_mode = ScrollContainer.SCROLL_MODE_DISABLED
|
||||
right_vbox.add_child(msg_scroll)
|
||||
|
||||
var msg_margin := MarginContainer.new()
|
||||
msg_margin.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
msg_margin.add_theme_constant_override("margin_left", 8)
|
||||
msg_margin.add_theme_constant_override("margin_right", 8)
|
||||
msg_margin.add_theme_constant_override("margin_top", 4)
|
||||
msg_margin.add_theme_constant_override("margin_bottom", 4)
|
||||
msg_scroll.add_child(msg_margin)
|
||||
|
||||
_dm_msg_list = VBoxContainer.new()
|
||||
_dm_msg_list.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
_dm_msg_list.add_theme_constant_override("separation", 2)
|
||||
msg_margin.add_child(_dm_msg_list)
|
||||
|
||||
return hbox
|
||||
|
||||
func _build_party_tab() -> Control:
|
||||
var vbox := VBoxContainer.new()
|
||||
vbox.add_theme_constant_override("separation", 0)
|
||||
|
||||
# ── Action bar (Leave / Invite) ───────────────────────────────────────────
|
||||
_party_action_bar = HBoxContainer.new()
|
||||
_party_action_bar.add_theme_constant_override("separation", 4)
|
||||
_party_action_bar.visible = false
|
||||
|
||||
var abm := MarginContainer.new()
|
||||
abm.add_theme_constant_override("margin_left", 8)
|
||||
abm.add_theme_constant_override("margin_right", 8)
|
||||
abm.add_theme_constant_override("margin_top", 4)
|
||||
abm.add_theme_constant_override("margin_bottom", 4)
|
||||
abm.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
_party_action_bar.add_child(abm)
|
||||
|
||||
var ab_inner := HBoxContainer.new()
|
||||
ab_inner.add_theme_constant_override("separation", 6)
|
||||
abm.add_child(ab_inner)
|
||||
|
||||
var party_name_lbl := Label.new()
|
||||
party_name_lbl.name = "PartyNameLabel"
|
||||
party_name_lbl.text = "Party"
|
||||
party_name_lbl.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
party_name_lbl.add_theme_font_size_override("font_size", 12)
|
||||
party_name_lbl.add_theme_color_override("font_color", SOURCE_COLORS["party"])
|
||||
ab_inner.add_child(party_name_lbl)
|
||||
|
||||
var rename_btn := Button.new()
|
||||
rename_btn.text = "Rename"
|
||||
rename_btn.add_theme_font_size_override("font_size", 11)
|
||||
rename_btn.flat = true
|
||||
rename_btn.pressed.connect(_on_party_rename_pressed)
|
||||
ab_inner.add_child(rename_btn)
|
||||
|
||||
var leave_btn := Button.new()
|
||||
leave_btn.text = "Leave"
|
||||
leave_btn.add_theme_color_override("font_color", DANGER_COLOR)
|
||||
leave_btn.add_theme_font_size_override("font_size", 11)
|
||||
leave_btn.flat = true
|
||||
leave_btn.pressed.connect(_on_party_leave_pressed)
|
||||
ab_inner.add_child(leave_btn)
|
||||
|
||||
vbox.add_child(_party_action_bar)
|
||||
vbox.add_child(_make_separator())
|
||||
|
||||
# ── Message area ──────────────────────────────────────────────────────────
|
||||
var scroll := ScrollContainer.new()
|
||||
scroll.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
scroll.horizontal_scroll_mode = ScrollContainer.SCROLL_MODE_DISABLED
|
||||
vbox.add_child(scroll)
|
||||
|
||||
var outer_margin := MarginContainer.new()
|
||||
outer_margin.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
outer_margin.add_theme_constant_override("margin_left", 8)
|
||||
outer_margin.add_theme_constant_override("margin_right", 8)
|
||||
outer_margin.add_theme_constant_override("margin_top", 4)
|
||||
outer_margin.add_theme_constant_override("margin_bottom", 4)
|
||||
scroll.add_child(outer_margin)
|
||||
|
||||
_party_msg_list = VBoxContainer.new()
|
||||
_party_msg_list.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
_party_msg_list.add_theme_constant_override("separation", 2)
|
||||
outer_margin.add_child(_party_msg_list)
|
||||
|
||||
return vbox
|
||||
|
||||
# ── Tab switching ─────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -736,7 +381,6 @@ func _refresh_presence() -> void:
|
||||
status_lbl.text = status
|
||||
status_lbl.add_theme_color_override("font_color", _presence_color(status))
|
||||
status_lbl.add_theme_font_size_override("font_size", 10)
|
||||
row.add_child(status_lbl)
|
||||
|
||||
var rm := MarginContainer.new()
|
||||
rm.add_theme_constant_override("margin_right", 10)
|
||||
@@ -878,12 +522,9 @@ func _refresh_party_tab() -> void:
|
||||
var party_chan := Chat.get_party_channel()
|
||||
var in_party := not party_chan.is_empty()
|
||||
|
||||
if is_instance_valid(_party_action_bar):
|
||||
_party_action_bar.visible = in_party
|
||||
if in_party:
|
||||
var name_lbl := _party_action_bar.find_child("PartyNameLabel", true, false) as Label
|
||||
if is_instance_valid(name_lbl):
|
||||
name_lbl.text = party_chan.get("name", "Party")
|
||||
_party_action_bar.visible = in_party
|
||||
if in_party:
|
||||
_party_name_lbl.text = party_chan.get("name", "Party")
|
||||
|
||||
_input_bar.visible = in_party
|
||||
if in_party:
|
||||
@@ -1297,5 +938,3 @@ func _make_section_label(text: String) -> Control:
|
||||
lbl.add_theme_font_size_override("font_size", 10)
|
||||
m.add_child(lbl)
|
||||
return m
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user