M3 营地行牌化(UI落码第二波)——行首20px语义图标(攻/甲/血/铲子串映射)+Lv木底章化+满级态文案+钥石徽章CANDLE底墨字+头带图标20px;行结构只增不删探针面保持。闸=冒烟747/0+probe_gate全绿+layout 0
This commit is contained in:
1 parent
ca6676638d
commit
2e53d2dd76
1 file changed
+32
-7
@@ -79,16 +79,18 @@ func _init() -> void:
|
||||
spacer.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
top.add_child(spacer)
|
||||
var badge := PanelContainer.new()
|
||||
# M3(UI 落码批 2026-10-04):钥石徽章烛光黄底+深墨字(demo ②——旧暗底 CAMP_BADGE_PANEL 退役;
|
||||
# BADGE_PANEL_COL 常量保留他用不动)
|
||||
badge.add_theme_stylebox_override("panel",
|
||||
UiKit.panel_flat(BADGE_PANEL_COL, UiKit.PANEL_BORDER, 2, 1, Vector4(14, 8, 14, 8)))
|
||||
UiKit.panel_flat(UiKit.CANDLE, UiKit.CAMP_HEADER_BAND, 2, 1, Vector4(14, 8, 14, 8)))
|
||||
top.add_child(badge)
|
||||
var bal_row := HBoxContainer.new()
|
||||
bal_row.add_theme_constant_override("separation", 6)
|
||||
badge.add_child(bal_row)
|
||||
var keystone_icon := UiKit.icon_rect(UiKit.TEX_ICON_KEYSTONE, 18) # 缺位 null → 纯文本回退
|
||||
var keystone_icon := UiKit.icon_rect(UiKit.TEX_ICON_KEYSTONE, 20) # 缺位 null → 纯文本回退(M3 18→20)
|
||||
if keystone_icon != null:
|
||||
bal_row.add_child(keystone_icon)
|
||||
_balance_label = UiKit.label("钥石 0", 18, true, UiKit.GOLD)
|
||||
_balance_label = UiKit.label("钥石 0", 18, true, UiKit.INK_ON_GOLD)
|
||||
bal_row.add_child(_balance_label)
|
||||
|
||||
# ── 三柜台列(方向稿同构:头带深棕+米色板身)──
|
||||
@@ -160,7 +162,7 @@ func _counter_panel(title_text: String, icon_path: String, holder: Control, min_
|
||||
head.add_theme_constant_override("separation", 6)
|
||||
band.add_child(head)
|
||||
if icon_path != "":
|
||||
var ic := UiKit.icon_rect(icon_path, 16) # 缺位 null → 纯文本回退
|
||||
var ic := UiKit.icon_rect(icon_path, 20) # M3 16→20(demo 头带图标档) # 缺位 null → 纯文本回退
|
||||
if ic != null:
|
||||
head.add_child(ic)
|
||||
var l := UiKit.label(title_text, 16, true, UiKit.WARM)
|
||||
@@ -242,7 +244,13 @@ func refresh_camp(data: Dictionary) -> void:
|
||||
continue
|
||||
card.level_l.text = "Lv %d" % int(row.get("level", 0))
|
||||
card.price_l.text = "%d 钥石" % int(row.get("price", 0))
|
||||
card.btn.disabled = balance < int(row.get("price", 0)) # 余额不足禁用置灰
|
||||
# M3:满级态文案(demo ②——已满级替代价签与按钮动词;数据无 maxed 字段时零影响)
|
||||
if bool(row.get("maxed", false)):
|
||||
card.btn.text = "已满级"
|
||||
card.btn.disabled = true
|
||||
else:
|
||||
card.btn.text = "锻造 +1 级"
|
||||
card.btn.disabled = balance < int(row.get("price", 0)) # 余额不足禁用置灰
|
||||
var ws_by_id := {}
|
||||
for row in data.get("workshop", []):
|
||||
ws_by_id[String(row.get("item_id", ""))] = row
|
||||
@@ -304,10 +312,27 @@ func _build_forge_row(holder: VBoxContainer, row: Dictionary) -> Dictionary:
|
||||
line.add_theme_constant_override("separation", 12)
|
||||
card.add_child(line)
|
||||
var attr := String(row.get("attr", ""))
|
||||
# M3(UI 落码批):行首 20px 语义图标(图标+形状+颜色三通道——demo ②;子串映射容错 attr 键名演进)
|
||||
var icon_key := ""
|
||||
var attr_l := attr.to_lower()
|
||||
if attr_l.contains("attack"):
|
||||
icon_key = UiKit.TEX_ICON_SWORD
|
||||
elif attr_l.contains("armor") or attr_l.contains("ac"):
|
||||
icon_key = UiKit.TEX_ICON_SHIELD
|
||||
elif attr_l.contains("hp") or attr_l.contains("life"):
|
||||
icon_key = UiKit.TEX_ICON_HEART
|
||||
elif attr_l.contains("dig"):
|
||||
icon_key = UiKit.TEX_ICON_SHOVEL
|
||||
if icon_key != "":
|
||||
var ic := UiKit.icon_rect(icon_key, 20)
|
||||
if ic != null:
|
||||
line.add_child(ic)
|
||||
var name_l := UiKit.label("%s %+d/级" % [String(row.get("display_name", "")), int(row.get("flat", 0))], 14, true, UiKit.INK)
|
||||
name_l.custom_minimum_size = Vector2(132, 0)
|
||||
name_l.custom_minimum_size = Vector2(112, 0)
|
||||
line.add_child(name_l)
|
||||
var level_l := UiKit.label("", 14, false, UiKit.INK)
|
||||
var level_l := UiKit.label("", 13, true, Color8(246, 238, 218))
|
||||
# M3:Lv 章化(木底小章——demo lvtag;Label normal 槽挂样式盒)
|
||||
level_l.add_theme_stylebox_override("normal", UiKit.panel_flat(UiKit.CAMP_HEADER_BAND, Color(0, 0, 0, 0), 2, 0, Vector4(6, 0, 6, 0)))
|
||||
level_l.custom_minimum_size = Vector2(44, 0)
|
||||
line.add_child(level_l)
|
||||
var price_l := UiKit.label("", 14, false, UiKit.STONE)
|
||||
|
||||
Reference in new issue
Block a user