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:
1 parent
5f8acd0f0d
commit
af2d834e78
9 files changed
+527
-33
No files matched your search
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
Reference in new issue
Block a user