feat(迭代25): UI 全局主题批 T0-T2——全局主题资源挂载+两处局部做法退役+冒烟 V1-V6 断言

- T0: game/assets/theme/main_theme.tres 挂 project.godot gui/theme/custom——
  15 类型全覆盖(V/HScrollBar·ScrollContainer·H/VSlider·TooltipPanel/Label·
  LineEdit·SpinBox·H/VSeparator)+预盖 CheckBox/CheckButton/OptionButton/
  PopupMenu 弹层;default_font 显式指现役同字体(V6 中文字形防御);
  位图生成脚本 tools/gen_theme_icons.py(9 张纯色/几何小位图→assets/art/ui/gen/,
  按 .gitignore 政策本地生成不入库);色值溯源表 game/assets/theme/README.md
- T1: ui_kit.gd 删 tooltip_theme()/_tip_theme 与 styled_slider()、ui_assembler.gd
  删挂载行(旧实现同批删除);settings_overlay 几何内联、debug_overlay 双轨消隐
- T2: 冒烟 _smoke_global_theme() 38 断言(V1 类型覆盖+Button/focus 双红线+
  V2 冻结值 5.49:1+V3 预盖证词+V4 退役零残留+V6 字体防御)
- 引擎事实(4.7.2 源码+默认主题链双查):CheckButton 与 CheckBox 同套
  checked/unchecked 图标名;Slider 无 grabber_pressed 槽;ScrollBar 柄=StyleBox
This commit is contained in:
DKChan committed 2026-10-13 21:39:01 +08:00
1 parent 5f8acd0f0d
commit af2d834e78
9 files changed
+527 -33

No files matched your search

+2 -2
View File
@@ -99,10 +99,10 @@ static func build_overlays(host: Control, db) -> Dictionary:
# UI 落码批 M2(2026-10-04):单列 VBox→双列(左操作 56% + 右舞台);按钮动词化+悬停解释
#(解释全迁 tooltip,G5);lvbtn 升主操作钮(烛光黄 CANDLE);右列=立绘看台。**玩法速览牌已退役
#(2026-10-06 用户令:界面禁玩法文字墙——教学内容归 Beta 帮助手册〔教学引导定稿批 P4 丙〕,历史文案在 git)**;
# root 挂 UiKit.tooltip_theme() 全树生效。返回键集不变,组合根接线零改)
# tooltip 主题归全局主题单点(迭代 25 2026-10-13——旧 root 挂程序化 tooltip 主题的做法退役)。
# 返回键集不变,组合根接线零改)
static func build_start_overlay(host: Control, db = null) -> Dictionary:
var overlay := overlay_bg(host, UiKit.BG_BRIGHT)
overlay.theme = UiKit.tooltip_theme()
# 石纹弱质感+斜光带+暗角(UI 对齐批 T5 2026-10-06——demo .tilebg 0.14/.beams/.vignette 三层;
# 旧满铺石纹不透退役。缺位不挂即回退平色)
var bd := UiKit.backdrop_tile()
+1 -1
View File
@@ -278,7 +278,7 @@ func _slider_row(box: VBoxContainer, title: String) -> Dictionary:
s.min_value = 0
s.max_value = 300
s.step = 5
s.custom_minimum_size = Vector2(320, 24)
s.custom_minimum_size = Vector2(320, 24) # 皮肤走全局主题(迭代 25:与设置屏音量滑轨同一构建方式,消双轨)
row.add_child(s)
var v := UiKit.label("+0%",UiKit.FS_BODY, true)
v.custom_minimum_size = Vector2(70, 0)
+5 -1
View File
@@ -56,7 +56,11 @@ func _build() -> void:
var vol_lab := UiKit.label("主音量",UiKit.FS_BODY, false, UiKit.INK_LABEL)
vol_lab.custom_minimum_size = Vector2(140, 0) # T8 label 列定宽(两列对齐)
vol_row.add_child(vol_lab)
_volume = UiKit.styled_slider(100.0, 0.0, 100.0)
_volume = HSlider.new()
_volume.min_value = 0.0
_volume.max_value = 100.0
_volume.value = 100.0
_volume.custom_minimum_size = Vector2(200, 24) # 几何/量程内联(迭代 25:样式滑杆工厂退役,皮肤走全局主题)
_volume.step = 1
_volume.size_flags_horizontal = Control.SIZE_EXPAND_FILL
_volume.value_changed.connect(_on_volume_changed)
+4 -29
View File
@@ -731,32 +731,7 @@ static func switch_toggle(initial: bool) -> SwitchToggle:
return SwitchToggle.new(initial)
# 样式滑杆(设置屏音量——轨道暖石+默认柄;范围/读数由消费方接)
static func styled_slider(value: float, minv := 0.0, maxv := 100.0) -> HSlider:
var s := HSlider.new()
s.min_value = minv
s.max_value = maxv
s.value = value
s.custom_minimum_size = Vector2(200, 24)
# 槽轨/填充实高(2026-10-06 判官实checkpoint:HSlider 槽=按 stylebox min 高绘制——零 margin
# StyleBoxFlat min 高 0-2px=轨道整条不可见;6px 上下 content margin=12px 实高)
s.add_theme_stylebox_override("slider",
panel_flat(Color8(184, 165, 130), PANEL_BORDER, 0, 1, Vector4(0, 6, 0, 6)))
s.add_theme_stylebox_override("grabber_area",
panel_flat(Color8(122, 82, 50), Color8(0, 0, 0, 0), 0, 0, Vector4(0, 6, 0, 6)))
return s
# tooltip 全站主题(深底多行素牌——§7.2 文字可读硬指标;消费方=任一祖先 Control.theme 挂一次全树生效)
static var _tip_theme: Theme = null
static func tooltip_theme() -> Theme:
if _tip_theme != null:
return _tip_theme
var th := Theme.new()
th.set_stylebox("panel", "TooltipPanel",
panel_flat(Color(0.09, 0.07, 0.05, 0.96), Color8(90, 80, 68), 0, 1, Vector4(8, 6, 8, 6)))
th.set_color("font_color", "TooltipLabel", WARM)
th.set_font_size("font_size", "TooltipLabel", 14)
_tip_theme = th
return _tip_theme
# 样式滑杆/tooltip 主题两处局部做法已退役(迭代 25 UI 全局主题批 2026-10-13——词条迁
# game/assets/theme/main_theme.tres 全局主题单点:滑轨 slider/grabber_area/grabber、
# TooltipPanel/TooltipLabel;旧实现同批删除,禁新旧并存。消费方几何内联:
# settings_overlay 音量滑轨 / debug_overlay _slider_row)