feat: 2.3.2
This commit is contained in:
@@ -10,7 +10,8 @@ signal closed
|
||||
@onready var star_tab_btn := %StarTabBtn as Button
|
||||
@onready var gold_tab_btn := %GoldTabBtn as Button
|
||||
@onready var banner_label := %BannerLabel as Label
|
||||
@onready var balance_label := %BalanceLabel as Label
|
||||
@onready var gold_label := %GoldLabel as Label
|
||||
@onready var star_label := %StarLabel as Label
|
||||
@onready var pity_label := %PityLabel as Label
|
||||
@onready var pull_1_btn := %Pull1Btn as Button
|
||||
@onready var pull_10_btn := %Pull10Btn as Button
|
||||
@@ -88,8 +89,40 @@ func _ensure_dummy_wallet() -> void:
|
||||
# ─── Banner switching ─────────────────────────────────────────────────────────
|
||||
func _switch_banner(id: String) -> void:
|
||||
_current_banner = id
|
||||
star_tab_btn.modulate = Color(1.3, 1.1, 0.3) if id == "star" else Color.WHITE
|
||||
gold_tab_btn.modulate = Color(1.3, 1.1, 0.3) if id == "gold" else Color.WHITE
|
||||
|
||||
# Create active tab style (dark blue)
|
||||
var active_style := StyleBoxFlat.new()
|
||||
active_style.bg_color = Color(0.1, 0.19, 0.27, 1)
|
||||
active_style.content_margin_left = 16.0
|
||||
active_style.content_margin_top = 14.0
|
||||
active_style.content_margin_right = 16.0
|
||||
active_style.content_margin_bottom = 14.0
|
||||
active_style.corner_radius_top_left = 8
|
||||
active_style.corner_radius_top_right = 8
|
||||
active_style.corner_radius_bottom_right = 8
|
||||
active_style.corner_radius_bottom_left = 8
|
||||
|
||||
# Create inactive tab style (cyan)
|
||||
var inactive_style := StyleBoxFlat.new()
|
||||
inactive_style.bg_color = Color(0.33, 0.62, 0.78, 1)
|
||||
inactive_style.content_margin_left = 16.0
|
||||
inactive_style.content_margin_top = 14.0
|
||||
inactive_style.content_margin_right = 16.0
|
||||
inactive_style.content_margin_bottom = 14.0
|
||||
inactive_style.corner_radius_top_left = 8
|
||||
inactive_style.corner_radius_top_right = 8
|
||||
inactive_style.corner_radius_bottom_right = 8
|
||||
inactive_style.corner_radius_bottom_left = 8
|
||||
|
||||
# Apply styles
|
||||
star_tab_btn.add_theme_stylebox_override("normal", active_style if id == "star" else inactive_style)
|
||||
star_tab_btn.add_theme_stylebox_override("hover", active_style if id == "star" else inactive_style)
|
||||
star_tab_btn.add_theme_stylebox_override("pressed", active_style if id == "star" else inactive_style)
|
||||
|
||||
gold_tab_btn.add_theme_stylebox_override("normal", active_style if id == "gold" else inactive_style)
|
||||
gold_tab_btn.add_theme_stylebox_override("hover", active_style if id == "gold" else inactive_style)
|
||||
gold_tab_btn.add_theme_stylebox_override("pressed", active_style if id == "gold" else inactive_style)
|
||||
|
||||
_refresh_ui()
|
||||
|
||||
func _refresh_ui() -> void:
|
||||
@@ -107,7 +140,11 @@ func _refresh_ui() -> void:
|
||||
var rates: Dictionary = banner.get("rates", {})
|
||||
|
||||
banner_label.text = banner.get("name", "Banner")
|
||||
balance_label.text = "%s %d" % [icon, bal]
|
||||
|
||||
# Update both gold and star labels
|
||||
star_label.text = str(UserProfileManager.wallet.get("star", 0))
|
||||
gold_label.text = str(UserProfileManager.wallet.get("gold", 0))
|
||||
|
||||
pity_label.text = "Pity: %d / %d" % [pity, pity_at]
|
||||
cost_1_label.text = "%s %d" % [icon, c1]
|
||||
cost_10_label.text = "%s %d" % [icon, c10]
|
||||
|
||||
Reference in New Issue
Block a user