补提交(布局几何单点化批·代码面+工具面+architecture行·跨会话遗留): battle_layout.tres 新表单行五字段(stage_h/info_panel_w/ap_bar_h/log_band_h_dig/log_band_h_settle)经 schema battle_layout_table.gd+域容器 config_domain_presentation.gd 收进 ConfigDb.presentation(ConfigDB 三容器→四容器,manifest 增 battle_layout 键,B区高度裁决 2026-10-30 用户裁=取代码标准 stage_h);views 五件构造签名增 layout 参(BattleStageView/HeroInfoPanelView/BoardZoneView/ApBarView/BattleLogView 常量高度改表值驱动)+ui_assembler 装配传 layout+probes 两件改址+main.gd 结算带注释去数值;tools/layout_config.py 新件+render_sample_sheet 两版读布局表现算(样张工具面);文档面: architecture.md ConfigDB 行换代(四容器成员 7/7/5/1、类变量 10)+HUD框架.md 三区表/装板不等式/调参表去数值化改指布局表+数据配置.md+interaction-patterns.md 明细带句去数值(battle.md 区表与待办清单登记面已随 1cdef6ba 在库);消费漏网 L1 就地补改九处(构造签名换型与 iter45 断点件收编的测试改址漏网,判据零变化): theme_projection_test:386/player_copy_sweep_test:44,98/adventure_feats_test:772/standee_fx_sweep_test:75/feat_vouchers_test:292 六处补 layout 实参,adventure_feats_test:791/level_shop_economy_test:1480/feat_vouchers_test:81 三处断点成员直读改经 a._bp_store(iter45卡②六成员搬移漏网,02 闸合回后首全量暴露);load_tables 超函数长键清偿(容器装配块抽 _assign_loaded 私有协函数——表行按域收进四容器+resolver 注入单一职责,与 _cross_validate 委托先例同型,S13 新增红修至基线口径内);窄验: 四件修复套件单跑全绿+gdstyle 基线外新违规 0
This commit is contained in:
1 parent
39907d82f6
commit
4b174877be
29 files changed
+231
-118
No files matched your search
@@ -634,7 +634,7 @@ func _refresh_presentations() -> void:
|
||||
|
||||
|
||||
func _sync_settlement_visuals() -> void:
|
||||
# 结算阶段(round_end → 下一轮):D 区去饱和+金橙偏移锁输入(明度不变)+ 明细带展开 84px
|
||||
# 结算阶段(round_end → 下一轮):D 区去饱和+金橙偏移锁输入(明度不变)+ 明细带展开(高度读 battle_layout)
|
||||
var settling := _is_settling()
|
||||
if settling and not run_scope.was_settling:
|
||||
ui.battle.settlement_fx.play_round_sweep(ui.battle.board_zone.board_view.get_global_rect()) # 结算轮光带——时序敏感演出触发,例外留在组合根
|
||||
|
||||
@@ -6,8 +6,8 @@ extends RefCounted
|
||||
|
||||
|
||||
# 战斗屏三区(B 战斗画面 / C·D 两列——节点链
|
||||
# 进度由关卡画面本体(选路覆盖层整图)承载,28px 纵向空间拨给 C/D 底行 520→548;
|
||||
# 无顶栏进度条、无道具面板区)。
|
||||
# 进度由关卡画面本体(选路覆盖层整图)承载,纵向空间归 C/D 底行;
|
||||
# 无顶栏进度条、无道具面板区)。分区几何读 ConfigDb.presentation.battle_layout。
|
||||
# + 结算演出覆盖层(A–D 之上、模态之下——跨区弹道/光带载体)。
|
||||
# 返回句柄字典:{stage, log_view, info_panel, board_zone, board_view, ap_bar, settlement_fx}
|
||||
# (返回句柄不含 gp_label/keystone_label——GP/钥石不在战斗屏呈现)
|
||||
@@ -17,20 +17,22 @@ static func build_battle_ui(root: Control, db: ConfigDb) -> Dictionary:
|
||||
root.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||
root.add_theme_constant_override("separation", 0)
|
||||
|
||||
# B 区:战斗画面(全宽 × 252px——常驻双舞台,布局决策 D1)
|
||||
var stage := BattleStageView.new(db)
|
||||
var layout: BattleLayoutTable = db.presentation.battle_layout
|
||||
|
||||
# B 区:战斗画面(全宽 × battle_layout.stage_h——常驻双舞台,布局决策 D1)
|
||||
var stage := BattleStageView.new(db, layout)
|
||||
root.add_child(stage)
|
||||
|
||||
# C/D 两列(548px——含顶栏让出的 28px 纵向空间)
|
||||
# C/D 两列(高度 = 基座高 − B 区高——底行承载)
|
||||
var bottom := HBoxContainer.new()
|
||||
bottom.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
bottom.add_theme_constant_override("separation", 4)
|
||||
root.add_child(bottom)
|
||||
|
||||
var info_panel := HeroInfoPanelView.new()
|
||||
var info_panel := HeroInfoPanelView.new(layout)
|
||||
bottom.add_child(info_panel)
|
||||
|
||||
var board_zone := BoardZoneView.new()
|
||||
var board_zone := BoardZoneView.new(layout)
|
||||
bottom.add_child(board_zone)
|
||||
board_zone.ap_bar.set_refresh_cost(int(db.run.action_economy.rap_refresh_cost)) # RAP 读数表值驱动
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@ var _arm_timer := ArmedTimer.new() # 弃图刷新确认窗(T3/D3 P4 乙—
|
||||
const REFRESH_CONFIRM_WINDOW_S := 4.0 # 弃图刷新确认窗(原 tween_interval 字面量升常量——语义零变化)
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
custom_minimum_size = Vector2(0, 44)
|
||||
func _init(layout: BattleLayoutTable) -> void:
|
||||
custom_minimum_size = Vector2(0, layout.ap_bar_h)
|
||||
_arm_timer.expired.connect(_disarm)
|
||||
var sb := UiKit.panel_flat(UiKit.PANEL_DATA, UiKit.PANEL_BORDER, 0, 1, Vector4(8, 4, 8, 4))
|
||||
add_theme_stylebox_override("panel", sb)
|
||||
|
||||
@@ -4,12 +4,12 @@ class_name BattleLogView
|
||||
extends PanelContainer
|
||||
|
||||
|
||||
const BAND_H_DIG := 24
|
||||
const BAND_H_SETTLE := 84
|
||||
const AGG_TYPES := ["reward_ineffective"]
|
||||
const COL_GOLD := UiKit.HEX_GOLD
|
||||
|
||||
var _db
|
||||
var _band_h_dig := 0
|
||||
var _band_h_settle := 0
|
||||
var _log: RichTextLabel
|
||||
var _summary: Label
|
||||
var _hint: Label
|
||||
@@ -18,9 +18,11 @@ var _round_rows: Array[String] = [] # 本结算轮行缓冲(上轮摘要
|
||||
var _pending_agg := {} # 聚合计数行 pending(type+batch_key → {row, count})
|
||||
|
||||
|
||||
func _init(db_ref) -> void:
|
||||
func _init(db_ref, layout: BattleLayoutTable) -> void:
|
||||
_db = db_ref
|
||||
custom_minimum_size = Vector2(0, BAND_H_DIG)
|
||||
_band_h_dig = layout.log_band_h_dig
|
||||
_band_h_settle = layout.log_band_h_settle
|
||||
custom_minimum_size = Vector2(0, _band_h_dig)
|
||||
size_flags_vertical = Control.SIZE_SHRINK_END
|
||||
var vb := VBoxContainer.new()
|
||||
vb.add_theme_constant_override("separation", 2)
|
||||
@@ -29,7 +31,7 @@ func _init(db_ref) -> void:
|
||||
vb.add_child(head)
|
||||
# 明细条灰字对深灰底实测 2.63:1 → 暗底双色墨制=暖白族
|
||||
_summary = UiKit.label("",UiKit.FS_BODY, false, UiKit.WARM)
|
||||
_summary.custom_minimum_size = Vector2(0, BAND_H_DIG - 4)
|
||||
_summary.custom_minimum_size = Vector2(0, _band_h_dig - 4)
|
||||
_summary.clip_text = true
|
||||
_summary.text_overrun_behavior = TextServer.OVERRUN_TRIM_ELLIPSIS
|
||||
head.add_child(_summary)
|
||||
@@ -39,7 +41,7 @@ func _init(db_ref) -> void:
|
||||
_log = RichTextLabel.new()
|
||||
_log.bbcode_enabled = true
|
||||
_log.scroll_following = true
|
||||
_log.custom_minimum_size = Vector2(0, BAND_H_SETTLE - 26)
|
||||
_log.custom_minimum_size = Vector2(0, _band_h_settle - 26)
|
||||
_log.clip_contents = true
|
||||
_log.scroll_active = true
|
||||
vb.add_child(_log)
|
||||
@@ -53,7 +55,7 @@ func set_mode(mode: String) -> void:
|
||||
var settle := mode == "settle"
|
||||
_log.visible = settle
|
||||
_summary.visible = not settle
|
||||
custom_minimum_size = Vector2(0, BAND_H_SETTLE if settle else BAND_H_DIG)
|
||||
custom_minimum_size = Vector2(0, _band_h_settle if settle else _band_h_dig)
|
||||
|
||||
|
||||
func mode() -> String:
|
||||
|
||||
@@ -24,11 +24,11 @@ var _viewport: SubViewport
|
||||
var world: Node2D # StageWorld(preload 脚本实例——Node2D 世界根/字体挂点)
|
||||
|
||||
|
||||
func _init(db_ref) -> void:
|
||||
custom_minimum_size = Vector2(0, 252)
|
||||
func _init(db_ref, layout: BattleLayoutTable) -> void:
|
||||
custom_minimum_size = Vector2(0, layout.stage_h)
|
||||
_build_backdrop()
|
||||
_build_world_stage()
|
||||
_build_text_half(db_ref)
|
||||
_build_text_half(db_ref, layout)
|
||||
_build_companion_layer(db_ref)
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ func _build_world_stage() -> void:
|
||||
|
||||
|
||||
## Control 文本半区域(round_label / stage_center / log_view 原样保留——C1 永久 Control)
|
||||
func _build_text_half(db_ref) -> void: # type-hint: ignore(db 鸭子型注入——单测以最小 stub 构造)
|
||||
func _build_text_half(db_ref, layout: BattleLayoutTable) -> void: # type-hint: ignore(db 鸭子型注入——单测以最小 stub 构造)
|
||||
var vb := VBoxContainer.new()
|
||||
vb.add_theme_constant_override("separation", 4)
|
||||
vb.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
@@ -86,7 +86,7 @@ func _build_text_half(db_ref) -> void: # type-hint: ignore(db 鸭子型注入
|
||||
add_child(vb)
|
||||
_build_narr_row(vb)
|
||||
_build_center_row(vb)
|
||||
log_view = BattleLogView.new(db_ref)
|
||||
log_view = BattleLogView.new(db_ref, layout)
|
||||
vb.add_child(log_view)
|
||||
|
||||
|
||||
|
||||
@@ -18,17 +18,17 @@ signal hover_forbidden(cell: Vector2i)
|
||||
signal chord_attempted(cell: Vector2i)
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
func _init(layout: BattleLayoutTable) -> void:
|
||||
size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
var vb := VBoxContainer.new()
|
||||
vb.add_theme_constant_override("separation", 4)
|
||||
add_child(vb)
|
||||
_build_views(vb)
|
||||
_build_views(vb, layout)
|
||||
|
||||
|
||||
## 视图三件域:AP 条+棋盘区(含动效与 toast 叠层)
|
||||
func _build_views(vb: VBoxContainer) -> void:
|
||||
ap_bar = ApBarView.new()
|
||||
func _build_views(vb: VBoxContainer, layout: BattleLayoutTable) -> void:
|
||||
ap_bar = ApBarView.new(layout)
|
||||
vb.add_child(ap_bar)
|
||||
var board_area := Control.new()
|
||||
board_area.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
|
||||
@@ -21,8 +21,8 @@ var _board_variant_section: VBoxContainer # 地形变异常驻角标(空态
|
||||
var _board_variant_list: VBoxContainer
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
custom_minimum_size = Vector2(240, 0)
|
||||
func _init(layout: BattleLayoutTable) -> void:
|
||||
custom_minimum_size = Vector2(layout.info_panel_w, 0)
|
||||
clip_contents = true
|
||||
# 主面板穿石板戏服(纹理本色;数据框仍素面 §7.1;缺位回退 flat)
|
||||
var sb := UiKit.panel_skinned(Vector4(8, 6, 8, 6))
|
||||
|
||||
Reference in new issue
Block a user