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

+37 -37
View File
@@ -4,11 +4,11 @@
## 全部开合走组合根模态编排口(root.ui.flow.open/close);本件零成员态。
extends RefCounted
static func _open_settings(root: Variant) -> void:
static func open_settings(root: Variant) -> void:
root.ui.screens.start_overlay.visible = false
root.ui.flow.open(root.ui.modals.menu.settings_overlay) # 模态栈单口
static func _on_settings_closed(root: Variant) -> void:
static func on_settings_closed(root: Variant) -> void:
root.ui.flow.close(root.ui.modals.menu.settings_overlay) # 模态栈单口
# 语境分支(卡⑤ 契约 3——谓词=camp_esc_overlay.visible,谁开的设置谁收):
# 营地浮窗路径关设置回浮窗不回主菜单(栈语义:浮窗登记在下、由树序遮挡非属性隐藏);
@@ -25,24 +25,24 @@ static func _on_settings_closed(root: Variant) -> void:
# 八键换代(迭代 36 卡③):跨关解锁概览退役(营地/生涯承载)——只留本局信息;
# ledger 直取下标(键缺失=致命,禁 .get 缺省留门——fail-fast 红线);禁 null 守卫软回退
# (两入口开层时 runner 恒在役——状态面板卡 F3 证据链)
static func _status_data(root: Variant) -> Dictionary:
return HudPresenter.status_data(root.db, root.meta, root.run_scope.runner, root._treasure_ui)
static func status_data(root: Variant) -> Dictionary:
return HudPresenter.status_data(root.db, root.meta, root.run_scope.runner, root.treasure_ui())
static func _open_status_panel(root: Variant) -> void:
static func open_status_panel(root: Variant) -> void:
root.ui.flow.open(root.ui.modals.run.status_panel) # 模态栈单口(开层前排空排播队列——既有层同款行为,目检确认项)
root.ui.modals.run.status_panel.open_status(_status_data(root))
root.ui.modals.run.status_panel.open_status(status_data(root))
static func _on_status_closed(root: Variant) -> void:
static func on_status_closed(root: Variant) -> void:
root.ui.flow.close(root.ui.modals.run.status_panel) # 模态栈单口
static func _open_career(root: Variant) -> void:
static func open_career(root: Variant) -> void:
root.ui.screens.start_overlay.visible = false
root.ui.flow.open(root.ui.modals.menu.career_overlay) # 模态栈单口
root.ui.modals.menu.career_overlay.open_career(HudPresenter.career_data(root.db, root.save_manager, root.meta))
static func _on_career_closed(root: Variant) -> void:
static func on_career_closed(root: Variant) -> void:
root.ui.flow.close(root.ui.modals.menu.career_overlay) # 模态栈单口
if not root.ui.modals.camp.scene.visible: # 营地语境关生涯不回开始层(笔记本入口——卡④ T3;栈已复现场景根)
root.ui.screens.start_overlay.visible = true
@@ -54,32 +54,32 @@ static func _on_career_closed(root: Variant) -> void:
# 篝火回主菜单必须二次确认(camp.md v2.2 裁定);确认后营地层与选档层同收+开始层恢复(关层收闭)。
static func _on_camp_object_pressed(root: Variant, key: StringName) -> void:
static func on_camp_object_pressed(root: Variant, key: StringName) -> void:
match key:
&"forge":
root._camp_pres.open_camp_forge()
root.camp_pres().open_camp_forge()
&"chest":
root._camp_pres.open_camp_treasure()
root.camp_pres().open_camp_treasure()
&"dummy":
root._camp_pres.open_camp_tree()
root.camp_pres().open_camp_tree()
&"board":
root._camp_pres.open_camp_codex()
root.camp_pres().open_camp_codex()
&"notebook":
_open_career(root) # 生涯页入口改挂帐篷旁笔记本(CareerOverlay 本体零改——卡④ T3)
open_career(root) # 生涯页入口改挂帐篷旁笔记本(CareerOverlay 本体零改——卡④ T3)
&"gate":
_open_gate_confirm(root)
&"campfire":
root._confirm_consumer = "campfire_leave"
root.set_confirm_consumer("campfire_leave")
root.ui.modals.menu.confirm_dialog.open("确定离开营地回到主菜单?", "离开", "留下")
static func _open_gate_confirm(root: Variant) -> void:
if root.save_manager.has_breakpoint():
root._confirm_consumer = "gate"
root.set_confirm_consumer("gate")
root.ui.modals.menu.confirm_dialog.open_three("有未完成的冒险——继续上一段冒险,还是开始新冒险?",
"继续上一段冒险", "开始新冒险", "取消")
return
root._confirm_consumer = "gate_new"
root.set_confirm_consumer("gate_new")
root.ui.modals.menu.confirm_dialog.open("是否开始新冒险?", "是", "否")
@@ -91,12 +91,12 @@ static func _open_gate_confirm(root: Variant) -> void:
# 开层(模态栈单口;与开始层互斥=career 同款先例)。「进入存档」钮归卡② mn3——本函数为
# 该钮的唯一落点(卡③ 批内探针函数直调=中间态,实现报告「已知中间态」登记)。
static func _open_save_select(root: Variant) -> void:
static func open_save_select(root: Variant) -> void:
root.ui.screens.start_overlay.visible = false
root.ui.flow.open(root.ui.modals.menu.save_select_overlay) # 模态栈单口
root.ui.modals.menu.save_select_overlay.open_save_select(HudPresenter.save_select_data(root.save_manager))
static func _on_save_select_closed(root: Variant) -> void:
static func on_save_select_closed(root: Variant) -> void:
root.ui.flow.close(root.ui.modals.menu.save_select_overlay) # 模态栈单口
root.ui.screens.start_overlay.visible = true
@@ -107,24 +107,24 @@ static func _on_save_select_closed(root: Variant) -> void:
# 空槽新档链(卡④ T3 换代:落点=营地场景根——CampOverlay 随四柜台拆解退役):卡① 创建=激活=白板落盘,
# 落点开层。动线序(禁先关后开):先落点开层(开始层保持隐藏),选档层被模态栈遮挡隐藏、不关闭。
static func _on_save_select_new(root: Variant, slot: int) -> void:
static func on_save_select_new(root: Variant, slot: int) -> void:
root.save_manager.slots.create_slot(slot)
root._camp_pres.open_camp()
root.camp_pres().open_camp()
# 有档槽进档链(契约 8 进档即激活):卡① 激活+读盘(兜底/拒读链按槽成立)→落点=营地场景根(卡④ T3)。
static func _on_save_select_load(root: Variant, slot: int) -> void:
static func on_save_select_load(root: Variant, slot: int) -> void:
root.save_manager.slots.activate_slot(slot)
root._camp_pres.open_camp()
root.camp_pres().open_camp()
# 删档链(契约 3):第一次点击只出确认窗(消费方编排——open 前设消费方=delete_slot),
# 确认才删、取消不删;禁长按删/一次点击即删/撤销式软删。
static func _on_save_select_delete(root: Variant, slot: int) -> void:
root._confirm_consumer = "delete_slot"
root._confirm_consumer_slot = slot
static func on_save_select_delete(root: Variant, slot: int) -> void:
root.set_confirm_consumer("delete_slot")
root.set_confirm_consumer_slot(slot)
root.ui.flow.open(root.ui.modals.menu.confirm_dialog) # 模态栈单口(显示编排/挂起兜底/遮挡记账——与其余覆盖层同口)
root.ui.modals.menu.confirm_dialog.open("删除存档位 %d?删除后该档不可恢复。" % slot, "删除", "取消")
@@ -132,20 +132,20 @@ static func _on_save_select_delete(root: Variant, slot: int) -> void:
# 入口角标点击(两屏同款处理器):P1 守卫兜底——其他模态开着即拒开(常态防线=角标置灰,
# 探针 pressed.emit 绕过 disabled 时由此兜住;地图屏自身的登记开态不计——has_open_excluding)
static func _on_status_badge_pressed(root: Variant) -> void:
static func on_status_badge_pressed(root: Variant) -> void:
var map_on: bool = root.ui.modals.run.level_screen != null and root.ui.modals.run.level_screen.visible
# P1 守卫兜底——其他模态开着即拒开(常态防线=角标置灰,探针 pressed.emit 绕过 disabled 时由此兜住;
# 地图屏自身的登记开态不计;判据排除调试浮窗:对局中浮窗开着时状态角标仍可点)
if (map_on and root.ui.flow.badge_greyed_map()) or (not map_on and root.ui.flow.badge_greyed_battle()):
return
_open_status_panel(root)
open_status_panel(root)
# 入口角标可见性/置灰同步(P1 丁+守卫——单一同步点):战斗屏角标=对局内且地图屏未激活;
# 地图屏角标=随屏;置灰=登记册上除地图屏自身外任一层开着(防「看得见点不着」态)。
# 调用面=模态开合单口与屏级互斥口(凡影响开态/屏态的路径必经其一)。
static func _sync_status_entry(root: Variant) -> void:
static func sync_status_entry(root: Variant) -> void:
if root.ui.modals.run.status_panel == null or root.ui.flow == null or root.ui.battle.board_zone == null or root.ui.modals.run.level_screen == null:
return
var map_on: bool = root.ui.modals.run.level_screen.visible
@@ -160,13 +160,13 @@ static func _sync_status_entry(root: Variant) -> void:
static func _on_camp_closed(root: Variant) -> void:
root._camp_pres.on_camp_closed()
static func on_camp_closed(root: Variant) -> void:
root.camp_pres().on_camp_closed()
static func _camp_data(root: Variant) -> Dictionary:
return HudPresenter.camp_data(root._camp_pres)
static func camp_data(root: Variant) -> Dictionary:
return HudPresenter.camp_data(root.camp_pres())
static func _on_wallet_changed(root: Variant, event: String, gp: int, extra: Dictionary) -> void:
static func on_wallet_changed(root: Variant, event: String, gp: int, extra: Dictionary) -> void:
# wallet 行族转发(到账/购买/清零——试玩日志验收取数面)+ 常驻余额与在开商店覆盖层重刷
root.logger.log_wallet(event, gp, extra)
if String(event) == "gain":
@@ -176,11 +176,11 @@ static func _on_wallet_changed(root: Variant, event: String, gp: int, extra: Dic
root.ui.modals.menu.shop_overlay.refresh_shelf_state(int(root.run_scope.runner.gp)) # pool 面余额联动(货架内容仅买后重抽变)
else:
root.ui.modals.menu.shop_overlay.refresh_state(root.run_scope.runner.shop.shop_products(), int(root.run_scope.runner.gp))
root._refresh_presentations()
root.refresh_presentations()
static func _on_legend_toggled(root: Variant) -> void:
static func on_legend_toggled(root: Variant) -> void:
if root.ui.modals.run.legend_overlay.is_open():
root.ui.flow.close(root.ui.modals.run.legend_overlay)
else: