feat(ui): 棋盘立体中档定稿冻结——DEPTH_PX=8/DEPTH_BEVEL=0.6 常量默认生效(用户实机三档对比拍板 2026-09-24);原型入口退役=F9 键+D 区「立体:X」按钮+切档信号链全拆(ApBarView/BoardZoneView/main 组合根同批),BoardWorld 头注随改;冒烟 557/0+ui_input/click/layout 三探针绿;§1.4 注记欠账待 art-bible 并行批落籍后补写
This commit is contained in:
1 parent
71ae51cb35
commit
b4e7200999
5 files changed
+11
-59
No files matched your search
@@ -116,7 +116,6 @@ 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)
|
||||
|
||||
@@ -550,22 +549,6 @@ func _on_chord_attempted(_cell: Vector2i) -> void:
|
||||
_show_hint("本作无双击快开——插旗后轮末自动判定标中;点数字格可移动小人", "chord")
|
||||
|
||||
|
||||
# 立体原型档切换(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:
|
||||
_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:
|
||||
_hints_shown[hint_id] = true
|
||||
logger.log_ux("ux_hint_shown", {"hint_id": hint_id})
|
||||
|
||||
@@ -11,7 +11,6 @@ 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
|
||||
@@ -21,7 +20,6 @@ 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
|
||||
@@ -76,13 +74,6 @@ 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
|
||||
@@ -130,11 +121,6 @@ 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
|
||||
|
||||
@@ -47,12 +47,10 @@ const CURSOR_MOVE_SEM := Input.CURSOR_ARROW # 移动——箭头(命名
|
||||
const CHORD_WINDOW_MS := 350
|
||||
const SEP := 2 # 格间距(旧 GridContainer v/h_separation 同值——格尺寸公式与命中换算共用)
|
||||
|
||||
# 立体原型档位(2026-09-24 用户拍板三档实机对比——F9 循环切换;定稿参数归格子样张批 §1.4 冻结)
|
||||
const DEPTH_NAMES := ["平面(现行)", "薄(缩小帽档)", "中", "厚(纸雕织梦岛档)"]
|
||||
const DEPTH_PX := [0.0, 4.0, 8.0, 14.0] # 悬崖厚度(像素)
|
||||
const DEPTH_BEVEL := [0.0, 0.35, 0.6, 1.0] # 顶面倒角强度
|
||||
|
||||
var depth_mode := 0 # 当前立体档(0..3——平面/薄/中/厚)
|
||||
# 棋盘立体参数(2026-09-24 用户实机三档对比拍板「中档」定稿——原型 F9/按钮入口已退役;
|
||||
# §1.4 注记待 art-bible 并行批落籍后补写)
|
||||
const DEPTH_PX := 8.0 # 悬崖厚度(像素)
|
||||
const DEPTH_BEVEL := 0.6 # 顶面倒角强度
|
||||
|
||||
var _wrap: CenterContainer
|
||||
var _svp_container: SubViewportContainer
|
||||
@@ -148,8 +146,8 @@ func set_cell_area(avail: Vector2) -> void:
|
||||
return
|
||||
var n: int = maxi(_board.width, _board.height)
|
||||
var sep := SEP # 格间距(_init 同值)
|
||||
var d := float(DEPTH_PX[depth_mode])
|
||||
var reserve := 24.0 + d # 垂直总预留(上 12 + 下 12 + 悬崖外延——立体原型批:悬崖占预算防溢出)
|
||||
var d := DEPTH_PX
|
||||
var reserve := 24.0 + d # 垂直总预留(上 12 + 下 12 + 悬崖外延——悬崖占预算防溢出)
|
||||
var cell := int(floor((minf(avail.x - 12.0 - d, avail.y - reserve) - float((n - 1) * sep)) / float(n)))
|
||||
_cell = float(clampi(cell, 26, 46))
|
||||
var stride := _cell + float(SEP)
|
||||
@@ -161,21 +159,11 @@ func set_cell_area(avail: Vector2) -> void:
|
||||
_update_world_size()
|
||||
|
||||
|
||||
# 立体档切换(F9 组合根入口;返回档名供 toast)
|
||||
func set_depth_mode(m: int) -> String:
|
||||
depth_mode = clampi(m, 0, DEPTH_NAMES.size() - 1)
|
||||
for c in _cells:
|
||||
_cells[c].bevel = float(DEPTH_BEVEL[depth_mode])
|
||||
_refresh_slab()
|
||||
set_cell_area(size)
|
||||
return DEPTH_NAMES[depth_mode]
|
||||
|
||||
|
||||
# 悬崖参数下发(网格像素尺寸/步距/列数/材质锚色——BoardWorld._draw 消费)
|
||||
func _refresh_slab() -> void:
|
||||
if _board == null or _board.width == 0:
|
||||
return
|
||||
_world.depth_px = float(DEPTH_PX[depth_mode])
|
||||
_world.depth_px = DEPTH_PX
|
||||
_world.slab = Vector2(_board.width, _board.height) * (_cell + float(SEP)) - Vector2(SEP, SEP)
|
||||
_world.stride_px = _cell + float(SEP)
|
||||
_world.cols = _board.width
|
||||
@@ -203,7 +191,7 @@ func rebuild(board: BoardData, minesweeper) -> void:
|
||||
u.cell = c
|
||||
u.edge = _cell
|
||||
u.position = Vector2(c) * stride
|
||||
u.bevel = float(DEPTH_BEVEL[depth_mode]) # 立体原型批——新建格单元继承当前档倒角
|
||||
u.bevel = DEPTH_BEVEL # 定稿倒角——新建格单元继承
|
||||
u.use_parent_material = true # 去饱和材质挂 BoardWorld——单元随世界材质灰化
|
||||
u.font = _world.board_font
|
||||
_world.add_child(u)
|
||||
@@ -260,7 +248,7 @@ func cell_center_local(c: Vector2i) -> Vector2:
|
||||
func _update_world_size() -> void:
|
||||
if _board == null or _board.width == 0:
|
||||
return
|
||||
var d := float(DEPTH_PX[depth_mode])
|
||||
var d := DEPTH_PX
|
||||
var px := Vector2(_board.width, _board.height) * (_cell + float(SEP)) - Vector2(SEP, SEP) + Vector2(d, d)
|
||||
_svp_container.custom_minimum_size = px
|
||||
# 树内 stretch=true 时 SubViewport 尺寸由容器接管(手设被引擎拒绝并刷警告);树外(冒烟直建)才需手设保 1:1
|
||||
|
||||
@@ -12,8 +12,8 @@ extends Node2D
|
||||
|
||||
var board_font: Font = null # 字体注入槽位(null = ThemeDB.fallback_font——与旧 Button 缺省主题字体同源)
|
||||
|
||||
# ── 立体原型(BoardView.set_depth_mode / set_cell_area 单点驱动)──
|
||||
var depth_px := 0.0: # 悬崖厚度(0 = 平面现行;档位 4/8/14)
|
||||
# ── 立体悬崖(BoardView.set_cell_area / _update_world_size 单点驱动;厚度定稿 8px=中档 2026-09-24)──
|
||||
var depth_px := 0.0: # 悬崖厚度(像素;0 = 平面)
|
||||
set(v):
|
||||
depth_px = v
|
||||
queue_redraw()
|
||||
|
||||
@@ -16,7 +16,6 @@ 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)
|
||||
|
||||
@@ -47,9 +46,5 @@ 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