Updated TwitchUserInfo

Updated PanelContainer to use TabPanel stylebox variant.
Updated structure of Scene.
Added UserGames panel to the panel.
Updated code to handle clearing of other panels, if the chatter is null,
otherwise populate information in the other panels.
Added resized signal connect, to set the UserGames panel to an even
split between the lists of games, and the game info panels.
Ensure that TwitchUserInfo, UserPromo and UserGames are properly updates
with the correct information on becoming ready in the SceneTree.
This commit is contained in:
Mario Steele 2026-03-09 03:12:48 -05:00
parent f417151be4
commit fce33bfd31
2 changed files with 36 additions and 8 deletions

View file

@ -1,16 +1,32 @@
extends PanelContainer
@onready var user_games: UserGamesPanel = %UserGames
@onready var tui := %TwitchUserInfo
@onready var up := %UserPromo
var chatter: Chatter:
set(value):
chatter = value
if not value: return
if not tui: return
tui.populate_from_chatter(chatter)
if not up: return
up.chatter = value
if not value:
tui.clear()
up.chatter = value
user_games.clear()
return
if tui:
tui.populate_from_chatter(chatter)
if up:
up.chatter = value
if user_games:
user_games.chatter = value
func _ready() -> void:
tui.extra_expanding.connect(func(x): if x: up.visible = false)
tui.extra_expanded.connect(func(x): if not x: up.visible = true)
resized.connect(func():
var width := int(size.x / 2)
user_games.splitter.split_offsets[0] = width
)
tui.populate_from_chatter(chatter)
up.chatter = chatter
user_games.chatter = chatter

View file

@ -3,20 +3,32 @@
[ext_resource type="PackedScene" uid="uid://bk7elsy5s3equ" path="res://UI/Controls/twitch_user_info.tscn" id="1_bbob4"]
[ext_resource type="Script" uid="uid://bbyomfy4iqbq3" path="res://UI/Controls/internal_twitch_user_info.gd" id="1_l8fl7"]
[ext_resource type="PackedScene" uid="uid://cadil3rnqh61e" path="res://UI/Controls/user_promo.tscn" id="2_l8fl7"]
[ext_resource type="PackedScene" uid="uid://cojuxefo7cryj" path="res://UI/Controls/user_games.tscn" id="4_h7tf2"]
[node name="InternalTwitchUserInfo" type="PanelContainer" unique_id=1986869556]
offset_right = 1346.0
offset_bottom = 536.0
theme_type_variation = &"TabPanel"
script = ExtResource("1_l8fl7")
metadata/_tab_index = 0
[node name="HBoxContainer" type="HBoxContainer" parent="." unique_id=515716981]
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=92971307]
layout_mode = 2
[node name="TwitchUserInfo" parent="HBoxContainer" unique_id=1944732530 instance=ExtResource("1_bbob4")]
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer" unique_id=515716981]
layout_mode = 2
[node name="TwitchUserInfo" parent="VBoxContainer/HBoxContainer" unique_id=1944732530 instance=ExtResource("1_bbob4")]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 0
[node name="UserPromo" parent="HBoxContainer" unique_id=1364169576 instance=ExtResource("2_l8fl7")]
[node name="UserPromo" parent="VBoxContainer/HBoxContainer" unique_id=1364169576 instance=ExtResource("2_l8fl7")]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 1
[node name="UserGames" parent="VBoxContainer" unique_id=2022365407 instance=ExtResource("4_h7tf2")]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 3