feat: 2.3.2
This commit is contained in:
@@ -5,10 +5,12 @@ extends Control
|
||||
signal closed
|
||||
|
||||
# ─── Node refs ───────────────────────────────────────────────────────────────
|
||||
@onready var back_btn := %BackBtn as Button
|
||||
@onready var recipe_list := %RecipeList as VBoxContainer
|
||||
@onready var status_label := %StatusLabel as Label
|
||||
@onready var frag_balance := %FragBalance as Label
|
||||
@onready var back_btn := %BackBtn as Button
|
||||
@onready var recipe_list := %RecipeList as VBoxContainer
|
||||
@onready var status_label := %StatusLabel as Label
|
||||
@onready var common_label := %CommonLabel as Label
|
||||
@onready var uncommon_label := %UncommonLabel as Label
|
||||
@onready var rare_label := %RareLabel as Label
|
||||
|
||||
const FRAG_ICONS := {
|
||||
"frag_common": "⬜",
|
||||
@@ -31,12 +33,9 @@ func _refresh() -> void:
|
||||
# ─── Fragment balance header ──────────────────────────────────────────────────
|
||||
func _update_frag_balance() -> void:
|
||||
var frags: Dictionary = UserProfileManager.fragments
|
||||
var parts: Array = []
|
||||
for fid in ["frag_common", "frag_uncommon", "frag_rare"]:
|
||||
var icon: String = FRAG_ICONS.get(fid, "?")
|
||||
var count: int = frags.get(fid, 0)
|
||||
parts.append("%s ×%d" % [icon, count])
|
||||
frag_balance.text = " ".join(parts)
|
||||
common_label.text = str(frags.get("frag_common", 0))
|
||||
uncommon_label.text = str(frags.get("frag_uncommon", 0))
|
||||
rare_label.text = str(frags.get("frag_rare", 0))
|
||||
|
||||
# ─── Recipe cards ─────────────────────────────────────────────────────────────
|
||||
func _rebuild_recipe_list() -> void:
|
||||
@@ -55,6 +54,18 @@ func _make_recipe_card(recipe_id: String, recipe: Dictionary) -> PanelContainer:
|
||||
|
||||
var panel := PanelContainer.new()
|
||||
panel.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
|
||||
# Apply Tekton panel style
|
||||
var panel_style := StyleBoxFlat.new()
|
||||
panel_style.bg_color = Color(0.14117648, 0.16862746, 0.19215687, 1)
|
||||
panel_style.corner_radius_top_left = 12
|
||||
panel_style.corner_radius_top_right = 12
|
||||
panel_style.corner_radius_bottom_right = 12
|
||||
panel_style.corner_radius_bottom_left = 12
|
||||
panel_style.shadow_color = Color(0, 0, 0, 0.3529412)
|
||||
panel_style.shadow_size = 4
|
||||
panel_style.shadow_offset = Vector2(-2, 2)
|
||||
panel.add_theme_stylebox_override("panel", panel_style)
|
||||
|
||||
var margin := MarginContainer.new()
|
||||
margin.add_theme_constant_override("margin_left", 14)
|
||||
@@ -103,11 +114,20 @@ func _make_recipe_card(recipe_id: String, recipe: Dictionary) -> PanelContainer:
|
||||
Color(0.4, 1.0, 0.5) if have >= needed else Color(1.0, 0.4, 0.4))
|
||||
cost_hbox.add_child(cost_lbl)
|
||||
|
||||
# Craft button
|
||||
# Craft button with Tekton dark style
|
||||
var craft_btn := Button.new()
|
||||
craft_btn.text = "🔨 Craft"
|
||||
craft_btn.custom_minimum_size = Vector2(100, 40)
|
||||
craft_btn.disabled = not can_craft
|
||||
|
||||
var btn_style := StyleBoxFlat.new()
|
||||
btn_style.bg_color = Color(0.15, 0.15, 0.15, 1)
|
||||
btn_style.corner_radius_top_left = 8
|
||||
btn_style.corner_radius_top_right = 8
|
||||
btn_style.corner_radius_bottom_right = 8
|
||||
btn_style.corner_radius_bottom_left = 8
|
||||
craft_btn.add_theme_stylebox_override("normal", btn_style)
|
||||
|
||||
if not can_craft:
|
||||
craft_btn.modulate = Color(0.5, 0.5, 0.5, 0.7)
|
||||
craft_btn.pressed.connect(_on_craft_pressed.bind(recipe_id, panel))
|
||||
|
||||
Reference in New Issue
Block a user