From 9b35cf8c4b209dc32e2d9bbc879dae41ac8c15cb Mon Sep 17 00:00:00 2001 From: DKChan <524912269@qq.com> Date: Thu, 24 Sep 2026 14:43:19 +0800 Subject: [PATCH] =?UTF-8?q?feat(ui):=20=E7=AB=8B=E4=BD=93=E6=A1=A3?= =?UTF-8?q?=E4=BD=8D=E8=AE=BE=E7=BD=AE=E6=8C=89=E9=92=AE=E2=80=94=E2=80=94?= =?UTF-8?q?D=20=E5=8C=BA=20AP=20=E6=9D=A1=E5=8F=B3=E9=94=AE=E7=BB=84?= =?UTF-8?q?=E3=80=8C=E7=AB=8B=E4=BD=93=EF=BC=9AX=E3=80=8D=E5=B8=B8?= =?UTF-8?q?=E9=A9=BB=E6=98=BE=E7=A4=BA=E5=BD=93=E5=89=8D=E6=A1=A3=E3=80=81?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=BE=AA=E7=8E=AF=EF=BC=88F9=20=E5=90=8C?= =?UTF-8?q?=E6=95=88=E5=90=8C=E6=A0=87=E7=AD=BE=E8=81=94=E5=8A=A8=EF=BC=89?= =?UTF-8?q?=EF=BC=9BApBarView/BoardZoneView=20=E4=BF=A1=E5=8F=B7=E8=BD=AC?= =?UTF-8?q?=E5=8F=91+main=20=E7=BB=84=E5=90=88=E6=A0=B9=E5=85=B1=E4=BA=AB?= =?UTF-8?q?=20=5Fcycle=5Fdepth=5Ftier=EF=BC=88=E7=94=A8=E6=88=B7=E5=8F=8D?= =?UTF-8?q?=E9=A6=88=E3=80=8C=E4=B8=8D=E7=9F=A5=E9=81=93=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E5=93=AA=E4=B8=AA=E6=A1=A3=E3=80=8D2026-09-2?= =?UTF-8?q?4=EF=BC=8C=E5=8F=B0=E8=B4=A6=20154=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/presentation/main.gd | 18 +++++++++++++----- game/presentation/views/ap_bar_view.gd | 14 ++++++++++++++ game/presentation/views/board_zone_view.gd | 7 +++++++ 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/game/presentation/main.gd b/game/presentation/main.gd index 9ba12238..6b573bd0 100644 --- a/game/presentation/main.gd +++ b/game/presentation/main.gd @@ -116,6 +116,7 @@ func _build_ui() -> void: board_zone.stop_pressed.connect(_on_stop_pressed) board_zone.refresh_confirmed.connect(_on_refresh_confirmed) board_zone.legend_toggled.connect(_on_legend_toggled) + board_zone.depth_cycle_requested.connect(_cycle_depth_tier) board_zone.hover_forbidden.connect(_on_hover_forbidden) board_zone.chord_attempted.connect(_on_chord_attempted) @@ -549,13 +550,20 @@ func _on_chord_attempted(_cell: Vector2i) -> void: _show_hint("本作无双击快开——插旗后轮末自动判定标中;点数字格可移动小人", "chord") -# 立体原型档切换(F9 循环:平面→薄→中→厚——2026-09-24 用户拍板三档实机对比;定稿后此入口退役归表现批) +# 立体原型档切换(F9 或 D 区「立体」按钮循环:平面→薄→中→厚——2026-09-24 用户拍板三档实机对比; +# 按钮标签常驻显示当前档;定稿后两入口退役归表现批) func _unhandled_key_input(event: InputEvent) -> void: if event is InputEventKey and event.pressed and not event.echo and event.keycode == KEY_F9: - if board_view == null or board_view.board() == null: - return - var tier: String = board_view.set_depth_mode((board_view.depth_mode + 1) % board_view.DEPTH_NAMES.size()) - board_zone.toast.show_toast("棋盘立体档:%s(F9 继续切换)" % tier, "info") + _cycle_depth_tier() + + +func _cycle_depth_tier() -> void: + if board_view == null or board_view.board() == null: + return + var tier: String = board_view.set_depth_mode((board_view.depth_mode + 1) % board_view.DEPTH_NAMES.size()) + var short: String = tier.split("(")[0] # 按钮短名(全名经 toast 呈现) + board_zone.set_depth_label(short) + board_zone.toast.show_toast("棋盘立体档:%s(按钮/F9 继续切换)" % tier, "info") func _show_hint(text: String, hint_id: String) -> void: diff --git a/game/presentation/views/ap_bar_view.gd b/game/presentation/views/ap_bar_view.gd index 409c042c..54748844 100644 --- a/game/presentation/views/ap_bar_view.gd +++ b/game/presentation/views/ap_bar_view.gd @@ -11,6 +11,7 @@ extends PanelContainer signal stop_pressed signal refresh_confirmed signal legend_toggled +signal depth_cycle_requested # 立体原型批 2026-09-24——档位循环按钮(原型临时件,定稿后随 F9 入口一并退役) const COL_GOLD := UiKit.GOLD const COL_DOT_OFF := UiKit.DOT_OFF @@ -20,6 +21,7 @@ var _dots: HBoxContainer var _ap_label: Label var _btn_stop: Button var _btn_legend: Button +var _btn_depth: Button var _btn_refresh: Button var _refresh_sub: Label var _confirm_row: HBoxContainer @@ -74,6 +76,13 @@ func _init() -> void: _btn_legend.pressed.connect(func(): legend_toggled.emit()) row.add_child(_btn_legend) + # 立体原型档位按钮(原型临时件——标签实时显示当前档;点击循环,F9 同效) + _btn_depth = UiKit.button("立体:平面") + _btn_depth.custom_minimum_size = Vector2(96, 0) + _btn_depth.size_flags_vertical = Control.SIZE_SHRINK_CENTER + _btn_depth.pressed.connect(func(): depth_cycle_requested.emit()) + row.add_child(_btn_depth) + var refresh_box := VBoxContainer.new() refresh_box.add_theme_constant_override("separation", 0) refresh_box.size_flags_vertical = Control.SIZE_SHRINK_CENTER @@ -121,6 +130,11 @@ func set_legend_enabled(on: bool) -> void: _btn_legend.disabled = not on +# 立体档标签回写(main 组合根切档后调用——按钮文字即常驻档位指示器) +func set_depth_label(tier_short: String) -> void: + _btn_depth.text = "立体:" + tier_short + + # 探针/装配复用:刷新按钮可用性(预判 = RAP 足额 + 上限未到) func is_refresh_ready() -> bool: return not _btn_refresh.disabled diff --git a/game/presentation/views/board_zone_view.gd b/game/presentation/views/board_zone_view.gd index 5dd8a3f8..58cc57cd 100644 --- a/game/presentation/views/board_zone_view.gd +++ b/game/presentation/views/board_zone_view.gd @@ -16,6 +16,7 @@ signal action_requested(cell: Vector2i, kind: String) signal stop_pressed signal refresh_confirmed signal legend_toggled +signal depth_cycle_requested # 立体原型批 2026-09-24——档位循环按钮转发(原型临时件) signal hover_forbidden(cell: Vector2i) signal chord_attempted(cell: Vector2i) @@ -46,3 +47,9 @@ func _init() -> void: ap_bar.stop_pressed.connect(func(): stop_pressed.emit()) ap_bar.refresh_confirmed.connect(func(): refresh_confirmed.emit()) ap_bar.legend_toggled.connect(func(): legend_toggled.emit()) + ap_bar.depth_cycle_requested.connect(func(): depth_cycle_requested.emit()) + + +# 立体档标签回写(main 组合根切档后调用——按钮文字即常驻档位指示器) +func set_depth_label(tier_short: String) -> void: + ap_bar.set_depth_label(tier_short)