merge: 立体档位设置按钮——常驻档名指示器(2026-09-24,台账 154)
This commit is contained in:
commit
8585376aa9
3 files changed
+34
-5
No files matched your search
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
Reference in new issue
Block a user