iter52-卡3:迭代52卡③(presentation层封装修复): A1三类42字段公开化(280处改址)+A2拆件子件公开面(vitals14/motion14/board_hover七口)+B族组合根交接面(18服务+12句柄口,束参两处,on_*保私有)+C族杂项(UiKit三工厂/构造交付)——presentation私取sweep恒零(V1-V4,105checks),main.gd例外键32与ui_kit例外键23落基线(§3.2误测0/0反哺点),探针测试22处引用迁移,渲染golden与探针套件零转红; 验收档中

This commit is contained in:
DKChan committed 2026-11-05 03:04:21 +08:00
1 parent f2c3a3887d
commit 67024cb9ec
42 files changed
+1391 -679

No files matched your search

+189 -96
View File
@@ -49,7 +49,57 @@ var settings_store # 系统级设置独立存储(音量
var _tune_sim = null # 调试浮窗批量模拟控制器(tune_sim_controller.gd)
func _replay_locked_click() -> void:
# ---- 句柄读投影/设置口(pres封装 B 规则 4——成员保持私有,分文件经此读写;BreakpointStore 方法对先例)----
func set_treasure_ui(v: Variant) -> void:
_treasure_ui = v
func treasure_ui() -> Variant:
return _treasure_ui
func set_bonus(v: Variant) -> void:
_bonus = v
func bonus() -> Variant:
return _bonus
func set_camp_pres(v: Variant) -> void:
_camp_pres = v
func camp_pres() -> Variant:
return _camp_pres
func set_debug(v: Variant) -> void:
_debug = v
func debug() -> Variant:
return _debug
func set_tune_sim(v: Variant) -> void:
_tune_sim = v
func tune_sim() -> Variant:
return _tune_sim
func set_confirm_consumer(v: String) -> void:
_confirm_consumer = v
func set_confirm_consumer_slot(v: int) -> void:
_confirm_consumer_slot = v
func replay_locked_click() -> void:
if run_scope.locked_click.is_empty() or not ui.screens.row_pacer.pending_rows().is_empty():
return
var click: Dictionary[Variant, Variant] = run_scope.locked_click
@@ -59,7 +109,7 @@ func _replay_locked_click() -> void:
# 会话生命周期:_ready 建闲时态(永非 null——全组合根零空判责),
# 开局/续玩/调试两层各建新会话,旧会话整节点 queue_free()(帧末回收;新节点先挂树无真空窗)。
func _begin_session(adventure_session: bool) -> void:
func begin_session(adventure_session: bool) -> void:
ui.screens.row_pacer.flush() # 会话更替即清队(待播行不住局态——机制保证,不靠时序约定)
if run_scope != null:
run_scope.queue_free()
@@ -73,7 +123,7 @@ func _ready() -> void:
if not db.is_ready:
var ok: bool = db.load_tables("res://data/tables", false)
if not ok:
_fatal_screen("数值表加载失败——见输出错误清单(fail-fast)")
fatal_screen("数值表加载失败——见输出错误清单(fail-fast)")
return
# SaveManager/MetaProgression 升格 autoload:读盘已在各自 _ready 完成
#(autoload 先于主场景就绪——读盘时序等价),此处零动作。
@@ -83,7 +133,7 @@ func _ready() -> void:
settings_store.apply()
ui = UiRegistry.new() # 注册面先于装配建(_build_ui 八步向容器登记——装配时序零变化)
_build_ui()
_begin_session(false) # 闲时会话(gp_ledger 等探针注入面自 _ready 起恒在——ui_probe 合成段时序)
begin_session(false) # 闲时会话(gp_ledger 等探针注入面自 _ready 起恒在——ui_probe 合成段时序)
ui.screens.start_overlay.visible = true
ui.screens.debug_badge.visible = _debug_entry # 浮层角标可见性须门控落定后赋值(构建/连接在 _build_ui);_debug_entry 缺省 false=发布态恒隐
# boot 菜单优先——启动不自动开浮窗(开始屏不得被调试面板盖住);
@@ -93,11 +143,44 @@ func _ready() -> void:
# ==================== 视图接线(三屏壳 + 模态层装配;构建归屏壳/UiAssembler,本类只接线) ====================
func _build_ui() -> void:
MainUiBuild.build(self)
# 处理器束(pres封装 B 规则 2——on_* 处理器保私有,接线语句经束消费;键=用途名,main 内自引合法)
MainUiBuild.build(self, {
"board_action": _on_board_action,
"status_badge_pressed": _on_status_badge_pressed,
"stop_pressed": _on_stop_pressed,
"refresh_confirmed": _on_refresh_confirmed,
"legend_toggled": _on_legend_toggled,
"hover_forbidden": _on_hover_forbidden,
"chord_attempted": _on_chord_attempted,
"node_continue": _on_node_continue,
"route_chosen": _on_route_chosen,
"abandon_requested": _on_abandon_requested,
"battle_end_continue": _on_battle_end_continue,
"settings_closed": _on_settings_closed,
"status_closed": _on_status_closed,
"career_closed": _on_career_closed,
"save_select_closed": _on_save_select_closed,
"save_select_new": _on_save_select_new,
"save_select_load": _on_save_select_load,
"save_select_delete": _on_save_select_delete,
"debug_badge_pressed": _on_debug_badge_pressed,
"camp_object_pressed": _on_camp_object_pressed,
"inter_next_pressed": _on_inter_next_pressed,
"confirm_accepted": _on_confirm_accepted,
"confirm_secondary": _on_confirm_secondary,
"confirm_declined": _on_confirm_declined,
"esc_return": _on_esc_return,
"esc_settings": _on_esc_settings,
"esc_quit": _on_esc_quit,
"tune_apply": _on_tune_apply,
"tune_simulate": _on_tune_simulate,
"debug_battle_created": _on_debug_battle_created,
"debug_battle_ready": _on_debug_battle_ready,
})
ui.modals.menu.debug_overlay.diagnose_requested.connect(_on_diagnose_pressed) # 诊断转储入口
func _fatal_screen(msg: String) -> void:
func fatal_screen(msg: String) -> void:
MainUiBuild.fatal_screen(self, msg)
@@ -122,13 +205,13 @@ func _on_confirm_accepted() -> void:
save_manager.slots.delete_slot(_confirm_consumer_slot)
ui.modals.menu.save_select_overlay.open_save_select(HudPresenter.save_select_data(save_manager)) # 就地刷新(该槽回空态)
"gate":
_camp_pres.on_camp_closed() # 冒险发起后营地场景屏隐藏(选档层同收——卡④ T4 关层收闭)
camp_pres().on_camp_closed() # 冒险发起后营地场景屏隐藏(选档层同收——卡④ T4 关层收闭)
_resume_from_menu() # 继续上一段冒险(现役续玩编排同源——卡④ 契约 4)
"gate_new":
_camp_pres.on_camp_closed()
camp_pres().on_camp_closed()
_start_adventure() # 开始新冒险(现役开局编排同源)
"campfire_leave":
_camp_pres.on_camp_closed() # 篝火确认离场=营地与选档层同收+开始层恢复(回主菜单)
camp_pres().on_camp_closed() # 篝火确认离场=营地与选档层同收+开始层恢复(回主菜单)
_confirm_consumer = ""
@@ -137,7 +220,7 @@ func _on_confirm_secondary() -> void:
ui.flow.close(ui.modals.menu.confirm_dialog) # 模态栈单口
match _confirm_consumer:
"gate":
_camp_pres.on_camp_closed()
camp_pres().on_camp_closed()
_start_adventure()
_confirm_consumer = ""
@@ -148,7 +231,7 @@ func _on_confirm_declined() -> void:
# 退出游戏(一级菜单入口;设置即时落盘后退出)
func _quit_game() -> void:
func quit_game() -> void:
if settings_store != null:
settings_store.save_settings()
get_tree().quit()
@@ -161,23 +244,26 @@ func _resume_from_menu() -> void:
var bp: Dictionary[Variant, Variant] = save_manager.breakpoint_snapshot()
ui.flow.close(ui.modals.menu.debug_overlay) # 开冒险路径显式关浮窗(续玩同口径)
ui.screens.start_overlay.visible = false
_begin_session(true)
begin_session(true)
_wire_adventure()
run_scope.level_active = true
_sync_status_entry() # 续玩恢复点亮状态面板入口角标
sync_status_entry() # 续玩恢复点亮状态面板入口角标
ui.modals.run.level_screen.set_abandon_available(true)
ui.battle.log_view.clear()
logger.start_session(int(bp.get("master_seed", 0)))
run_scope.adventure.set_hero_override(ui.modals.menu.debug_overlay.atk_pct(), ui.modals.menu.debug_overlay.hp_pct())
# 同调三键随续玩下传(build_adventure_params 统一构造,与开新局同源同口径)
if not run_scope.adventure.resume_adventure(bp, build_adventure_params(save_manager, meta,
{"treasure_unlocked": _treasure_ui.unlocked_set()})):
_fatal_screen("续玩恢复失败——见输出日志")
{"treasure_unlocked": treasure_ui().unlocked_set()})):
fatal_screen("续玩恢复失败——见输出日志")
return
func _wire_adventure() -> void:
MainAdventureFlow._wire_adventure(self)
MainAdventureFlow.wire_adventure(self, {
"adventure_finished": _on_adventure_finished,
"level_started": _on_adventure_level_started,
})
# 冒险开局参数面构造(主菜单开新/续玩两入口共用:同调三键随开局下传。
@@ -205,59 +291,66 @@ static func build_adventure_params(save_manager_ref: SaveManagerCore, meta_ref:
# 信号连接只在组合根)
func _start_adventure() -> void:
ui.flow.close(ui.modals.menu.debug_overlay) # 开冒险路径显式关浮窗(调试浮窗默认开态下开局不带窗;对局中经角标再开)
_begin_session(true)
begin_session(true)
_wire_adventure()
run_scope.level_active = true
_sync_status_entry() # 进对局点亮状态面板入口角标
sync_status_entry() # 进对局点亮状态面板入口角标
ui.modals.run.level_screen.set_abandon_available(true) # 放弃入口挂选路停点(天然非战斗期)
ui.battle.log_view.clear()
var seed_val := _seed_value()
var seed_val := seed_value()
logger.start_session(seed_val)
run_scope.adventure.set_hero_override(ui.modals.menu.debug_overlay.atk_pct(), ui.modals.menu.debug_overlay.hp_pct())
# 永久强化注入:冒险开始参数面——meta 现算 override 显式传参(全零 = 白板)
# 开局参数面(同调三键同源构造——确定性承载=固定种子+参数档,首局教学图由种子域三分判定给 42)
if not run_scope.adventure.start_adventure(seed_val, build_adventure_params(save_manager, meta,
{"treasure_unlocked": _treasure_ui.unlocked_set(), "shop_mode": "pool"})):
_fatal_screen("冒险启动失败——见输出日志")
{"treasure_unlocked": treasure_ui().unlocked_set(), "shop_mode": "pool"})):
fatal_screen("冒险启动失败——见输出日志")
return
func _on_adventure_level_started(level_index: int, display_name: String)-> void:
MainAdventureFlow._on_adventure_level_started(self, level_index, display_name)
MainAdventureFlow.on_adventure_level_started(self, level_index, display_name, {
"step_row": _on_step_row,
"round_started": _on_round_started,
"board_changed": _on_board_changed,
"runner_node": _on_runner_node,
"choices_presented": _on_choices_presented,
"wallet_changed": _on_wallet_changed,
})
func _on_runner_node(node: Dictionary, info: Dictionary)-> void:
MainAdventureFlow._on_runner_node(self, node, info)
MainAdventureFlow.on_runner_node(self, node, info)
func _on_adventure_finished(summary: Dictionary)-> void:
MainAdventureFlow._on_adventure_finished(self, summary)
MainAdventureFlow.on_adventure_finished(self, summary)
func _on_battle_end_continue() -> void:
MainAdventureFlow._on_battle_end_continue(self)
MainAdventureFlow.on_battle_end_continue(self)
func _start_debug_levels() -> void:
MainDebugFlow._start_debug_levels(self)
func start_debug_levels() -> void:
MainDebugFlow.start_debug_levels(self)
func _on_debug_battle_created(settlement_ref: BattleOrchestrator, _level: int, _carry: int)-> void:
MainDebugFlow._on_debug_battle_created(self, settlement_ref, _level, _carry)
MainDebugFlow.on_debug_battle_created(self, settlement_ref, _level, _carry)
func _on_debug_battle_ready(settlement_ref: BattleOrchestrator, _level: int, _carry: int)-> void:
MainDebugFlow._on_debug_battle_ready(self, settlement_ref, _level, _carry)
MainDebugFlow.on_debug_battle_ready(self, settlement_ref, _level, _carry)
func _on_inter_next_pressed() -> void:
MainAdventureFlow._on_inter_next_pressed(self)
MainAdventureFlow.on_inter_next_pressed(self)
# 加成生效值供给 / 奖励徽章身份解析 / 地形变异两种解析 —— 见 board_resolvers.gd(有态绑定族判离)
func _show_board_fx_for_node(node_type: String = "") -> void:
func show_board_fx_for_node(node_type: String = "") -> void:
# Boss 遭遇变体:紫赤影子爬棋盘一次性占位演出(§2.6)
if node_type == "boss":
ui.battle.board_zone.fx.play_boss_shadow()
@@ -266,15 +359,15 @@ func _show_board_fx_for_node(node_type: String = "") -> void:
func _on_battle_finished(payload: Dictionary) -> void:
# 仅调试模式接线(冒险的关卡结束归 AdventureRunner._on_level_finished——大奖励/冒险终局分派)
var result: String = String(payload.get("result", ""))
_sync_settlement_visuals() # → 全关(battle_over 反馈面)
sync_settlement_visuals() # → 全关(battle_over 反馈面)
HudPresenter.battle_end_feedback(ui.battle.stage, ui.battle.board_zone.ap_bar, true) # 灰化/idle 回正/RAP 清零/状态全清——HUD 单通道
var decision: Dictionary[Variant, Variant] = _debug.on_battle_finished(payload)
var decision: Dictionary[Variant, Variant] = debug().on_battle_finished(payload)
match String(decision.outcome):
"next_layer":
ui.screens.inter_label.text = "第 %d 层通过!\nHP %d/%d 带入下一层" % [
int(decision.layer), int(decision.carry_hp), int(db.combat.hero.max_hp)]
ui.screens.inter_overlay.visible = true
_refresh_presentations()
refresh_presentations()
return
"level_end":
ui.modals.run.end_overlay.open_victory(Narrator.battle_end_text("victory", true),
@@ -287,7 +380,7 @@ func _on_battle_finished(payload: Dictionary) -> void:
ui.modals.run.end_overlay.open_defeat(Narrator.battle_end_text("defeat", false),
"返回", ui.battle.board_zone.board_view.get_global_rect())
ui.flow.open_after_playback(ui.modals.run.end_overlay)
_refresh_presentations()
refresh_presentations()
# 战利品行装配(battle.md OQ14——胜利总结结算展示 GP 总量+增量;纯呈现读数):
@@ -297,7 +390,7 @@ func _on_battle_finished(payload: Dictionary) -> void:
# resume_adventure 的 bonus_pending 分支在 level_started 之前同步 curio_choice_presented.emit
# 〔resume 提前 return〕,本 lambda 求值时 runner 尚未赋值;合计改读断点快照 gp 兜底——恢复源快照
# 此刻必在档,语义=续玩恢复面的合计即存档合计;承接体见 HudPresenter.gp_summary_text)
func _gp_summary_text(payload: Dictionary) -> String:
func gp_summary_text(payload: Dictionary) -> String:
return HudPresenter.gp_summary_text(payload, run_scope.runner, save_manager)
@@ -306,12 +399,12 @@ func _gp_summary_text(payload: Dictionary) -> String:
## 战末账行束(open_victory opts 键装配单点——GP/钥石/加成三行与增量合计)
func _end_victory_opts(payload: Dictionary) -> Dictionary:
return {"gp_summary": _gp_summary_text(payload),
return {"gp_summary": gp_summary_text(payload),
"ks_summary": "钥石 · 累计 %d" % run_scope.runner.keystone,
"bonus_summary": HudPresenter.bonus_summary_text(run_scope.runner),
"gp_gain": int(payload.get("gp_dropped", 0)), "gp_total": int(run_scope.runner.gp)}
func _wire_battle(settlement_ref: BattleOrchestrator) -> void:
func wire_battle(settlement_ref: BattleOrchestrator) -> void:
settlement_ref.step_row.connect(_on_step_row)
settlement_ref.battle_finished.connect(_on_battle_finished)
settlement_ref.round_started.connect(_on_round_started)
@@ -363,7 +456,7 @@ func _on_round_started(ri: int) -> void:
var vlines: Array[String] = HudPresenter.board_variant_lines(db, bvs)
if not vlines.is_empty():
ui.battle.settlement_fx.play_board_variant_banner("地形变异 · " + " · ".join(vlines))
_refresh_presentations()
refresh_presentations()
func _on_board_changed() -> void:
@@ -376,8 +469,8 @@ func _on_board_changed() -> void:
ui.battle.board_zone.board_view.rebuild(board, run_scope.settlement.minesweeper)
if board != null:
ui.battle.stage.set_board_type(String(board.board_type)) # 舞台背景选图随板(C8——既有重建点单行同步)
_check_board_hints()
_refresh_presentations()
check_board_hints()
refresh_presentations()
# 秘宝视野呈现桥:阔视野带 light_radius_bonus
@@ -392,7 +485,7 @@ func _sync_treasure_glow() -> void:
# ---- 一次性非模态提示(每 run 一次——pattern 10)与诚实提示 ----
func _check_board_hints() -> void:
func check_board_hints() -> void:
var board = run_scope.settlement.minesweeper.current_board()
if board == null:
return
@@ -423,15 +516,15 @@ func _show_hint(text: String, hint_id: String) -> void:
# ---- 节点覆盖层"继续"(奖励/恢复点兑付确认)与节点图选路覆盖层 ----
func _on_node_continue() -> void:
MainAdventureFlow._on_node_continue(self)
MainAdventureFlow.on_node_continue(self)
func _on_choices_presented(candidates: Array)-> void:
MainAdventureFlow._on_choices_presented(self, candidates)
MainAdventureFlow.on_choices_presented(self, candidates)
func _on_route_chosen(node_id: int)-> void:
MainAdventureFlow._on_route_chosen(self, node_id)
MainAdventureFlow.on_route_chosen(self, node_id)
# ---- 独立屏屏级互斥(单一出口:进屏隐战斗屏 / 出屏显战斗屏)----
@@ -439,86 +532,86 @@ func _on_route_chosen(node_id: int)-> void:
# 关闭自动恢复本屏(遮挡语义复用),战斗屏不在此期间回显。
func _enter_level_screen() -> void:
MainAdventureFlow._enter_level_screen(self)
MainAdventureFlow.enter_level_screen(self)
func _exit_level_screen() -> void:
MainAdventureFlow._exit_level_screen(self)
MainAdventureFlow.exit_level_screen(self)
func _on_abandon_requested() -> void:
MainAdventureFlow._on_abandon_requested(self)
MainAdventureFlow.on_abandon_requested(self)
# ---- 最小设置面(入口/开合仿营地先例:开始层互斥;生效与持久化归 SettingsStore)----
func _open_settings() -> void:
MainOverlayFlow._open_settings(self)
func open_settings() -> void:
MainOverlayFlow.open_settings(self)
func _on_settings_closed() -> void:
MainOverlayFlow._on_settings_closed(self)
MainOverlayFlow.on_settings_closed(self)
func _status_data() -> Dictionary:
return MainOverlayFlow._status_data(self)
func status_data() -> Dictionary:
return MainOverlayFlow.status_data(self)
func _open_status_panel() -> void:
MainOverlayFlow._open_status_panel(self)
MainOverlayFlow.open_status_panel(self)
func _on_status_closed() -> void:
MainOverlayFlow._on_status_closed(self)
MainOverlayFlow.on_status_closed(self)
# ---- 生涯页·只读(入口=开始层生涯钮;开合仿设置面先例:开始层互斥;
# 数据快照随开随建零写通路,页内零跳转)----
func _open_career() -> void:
MainOverlayFlow._open_career(self)
MainOverlayFlow.open_career(self)
func _on_career_closed() -> void:
MainOverlayFlow._on_career_closed(self)
MainOverlayFlow.on_career_closed(self)
func _open_save_select() -> void:
MainOverlayFlow._open_save_select(self)
func open_save_select() -> void:
MainOverlayFlow.open_save_select(self)
func _on_save_select_closed() -> void:
MainOverlayFlow._on_save_select_closed(self)
MainOverlayFlow.on_save_select_closed(self)
func _on_save_select_new(slot: int)-> void:
MainOverlayFlow._on_save_select_new(self, slot)
MainOverlayFlow.on_save_select_new(self, slot)
func _on_save_select_load(slot: int)-> void:
MainOverlayFlow._on_save_select_load(self, slot)
MainOverlayFlow.on_save_select_load(self, slot)
func _on_save_select_delete(slot: int)-> void:
MainOverlayFlow._on_save_select_delete(self, slot)
MainOverlayFlow.on_save_select_delete(self, slot)
func _on_status_badge_pressed() -> void:
MainOverlayFlow._on_status_badge_pressed(self)
MainOverlayFlow.on_status_badge_pressed(self)
func _sync_status_entry() -> void:
MainOverlayFlow._sync_status_entry(self)
func sync_status_entry() -> void:
MainOverlayFlow.sync_status_entry(self)
# ---- 探针缝保缝(click/ui_probe 营地段直呼组合根面;实现归 camp_shop_presenter.gd / main_overlay_flow.gd)----
func _on_camp_closed() -> void:
MainOverlayFlow._on_camp_closed(self)
MainOverlayFlow.on_camp_closed(self)
func _on_camp_object_pressed(key: StringName) -> void:
MainOverlayFlow._on_camp_object_pressed(self, key) # 场景点选路由(卡④ T3——薄委托,实现归覆盖层流程承接件)
MainOverlayFlow.on_camp_object_pressed(self, key) # 场景点选路由(卡④ T3——薄委托,实现归覆盖层流程承接件)
# Esc 输入入口(产品码首个键盘入口——卡⑤ T1 契约 9 接线定稿:事件驱动 _unhandled_input、
@@ -529,23 +622,23 @@ func _unhandled_input(event: InputEvent) -> void:
func _on_esc_return() -> void:
MainEscFlow._on_return_to_menu(self)
MainEscFlow.on_return_to_menu(self)
func _on_esc_settings() -> void:
MainEscFlow._on_settings(self)
MainEscFlow.on_settings(self)
func _on_esc_quit() -> void:
MainEscFlow._on_quit(self)
MainEscFlow.on_quit(self)
func _camp_data() -> Dictionary:
return MainOverlayFlow._camp_data(self)
return MainOverlayFlow.camp_data(self)
func _on_wallet_changed(event: String, gp: int, extra: Dictionary)-> void:
MainOverlayFlow._on_wallet_changed(self, event, gp, extra)
MainOverlayFlow.on_wallet_changed(self, event, gp, extra)
# ==================== 玩家意图 → 核心写调用(唯一出口)====================
@@ -565,9 +658,9 @@ func _on_board_action(cell: Vector2i, kind: String) -> void:
return
# 秘宝选中态劫持(两步交互第二步):点格=使用目标拾取,不落挖格;
# 只劫持挖掘点击(move/seal 语义不冲突——选中期玩家仍可移动/封印)
var treasure_sel: int = _treasure_ui.active_selection()
var treasure_sel: int = treasure_ui().active_selection()
if treasure_sel != 0 and kind == "dig":
_treasure_ui.attempt_use(treasure_sel, cell)
treasure_ui().attempt_use(treasure_sel, cell)
return
if run_scope.settlement == null:
return # 入口显式空防护(双保险——锁谓词正常态已挡,防锁判据异常时崩于空引用)
@@ -575,7 +668,7 @@ func _on_board_action(cell: Vector2i, kind: String) -> void:
var accepted: bool = not outcomes.is_empty() and bool(outcomes[0].accepted)
logger.log_action(kind, cell, accepted)
if run_scope.runner != null and run_scope.runner.treasure_inventory != null:
_treasure_ui.refresh_slots() # 授予发生在 settle_batch 结算段内(同步走完,行尾重查)
treasure_ui().refresh_slots() # 授予发生在 settle_batch 结算段内(同步走完,行尾重查)
_handle_outcome_feedback(outcomes[0] if not outcomes.is_empty() else {})
# settle_batch 内部同步走完 结算→战斗结束→关卡推进(事件同步发射)——关卡终局时 settlement 已被
# runner 置空,清图演出判定须先判 settlement(重入隐患守卫)
@@ -591,7 +684,7 @@ func _on_board_action(cell: Vector2i, kind: String) -> void:
elif accepted and kind == "move":
ui.battle.board_zone.board_view.notify_hero_move() # 原地移动(目标=当前格幂等受理)帧闪回执——refresh diff 前置告知
ui.battle.board_zone.board_view.refresh()
_refresh_presentations()
refresh_presentations()
func _on_stop_pressed() -> void:
@@ -607,7 +700,7 @@ func _on_stop_pressed() -> void:
ui.battle.board_zone.toast.show_toast("本轮已清图,停手未执行 · 剩余 AP 已作废", "warn")
logger.log_ux("ux_reject", {"source": "voided", "sub_reason": "stop_voided"})
ui.battle.board_zone.board_view.refresh()
_refresh_presentations()
refresh_presentations()
func _on_refresh_confirmed() -> void:
@@ -635,7 +728,7 @@ func _on_refresh_confirmed() -> void:
else:
ui.battle.board_zone.toast.show_toast("本轮刷新次数已用完(每轮 %d 次)" % int(db.run.action_economy.refresh_cap_per_round), "warn")
ui.battle.board_zone.board_view.refresh()
_refresh_presentations()
refresh_presentations()
func _handle_outcome_feedback(outcome: Dictionary) -> void:
@@ -659,15 +752,15 @@ func _refresh_used_snapshot() -> int:
return int(run_scope.settlement.presentation_snapshot().get("refresh_used", 0))
func _refresh_presentations() -> void:
func refresh_presentations() -> void:
# 每个核心信号/写调用返回后的全量重查装配(更新触发注记——无推送信号,命令式重查)
var refresh_remaining: int = maxi(0, int(db.run.action_economy.refresh_cap_per_round) - _refresh_used_snapshot())
HudPresenter.refresh(ui.battle.stage, ui.battle.info_panel, ui.battle.board_zone.ap_bar, {"settlement": run_scope.settlement, "runner": run_scope.runner, "level_active": run_scope.level_active, "db": db, "refresh_remaining": refresh_remaining})
_treasure_ui.refresh_slots() # C 区秘宝槽重查(试炼镐积点进度随挖格刷新悬停浮窗)
_sync_settlement_visuals()
treasure_ui().refresh_slots() # C 区秘宝槽重查(试炼镐积点进度随挖格刷新悬停浮窗)
sync_settlement_visuals()
func _sync_settlement_visuals() -> void:
func sync_settlement_visuals() -> void:
# 结算阶段(round_end → 下一轮):D 区去饱和+金橙偏移锁输入(明度不变)+ 明细带展开(高度读 battle_layout)
var settling := _is_settling()
if settling and not run_scope.was_settling:
@@ -697,56 +790,56 @@ func _is_settling() -> bool:
# ==================== B 区明细带 / 图例(模态入口)====================
func _on_legend_toggled() -> void:
MainOverlayFlow._on_legend_toggled(self)
MainOverlayFlow.on_legend_toggled(self)
# ==================== 诊断转储(卡死时点击——全量核心状态 + 环形缓冲)====================
func _on_diagnose_pressed() -> void:
MainDebugFlow._on_diagnose_pressed(self)
MainDebugFlow.on_diagnose_pressed(self)
# ==================== 调试浮窗(开合/应用/模拟编排由组合根承接)====================
func _show_debug_overlay() -> void:
MainDebugFlow._show_debug_overlay(self)
MainDebugFlow.show_debug_overlay(self)
func _on_debug_badge_pressed() -> void:
MainDebugFlow._on_debug_badge_pressed(self)
MainDebugFlow.on_debug_badge_pressed(self)
func _sync_debug_overlay() -> void:
MainDebugFlow._sync_debug_overlay(self)
func sync_debug_overlay() -> void:
MainDebugFlow.sync_debug_overlay(self)
func _debug_run_data() -> Dictionary:
return MainDebugFlow._debug_run_data(self)
return MainDebugFlow.debug_run_data(self)
# 本局种子现值(只读单点——当局数据区块与诊断转储共用):冒险=adventure.master_seed 访问器现值;
# 调试两层=RNG 服务 master_seed。禁 _seed_value() 重算冒充本局种子。
func _current_master_seed() -> int:
# 调试两层=RNG 服务 master_seed。禁 seed_value() 重算冒充本局种子。
func current_master_seed() -> int:
if run_scope.adventure != null:
return int(run_scope.adventure.master_seed)
return int(get_node(AUTOLOAD_PATH_RNG).master_seed)
func _close_debug_overlay() -> void:
MainDebugFlow._close_debug_overlay(self)
MainDebugFlow.close_debug_overlay(self)
func _on_tune_apply(atk_pct: int, hp_pct: int)-> void:
MainDebugFlow._on_tune_apply(self, atk_pct, hp_pct)
MainDebugFlow.on_tune_apply(self, atk_pct, hp_pct)
func _on_tune_simulate(n: int)-> void:
MainDebugFlow._on_tune_simulate(self, n)
MainDebugFlow.on_tune_simulate(self, n)
# ==================== 工具 ====================
func _seed_value() -> int:
func seed_value() -> int:
# 种子三分判定单点(全工程唯一种子框读取处,禁第二处读框):
# ①显式合法整数全场景优先(含首局——测试/调试接口显式指定;第五路 DebugSession Callable
# 经本函数=调试对局与玩家同口径);