- 四view新件(自CampOverlay承载面迁移,界面逻辑复用零重设计契约4): forge_view(钥匙门+两区六路线行板)/treasure_view(12件行板+同调装配段+Y升级行+钥匙门)/tree_view(脉分组行板+Fork双态)/codex_view(占位挂起壳,锁文随形态订正『柜台』称谓L2)——各带返回钮发closed(关层归presenter);公共壳CampSubViewBase(实底dim+铭牌+钥石徽+返回钮) - CampRefreshBus新件: 各写口尾→现开界面刷新+场景根HUD一闸(卡⑤HUD同口挂接;非autoload非信号广播——组合根单点推送);presenter八写口尾refresh_camp→bus.refresh(F9:七口+on_camp_buy双尾) - 承载形态(§9-2拍板): 单一内页切换=场景根留底——模态栈open只隐上方登记层(modal_stack.gd:27实测),四子界面登记于场景根之上且实底遮挡,双开互斥靠遮挡天然成立;V2断言按留底派生(T5落) - ui_registry: LAYER_CONTRACT camp_overlay槽→camp_scene(shell camp_screen)+forge/treasure/tree/codex_view四槽;node()改经modals.camp.X二层(卡⑥契约2);ui_camp_modals五枚成员(overlay枚随退役删除——卡⑥契约4) - camp_screen: 持camp_scene取代CampOverlay成员;main_ui_build: 场景装配(布局表ConfigDB注入)+四view实例化+信号接线(意图→presenter/closed bind携视图/object_pressed→组合根路由) - presenter承接面: 五目标改线(ctx.views束——成员预算12≤15)+open_camp_forge/treasure/tree/codex四开层口+on_camp_sub_closed+on_camp_closed关层收闭(营地层与选档层同收+开始层恢复);main_overlay_flow._on_camp_object_pressed五物件路由(gate/campfire归T4)+生涯营地语境关层分支(笔记本改挂——CareerOverlay本体零改);main.gd薄委托零新增成员 - 退役: camp_overlay_view.gd删除(吸收即死);旧形态断言同批摘除(test-conventions §5.5):theme_projection等高源码断言+最近冒险行投影段(卡面削弱申报授权:注销,条带Q4=甲撤下) - 同批迁移: forge_workbench_test承载类camp_overlay_view→forge_view+_forge._X扁平化(断言零改12项绿);system_test三处机械随迁(V2实例化/:108同一性链/:121候选清单——camp_scene句柄更名) - 验证: 冒烟boot PASS(15项0失败——装配全链通)+全流程孤检绿(12项:五句柄/铺层/点选路由四子界面/返回/生涯改挂/营地语境分支/关层收闭——临时件不入库);S9/S10/S13归基线(codex头注日期清偿/_build_shell超局部变量按顶栏底栏拆)
87 lines
3.6 KiB
GDScript
87 lines
3.6 KiB
GDScript
## 营地子界面模态壳基类(锻造工坊/秘宝匣/天赋树/奖励格图鉴四子界面公共形态):
|
|
## 实底全屏暖亮档+石纹暗角+顶栏(铭牌+钥石徽)+内容列+底栏返回钮。
|
|
## 开合可见性归模态栈(登记层开合一律走栈);返回钮只发 closed——关层编排归 presenter(组合根单口)。
|
|
## 余额徽随子类 refresh_camp 刷新(钥石读数=投影单口,禁第二账本)。
|
|
class_name CampSubViewBase
|
|
extends Control
|
|
|
|
signal closed
|
|
|
|
var _balance_label: Label # 钥石徽数值行(探针直读面——ui_probe 余额文案断言改指新界面)
|
|
|
|
|
|
## 壳构建(子类 _init 调用一次):content 由子类先建好传入(列容器/滚动容器皆可)
|
|
func _build_shell(title: String, icon_path: String, content: Control) -> void:
|
|
# 实底暖亮档(半透 dim 会透出底下场景图——CampOverlay 同案;遮蔽语义由组合根输入锁兜底)
|
|
var dim := UiKit._modal_dim(self, UiKit.BG_BRIGHT)
|
|
var bd := UiKit.backdrop_tile()
|
|
if bd != null:
|
|
dim.add_child(bd)
|
|
dim.add_child(UiKit.vignette_rect())
|
|
var margin := MarginContainer.new()
|
|
margin.set_anchors_preset(Control.PRESET_FULL_RECT)
|
|
margin.add_theme_constant_override("margin_left", 16)
|
|
margin.add_theme_constant_override("margin_right", 16)
|
|
margin.add_theme_constant_override("margin_top", 12)
|
|
margin.add_theme_constant_override("margin_bottom", 12)
|
|
dim.add_child(margin)
|
|
var col := VBoxContainer.new()
|
|
col.add_theme_constant_override("separation", 8)
|
|
margin.add_child(col)
|
|
_build_top_bar(col, title, icon_path)
|
|
content.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
|
col.add_child(content)
|
|
_build_bottom_bar(col)
|
|
visible = false # 登记模态初始隐(开合走栈)
|
|
|
|
|
|
## 顶栏域:铭牌(标题)+钥石徽(余额徽单点——子类 refresh_camp 刷新数值行)
|
|
func _build_top_bar(col: VBoxContainer, title: String, icon_path: String) -> void:
|
|
var top := HBoxContainer.new()
|
|
top.add_theme_constant_override("separation", 10)
|
|
col.add_child(top)
|
|
var plaque := PanelContainer.new()
|
|
plaque.add_theme_stylebox_override("panel",
|
|
UiKit.panel_flat(UiKit.PANEL_DATA, UiKit.PANEL_BORDER, UiKit.RADIUS_OBJECT, 1, Vector4(14, 8, 14, 8)))
|
|
top.add_child(plaque)
|
|
var head := HBoxContainer.new()
|
|
head.add_theme_constant_override("separation", 6)
|
|
plaque.add_child(head)
|
|
if icon_path != "":
|
|
var ic := UiKit.icon_rect(icon_path, 32) # 头带图标缺位 null → 纯文本回退
|
|
if ic != null:
|
|
head.add_child(ic)
|
|
head.add_child(UiKit.label(title, UiKit.FS_TITLE, true, UiKit.INK_TITLE))
|
|
var spacer := Control.new()
|
|
spacer.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
|
top.add_child(spacer)
|
|
var badge := UiKit.keystone_badge("钥石 0") # UiKit 工厂单点(烛光黄底深墨字)
|
|
top.add_child(badge)
|
|
_balance_label = badge.value_label
|
|
|
|
|
|
## 底栏域:返回营地钮(closed 信号——关层编排归 presenter)
|
|
func _build_bottom_bar(col: VBoxContainer) -> void:
|
|
var bottom := HBoxContainer.new()
|
|
bottom.add_theme_constant_override("separation", 10)
|
|
col.add_child(bottom)
|
|
var back := UiKit.button("返回营地")
|
|
back.pressed.connect(_emit_closed)
|
|
bottom.add_child(back)
|
|
var spacer2 := Control.new()
|
|
spacer2.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
|
bottom.add_child(spacer2)
|
|
|
|
|
|
func open_camp(data: Dictionary) -> void:
|
|
refresh_camp(data)
|
|
visible = true # 开可见性由栈承载(本行为开层数据投喂的收尾拍)
|
|
|
|
|
|
func refresh_camp(data: Dictionary) -> void:
|
|
pass # 子类覆写(余额徽刷新+各自行板/门判据)
|
|
|
|
|
|
func _emit_closed() -> void:
|
|
closed.emit()
|