merge: M4 设置面板化(第三波;三闸全绿;click探针拨杆适配)
This commit is contained in:
commit
8f029cc618
2 files changed
+52
-34
No files matched your search
@@ -12,8 +12,10 @@ signal closed
|
||||
var _store
|
||||
var _volume: HSlider
|
||||
var _volume_val: Label
|
||||
var _fs_btn: Button
|
||||
var _motion_btn: Button
|
||||
var _fs_btn: Button # M4 换 SwitchToggle 拨杆(仍 Button 子类——探针接缝保持)
|
||||
var _motion_btn: Button # M4 同上
|
||||
var _fs_st: Label # M4 状态字随行(开/关)
|
||||
var _motion_st: Label # M4 状态字(完整/快速)
|
||||
|
||||
|
||||
func _init(store) -> void:
|
||||
@@ -30,66 +32,82 @@ func retarget(store) -> void:
|
||||
|
||||
|
||||
func _build() -> void:
|
||||
var box: VBoxContainer = UiKit.modal_shell(self, UiKit.BG_OVERLAY, Vector2(560, 0), 8).box
|
||||
# M4(UI 落码批):石板面板化(demo ③)+行牌化(标签+拨杆+状态字+后果说明行);
|
||||
# 设置项零增减(P-C6:只有主音量——demo 音效音量行系原型发明已撤);
|
||||
# 减动效与结算演出动画=同一设置(语义命名批合并),一行承载
|
||||
var shell: Dictionary = UiKit.modal_shell(self, UiKit.BG_BRIGHT, Vector2(560, 0), 8, true,
|
||||
UiKit.panel_skinned(Vector4(20, 16, 20, 16)))
|
||||
var box: VBoxContainer = shell.box
|
||||
|
||||
var title := UiKit.label("设置", 26, true, UiKit.WARM)
|
||||
var title := UiKit.label("设置", 24, true, UiKit.INK_TITLE)
|
||||
title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
box.add_child(title)
|
||||
var hint := UiKit.label("系统级设置——独立存储不随存档(一安装一份,删游戏才消失)", 13, false, UiKit.WARM_SOFT)
|
||||
var hint := UiKit.label("系统级设置——独立存储不随存档(一安装一份,删游戏才消失)", 13, false, Color8(110, 69, 52))
|
||||
hint.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
box.add_child(hint)
|
||||
box.add_child(HSeparator.new())
|
||||
|
||||
# 音量(master bus 实时生效——入口归设置、生效口径归 音频.md)
|
||||
var vol_row := HBoxContainer.new()
|
||||
vol_row.add_theme_constant_override("separation", 14)
|
||||
box.add_child(vol_row)
|
||||
vol_row.add_child(UiKit.label("音量", 15, false))
|
||||
_volume = HSlider.new()
|
||||
_volume.min_value = 0
|
||||
_volume.max_value = 100
|
||||
vol_row.add_child(UiKit.label("主音量", 15, false, UiKit.INK_LABEL))
|
||||
_volume = UiKit.styled_slider(100.0, 0.0, 100.0)
|
||||
_volume.step = 1
|
||||
_volume.custom_minimum_size = Vector2(280, 24)
|
||||
_volume.value_changed.connect(_on_volume_changed)
|
||||
vol_row.add_child(_volume)
|
||||
_volume_val = UiKit.label("100%", 15, true, UiKit.INK_L_WARM)
|
||||
_volume_val = UiKit.label("100%", 15, true, UiKit.INK_TITLE)
|
||||
_volume_val.custom_minimum_size = Vector2(60, 0)
|
||||
vol_row.add_child(_volume_val)
|
||||
|
||||
# 开关形态(二轮修改批 D2 2026-09-29 用户目检——原生 CheckButton 暗底不显眼,
|
||||
# 换 UiKit 按钮形态 toggle:文字「全屏:开/关」随态换面)
|
||||
_fs_btn = UiKit.button("全屏:关")
|
||||
_fs_btn.toggle_mode = true
|
||||
# 全屏(拨杆形——M10 SwitchToggle;状态字随行)
|
||||
var fs_row := HBoxContainer.new()
|
||||
fs_row.add_theme_constant_override("separation", 14)
|
||||
box.add_child(fs_row)
|
||||
fs_row.add_child(UiKit.label("全屏", 15, false, UiKit.INK_LABEL))
|
||||
_fs_btn = UiKit.switch_toggle(false)
|
||||
_fs_btn.toggled.connect(_on_fullscreen_toggled)
|
||||
box.add_child(_fs_btn)
|
||||
fs_row.add_child(_fs_btn)
|
||||
_fs_st = UiKit.label("关", 14, true, UiKit.INK_LABEL)
|
||||
fs_row.add_child(_fs_st)
|
||||
|
||||
# 减动效(battle.md §Transitions 承诺转正——时长减半,结算逐行兑现=信息载体不整体跳过)
|
||||
# 文案由 _sync_motion_text 按状态装配(构造串仅占位——_sync 启动即覆盖)
|
||||
_motion_btn = UiKit.button("结算演出动画")
|
||||
_motion_btn.toggle_mode = true
|
||||
# 结算演出动画(=减动效实称——语义命名批 T17;拨杆 on=完整,off=快速时长减半)
|
||||
var motion_row := HBoxContainer.new()
|
||||
motion_row.add_theme_constant_override("separation", 14)
|
||||
box.add_child(motion_row)
|
||||
motion_row.add_child(UiKit.label("结算演出动画", 15, false, UiKit.INK_LABEL))
|
||||
_motion_btn = UiKit.switch_toggle(true)
|
||||
_motion_btn.toggled.connect(_on_motion_toggled)
|
||||
box.add_child(_motion_btn)
|
||||
motion_row.add_child(_motion_btn)
|
||||
_motion_st = UiKit.label("完整", 14, true, UiKit.INK_LABEL)
|
||||
motion_row.add_child(_motion_st)
|
||||
var why := UiKit.label("快速 = 时长减半(运动敏感 / 演示用)", 12, false, Color8(110, 69, 52))
|
||||
why.position.y = 0
|
||||
box.add_child(why)
|
||||
|
||||
box.add_child(HSeparator.new())
|
||||
# 退出游戏已提级开始菜单(D1——设置面不再承载,用户裁决「退出只在一级菜单出现」)
|
||||
var close_row := HBoxContainer.new()
|
||||
close_row.alignment = BoxContainer.ALIGNMENT_CENTER
|
||||
box.add_child(close_row)
|
||||
var close_btn := UiKit.button("返回")
|
||||
close_btn.pressed.connect(_emit_closed)
|
||||
box.add_child(close_btn)
|
||||
close_row.add_child(close_btn)
|
||||
|
||||
|
||||
func _sync() -> void:
|
||||
_volume.set_value_no_signal(roundf(_store.volume_linear * 100.0))
|
||||
_volume_val.text = "%d%%" % roundi(_store.volume_linear * 100.0)
|
||||
_fs_btn.set_pressed_no_signal(_store.fullscreen)
|
||||
_fs_btn.text = "全屏:%s" % ("开" if _store.fullscreen else "关")
|
||||
_motion_btn.set_pressed_no_signal(_store.reduced_motion)
|
||||
_fs_st.text = "开" if _store.fullscreen else "关"
|
||||
_motion_btn.set_pressed_no_signal(not _store.reduced_motion) # 拨杆 on=完整
|
||||
_sync_motion_text()
|
||||
|
||||
|
||||
# T17 修复:文案随状态即时刷新(旧 bug=切换后文案恒「开」,玩家无法得知当前态)+语义命名
|
||||
# (「减动效」玩家读不懂——实称「结算演出动画」速度档)+操作提示内联(所见即所得)。
|
||||
func _sync_motion_text() -> void:
|
||||
if _store.reduced_motion:
|
||||
_motion_btn.text = "结算演出动画:快速(时长减半——运动敏感/演示用)· 点击改回完整"
|
||||
else:
|
||||
_motion_btn.text = "结算演出动画:完整 · 点击改为快速(时长减半——运动敏感/演示用)"
|
||||
_motion_st.text = "快速" if _store.reduced_motion else "完整"
|
||||
|
||||
|
||||
func _on_volume_changed(v: float) -> void:
|
||||
@@ -106,7 +124,7 @@ func _on_fullscreen_toggled(on: bool) -> void:
|
||||
|
||||
|
||||
func _on_motion_toggled(on: bool) -> void:
|
||||
_store.reduced_motion = on
|
||||
_store.reduced_motion = not on # M4 拨杆语义翻转:on=完整(off=快速)
|
||||
_store.apply()
|
||||
_store.save_settings()
|
||||
_sync_motion_text() # T17 修复:切换即时刷新文案(旧版漏刷新=状态文字恒「开」)
|
||||
|
||||
@@ -101,13 +101,13 @@ func _ready() -> void:
|
||||
if not main.settings_overlay.visible or main._start_overlay.visible:
|
||||
_problems.append("设置面未打开(点击路径)")
|
||||
else:
|
||||
# 减动效转正双态(卡④ AC③):开=0.5 引擎态即时生效+落盘持久;关=1.0 回常态
|
||||
# T17 随批:按钮语义化改文案「结算演出动画:完整/快速」(状态值内联+操作提示)
|
||||
var motion_btn: Button = ProbeUiUtil.find_button(main.settings_overlay, "结算演出动画", "contains")
|
||||
# 减动效转正双态(卡④ AC③)——M4 适配:拨杆开关(_motion_btn)语义翻转 on=完整/off=快速,
|
||||
# 状态字随行 _motion_st;查找由文字改成员引用(拨杆无文字)
|
||||
var motion_btn: Button = main.settings_overlay._motion_btn
|
||||
if motion_btn == null:
|
||||
_problems.append("设置面减动效开关缺失")
|
||||
else:
|
||||
motion_btn.button_pressed = true
|
||||
motion_btn.button_pressed = false # off=快速(减动效开)
|
||||
await get_tree().process_frame
|
||||
if UiKit.motion_scale != 0.5:
|
||||
_problems.append("减动效开未生效(motion_scale != 0.5)")
|
||||
@@ -115,7 +115,7 @@ func _ready() -> void:
|
||||
chk.load_settings()
|
||||
if not chk.reduced_motion:
|
||||
_problems.append("减动效开未持久化(设置独立存储失守——卡④ AC⑤)")
|
||||
motion_btn.button_pressed = false
|
||||
motion_btn.button_pressed = true # on=完整回常态
|
||||
await get_tree().process_frame
|
||||
if UiKit.motion_scale != 1.0:
|
||||
_problems.append("减动效关未恢复(motion_scale != 1.0)")
|
||||
|
||||
Reference in new issue
Block a user