feat(m67-a): settlement pages on the shared parchment family with a strict probe
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
# M67 · DEV-5R 结果 / 恢复 / 击倒复检 / 奖励迁移计划
|
||||
|
||||
> 权威:`GOAL_ABG_MVP_QUALITY.md` + AGENTS.md「UI Restoration Memory」。
|
||||
> 前置:M66/DEV-4R 已收官(队伍线/风险三页 + 严格探针)。
|
||||
|
||||
## Player-visible stopping point
|
||||
|
||||
`battle_result_page_view`、`recovery_page_view`、`knockout_review_page_view`、
|
||||
`reward_choice_page_view` 四页在**单一 1280×720** 下:页框改为共享羊皮纸族、文案走共享令牌、
|
||||
节点名与 intents 不变,且新增**严格墨迹探针**(`scanned=24 violations=0`)通过。
|
||||
|
||||
## Measured facts (2026-09-14, 源码静态审计 + m55/m67 实拍)
|
||||
|
||||
| 页面 | 行数 | 私有 `StyleBoxFlat` | 现状 |
|
||||
| --- | --- | --- | --- |
|
||||
| `battle_result_page_view` | 200 | 0 | `make_unified_mvp_shell` + `ABGEntryChrome` 深色整页框;象牙/琥珀/绿/红字;M55 result 模块三件 |
|
||||
| `recovery_page_view` | 133 | 0 | 同上深色框;象牙/琥珀/绿/红字;`UIFactory.notice_surface` 用于错误 |
|
||||
| `knockout_review_page_view` | 185 | 0 | 同上;另有一处 `#8b7141` |
|
||||
| `reward_choice_page_view` | 158 | 0 | 同上;选项区自绘 |
|
||||
| `ui/m55/result_header.gd` | — | 0 | 象牙标题 + 深色描边、琥珀副题(为深色框调色) |
|
||||
| `ui/m55/result_outcome_summary.gd` | — | 0 | 金/绿数值(为深色框调色) |
|
||||
| `ui/m55/result_action_dock.gd` | — | 0 | 已用共享 `command_button(..., "angular", "company")` |
|
||||
|
||||
- 四页测试均断言 `<X>Frame` 节点存在(`BattleResultFrame` / `BattleRecoveryFrame` /
|
||||
`BattleKnockoutFrame` / `BattleRewardFrame`),未断言 UnifiedShell 节点。
|
||||
- 现有 `m55` 探针覆盖 Readiness + Result;Readiness 为已验收页(基线 6 违规,
|
||||
`M62-I03` 未修),Result 迁移后并入新严格门。
|
||||
|
||||
## Ordered steps
|
||||
|
||||
1. **M67-A(IN_PROGRESS)**:四页与 m55 result 模块迁移
|
||||
- 页框:`make_entry_chrome("<X>Frame", "initial_company_scene_frame")` → 共享 `PageChrome("card")`
|
||||
(保留节点名);删除 `make_unified_mvp_shell` 调用(页面头由 M55/自身头部拥有,
|
||||
深色 rail 与羊皮纸族冲突;helper 与其自有测试保留)。
|
||||
- 文案:`#f5ead0` → `PageChrome.INK`;`#e8d39d` → `PageChrome.INK_SOFT`;
|
||||
`#9ed7aa` → `UITokens.COLOR_SUCCESS`(新增令牌并登记);`#ffd4d4` → `UITokens.COLOR_DANGER`;
|
||||
`#f0ca75`/`#aebbc2`/`#8b7141` 按语义改 `INK`/`INK_SOFT`/`COLOR_SUCCESS`;
|
||||
`Tokens.COLOR_GOLD_LIGHT` 在羊皮纸上对比不足 → `PageChrome.INK`。
|
||||
- `ui/m55/result_header.gd`:标题/副题改共享墨色,去深色描边;
|
||||
`ui/m55/result_outcome_summary.gd`:金/绿数值改令牌。
|
||||
2. **M67-B**:`m67_result_recovery_visual_probe.gd` 严格探针(4 页 × zh/en × static/dynamic/final = 24 扫描);
|
||||
`m55` 探针去掉 Result 页(其严格责任移交 m67,Readiness 基线保留)。
|
||||
3. **M67-C**:源绑定验证 + 提交 + 推送 + 账本/checkpoint + display。
|
||||
|
||||
## Acceptance checks
|
||||
|
||||
- `ABG_M67_RESULT_RECOVERY_INK_OK scanned=24 violations=0`(严格,唯一一次)
|
||||
- `ABG_M67_RESULT_RECOVERY_VISUAL_PROBE_OK pages=result,recovery,knockout,reward locales=2 scans=24`
|
||||
- 四页 `tests/foundation/*_page_view_test.gd` 与 controller 测试全过
|
||||
- `ABG_M66_PARTY_RISK_INK_OK`、`ABG_M41_MARKET_VIEW_CONTRACT_OK`、`ABG_M59_INK_CHECK_OK`、
|
||||
`ABG_M54_CONTRACT_INK_OK`、`ABG_M53_GUILD_INK_OK`、`ABG_M63_ENTRY_INK_OK`、
|
||||
`ABG_DEV2_FULL_FLOW_TOUCH_OK` 各恰好一次;strict 0
|
||||
|
||||
## Frozen scope
|
||||
|
||||
- 不改玩法/经济/内容/Save/路由语义;结果数值与文案不变,只改材质与颜色来源。
|
||||
- 不改四页布局槽位、节点名、intents;`m55` 只删 Result 覆盖,不改 Readiness 基线口径。
|
||||
- 单尺寸 1280×720。
|
||||
|
||||
## Issue register
|
||||
|
||||
| ID | 状态 | 内容 |
|
||||
| --- | --- | --- |
|
||||
| `M67-I01` | OPEN | 四页原先依赖 `make_unified_mvp_shell` 的深色 rail;删调用后需实拍确认顶部不再出现深色横带 |
|
||||
| `M67-I02` | OPEN | `UITokens.COLOR_SUCCESS` 为新增令牌,先在 `M52_SHARED_UI_RULES.md` 登记再在四页使用 |
|
||||
| `M67-I03` | OPEN | `m55` 探针 marker 文本含 `sizes=3`(旧多尺寸);本轮只删 Result 覆盖,尺寸收敛留最终冒烟 |
|
||||
@@ -38,6 +38,7 @@
|
||||
| `selection_ring`(M66) | 半透明金色场 + 亮金描边环,共享 `PageChrome` 变体 | 队伍线成员选中、任何肖像槽选中 |
|
||||
| `Tokens.seal_style(color)`(M66) | 彩色小徽记:页面给语义色,边框/圆角/线宽共享 | 风险事实图标、风险身份标记 |
|
||||
| `Tokens.hit_area_style(state)`(M66) | 透明命中反馈:normal 微海军蓝、hover 金、pressed/focus 天蓝 | 纸质卡片的悬停/按压/焦点反馈 |
|
||||
| `Tokens.COLOR_SUCCESS`(M67) | 羊皮纸上的成功/存活墨绿 `#3d7449`(深于旧深色底用的亮绿) | 结果存活、恢复承诺、无击倒状态、风险页正向后 |
|
||||
|
||||
## 资产九宫格材质(M57)
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
class_name ABGBattleResultPageView
|
||||
extends "res://presentation/page_view.gd"
|
||||
|
||||
const PageChrome = preload("res://ui/shared/page_chrome.gd")
|
||||
const UITokens = preload("res://foundation/ui_tokens.gd")
|
||||
const M55_RESULT_HEADER = preload("res://ui/m55/result_header.gd")
|
||||
const M55_RESULT_OUTCOME = preload("res://ui/m55/result_outcome_summary.gd")
|
||||
const M55_RESULT_ACTION_DOCK = preload("res://ui/m55/result_action_dock.gd")
|
||||
@@ -15,17 +17,16 @@ const M55_RESULT_ACTION_DOCK = preload("res://ui/m55/result_action_dock.gd")
|
||||
|
||||
func _render_view(data: Dictionary) -> void:
|
||||
clear_view_children()
|
||||
make_unified_mvp_shell(
|
||||
self,
|
||||
"BattleResult",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
true
|
||||
)
|
||||
var frame_safe := make_framed_page_safe("BattleResult")
|
||||
frame_safe.add_child(make_entry_chrome("BattleResultFrame", "initial_company_scene_frame"))
|
||||
# M67-A: the shared parchment card owns the page surface; the authored node
|
||||
# name stays for the page contract.
|
||||
var frame_chrome := PageChrome.new().configure("card")
|
||||
frame_chrome.name = "BattleResultFrame"
|
||||
frame_chrome.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||
frame_chrome.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
frame_safe.add_child(frame_chrome)
|
||||
var safe := make_content_page_safe("BattleResult")
|
||||
inset_safe_to_card_face(safe)
|
||||
if not bool(data.get("ok", false)):
|
||||
_render_invalid(safe, String(data.get("notice", "")), data)
|
||||
return
|
||||
@@ -40,7 +41,7 @@ func _render_view(data: Dictionary) -> void:
|
||||
layout.add_theme_constant_override("separation", 5)
|
||||
safe.add_child(layout)
|
||||
|
||||
var outcome_color := Color("#9ed7aa") if String(view_result.get("outcome", "")) == "victory" else Color("#ffd4d4")
|
||||
var outcome_color := UITokens.COLOR_SUCCESS if String(view_result.get("outcome", "")) == "victory" else UITokens.COLOR_DANGER
|
||||
var header := M55_RESULT_HEADER.new().configure(
|
||||
localize("战斗结果", "BATTLE RESULT", data),
|
||||
localize("战后回看 · 奖励与影响", "AFTER-ACTION · REWARDS AND CONSEQUENCES", data),
|
||||
@@ -61,13 +62,13 @@ func _render_view(data: Dictionary) -> void:
|
||||
report.size_flags_stretch_ratio = 1.35
|
||||
report.add_theme_constant_override("separation", 5)
|
||||
body.add_child(report)
|
||||
var objective := make_label(localize("目标:击破敌方队列", "OBJECTIVE: BREAK THE ENEMY LINE", data), scaled(13), Color("#f5ead0"))
|
||||
var objective := make_label(localize("目标:击破敌方队列", "OBJECTIVE: BREAK THE ENEMY LINE", data), scaled(13), PageChrome.INK)
|
||||
objective.name = "BattleResultObjective"
|
||||
report.add_child(objective)
|
||||
var decisive: Dictionary = Dictionary(data.get("decisive_event", {}))
|
||||
var decisive_copy := make_label(
|
||||
localize("第一决定性事件:%s", "FIRST DECISIVE EVENT: %s", data) % _battle_event_text(String(decisive.get("caption_id", "")), data),
|
||||
Tokens.font_size("body", float(presentation.get("text_scale", 1.0))), Tokens.COLOR_GOLD_LIGHT
|
||||
Tokens.font_size("body", float(presentation.get("text_scale", 1.0))), PageChrome.INK
|
||||
)
|
||||
decisive_copy.name = "BattleResultDecisive"
|
||||
decisive_copy.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
@@ -76,7 +77,7 @@ func _render_view(data: Dictionary) -> void:
|
||||
var outcome_summary := M55_RESULT_OUTCOME.new().configure(
|
||||
localize("金币 %d → %d\n+%d", "COIN %d -> %d\n+%d", data) % [int(economy.get("coin_before", 0)), int(economy.get("coin_after", 0)), int(economy.get("reward_coin", 0))],
|
||||
localize("经验 +%d\n存活成员各 +%d", "XP +%d\n%d per survivor", data) % [int(economy.get("xp_award", 0)), int(economy.get("xp_per_recruit", 0))],
|
||||
_battle_result_knockout_text_from_view(data), Color("#ffd4d4") if not knockouts.is_empty() else Color("#9ed7aa")
|
||||
_battle_result_knockout_text_from_view(data), UITokens.COLOR_DANGER if not knockouts.is_empty() else UITokens.COLOR_SUCCESS
|
||||
)
|
||||
outcome_summary.name = "BattleResultOutcomeSummary"
|
||||
outcome_summary.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
@@ -87,14 +88,14 @@ func _render_view(data: Dictionary) -> void:
|
||||
context.custom_minimum_size = Vector2(minf(350.0, size.x * 0.38), 0)
|
||||
context.add_theme_constant_override("separation", 4)
|
||||
body.add_child(context)
|
||||
context.add_child(make_label(localize("因果链", "CAUSAL CHAIN", data), scaled(10), Color("#e8d39d")))
|
||||
var chain := make_label(_battle_result_chain_summary_from_view(data), scaled(11), Color("#f5ead0"))
|
||||
context.add_child(make_label(localize("因果链", "CAUSAL CHAIN", data), scaled(10), PageChrome.INK_SOFT))
|
||||
var chain := make_label(_battle_result_chain_summary_from_view(data), scaled(11), PageChrome.INK)
|
||||
chain.name = "BattleResultChain"
|
||||
chain.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
chain.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
context.add_child(chain)
|
||||
if bool(Dictionary(data.get("diagnosis", {})).get("open", false)):
|
||||
var detail := make_label(_battle_result_diagnosis_text_from_view(data), scaled(10), Color("#aebbc2"))
|
||||
var detail := make_label(_battle_result_diagnosis_text_from_view(data), scaled(10), PageChrome.INK_SOFT)
|
||||
detail.name = "BattleResultDiagnosisDetail"
|
||||
detail.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
detail.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
@@ -117,10 +118,10 @@ func _render_invalid(parent: Control, notice_text: String, data: Dictionary) ->
|
||||
invalid.custom_minimum_size = Vector2(420, 120)
|
||||
invalid.add_theme_constant_override("separation", 8)
|
||||
parent.add_child(invalid)
|
||||
var invalid_title := make_label(localize("战斗结果不可用", "BATTLE RESULT UNAVAILABLE", data), scaled(20), Color("#f5ead0"))
|
||||
var invalid_title := make_label(localize("战斗结果不可用", "BATTLE RESULT UNAVAILABLE", data), scaled(20), PageChrome.INK)
|
||||
invalid_title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
invalid.add_child(invalid_title)
|
||||
var invalid_detail := make_label(notice_text, scaled(11), Color("#ffd4d4"))
|
||||
var invalid_detail := make_label(notice_text, scaled(11), UITokens.COLOR_DANGER)
|
||||
invalid_detail.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
invalid_detail.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
invalid.add_child(invalid_detail)
|
||||
|
||||
@@ -7,14 +7,23 @@ extends "res://presentation/page_view.gd"
|
||||
## `back` and `acknowledge` intents. Controller facts, settlement receipts
|
||||
## and continuation routing remain outside this class.
|
||||
|
||||
const PageChrome = preload("res://ui/shared/page_chrome.gd")
|
||||
const UITokens = preload("res://foundation/ui_tokens.gd")
|
||||
const InitialCompanyArt = preload("res://entry/initial_company_art.gd")
|
||||
|
||||
|
||||
func _render_view(data: Dictionary) -> void:
|
||||
clear_view_children()
|
||||
var frame_safe := make_framed_page_safe("BattleKnockout")
|
||||
frame_safe.add_child(make_entry_chrome("BattleKnockoutFrame", "initial_company_scene_frame"))
|
||||
# M67-A: the shared parchment card owns the page surface; the authored node
|
||||
# name stays for the page contract.
|
||||
var frame_chrome := PageChrome.new().configure("card")
|
||||
frame_chrome.name = "BattleKnockoutFrame"
|
||||
frame_chrome.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||
frame_chrome.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
frame_safe.add_child(frame_chrome)
|
||||
var safe := make_content_page_safe("BattleKnockout")
|
||||
inset_safe_to_card_face(safe)
|
||||
if not bool(data.get("ok", false)):
|
||||
_render_invalid(safe, String(data.get("notice", "")), data)
|
||||
return
|
||||
@@ -33,9 +42,9 @@ func _render_view(data: Dictionary) -> void:
|
||||
var heading := VBoxContainer.new()
|
||||
heading.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
header.add_child(heading)
|
||||
heading.add_child(make_label(localize("击倒回顾", "KNOCKOUT REVIEW", data), scaled(21), Color("#f5ead0")))
|
||||
heading.add_child(make_label(localize("确认战斗内后果;没有成员被删除。", "Confirm the battle-local consequence; no Recruit was deleted.", data), scaled(10), Color("#e8d39d")))
|
||||
var status := make_label(localize("战斗回执已提交", "BATTLE RECEIPT COMMITTED", data), scaled(11), Color("#9ed7aa"))
|
||||
heading.add_child(make_label(localize("击倒回顾", "KNOCKOUT REVIEW", data), scaled(21), PageChrome.INK))
|
||||
heading.add_child(make_label(localize("确认战斗内后果;没有成员被删除。", "Confirm the battle-local consequence; no Recruit was deleted.", data), scaled(10), PageChrome.INK_SOFT))
|
||||
var status := make_label(localize("战斗回执已提交", "BATTLE RECEIPT COMMITTED", data), scaled(11), UITokens.COLOR_SUCCESS)
|
||||
status.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||
header.add_child(status)
|
||||
|
||||
@@ -51,7 +60,7 @@ func _render_view(data: Dictionary) -> void:
|
||||
scene.add_theme_constant_override("separation", 3)
|
||||
body.add_child(scene)
|
||||
if identities.is_empty():
|
||||
scene.add_child(make_label(localize("本场没有击倒成员。", "No Recruit was knocked out in this battle.", data), scaled(15), Color("#9ed7aa")))
|
||||
scene.add_child(make_label(localize("本场没有击倒成员。", "No Recruit was knocked out in this battle.", data), scaled(15), UITokens.COLOR_SUCCESS))
|
||||
else:
|
||||
for identity in identities:
|
||||
if not identity is Dictionary:
|
||||
@@ -60,21 +69,21 @@ func _render_view(data: Dictionary) -> void:
|
||||
if recruit.is_empty():
|
||||
continue
|
||||
scene.add_child(_member_presentation(maxi(0, int(identity.get("position", 0))), recruit, data))
|
||||
scene.add_child(make_label(localize("%s · %s", "%s · %s", data) % [_recruit_name(recruit, data), _recruit_profession_name(recruit, data)], scaled(16), Color("#f0ca75")))
|
||||
scene.add_child(make_label(localize("特质:%s\n等级 %d · XP %d\n装备:%s", "Trait: %s\nLevel %d · XP %d\nEquipment: %s", data) % [_recruit_trait_name(recruit, data), int(recruit.get("level", 0)), int(recruit.get("xp", 0)), _recruit_item_name(recruit, data)], scaled(11), Color("#f5ead0")))
|
||||
scene.add_child(make_label(localize("%s · %s", "%s · %s", data) % [_recruit_name(recruit, data), _recruit_profession_name(recruit, data)], scaled(16), PageChrome.INK))
|
||||
scene.add_child(make_label(localize("特质:%s\n等级 %d · XP %d\n装备:%s", "Trait: %s\nLevel %d · XP %d\nEquipment: %s", data) % [_recruit_trait_name(recruit, data), int(recruit.get("level", 0)), int(recruit.get("xp", 0)), _recruit_item_name(recruit, data)], scaled(11), PageChrome.INK))
|
||||
|
||||
var context_box := VBoxContainer.new()
|
||||
context_box.name = "BattleKnockoutContext"
|
||||
context_box.custom_minimum_size = Vector2(minf(350.0, size.x * 0.38), 0)
|
||||
context_box.add_theme_constant_override("separation", 5)
|
||||
body.add_child(context_box)
|
||||
context_box.add_child(make_label(localize("当前战斗空位", "CURRENT BATTLE GAP", data), scaled(10), Color("#e8d39d")))
|
||||
var gap := make_label(localize("被击倒成员只离开本场战斗。其稳定 Recruit ID、Profession、Trait、等级、XP 和装备所有权仍在 Company 中。", "The knocked-out member leaves this battle only. The stable Recruit ID, Profession, Trait, level, XP and equipment ownership remain in the Company.", data), scaled(12), Color("#ffd4d4"))
|
||||
context_box.add_child(make_label(localize("当前战斗空位", "CURRENT BATTLE GAP", data), scaled(10), PageChrome.INK_SOFT))
|
||||
var gap := make_label(localize("被击倒成员只离开本场战斗。其稳定 Recruit ID、Profession、Trait、等级、XP 和装备所有权仍在 Company 中。", "The knocked-out member leaves this battle only. The stable Recruit ID, Profession, Trait, level, XP and equipment ownership remain in the Company.", data), scaled(12), UITokens.COLOR_DANGER)
|
||||
gap.name = "BattleKnockoutCurrentGap"
|
||||
gap.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
gap.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
context_box.add_child(gap)
|
||||
var return_rule := make_label(localize("下关归队:恢复后进入下一阶段 Market,不会永久死亡。", "Next-stage return: recovery opens the next Market; there is no permanent death.", data), scaled(11), Color("#9ed7aa"))
|
||||
var return_rule := make_label(localize("下关归队:恢复后进入下一阶段 Market,不会永久死亡。", "Next-stage return: recovery opens the next Market; there is no permanent death.", data), scaled(11), UITokens.COLOR_SUCCESS)
|
||||
return_rule.name = "BattleKnockoutReturnRule"
|
||||
return_rule.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
context_box.add_child(return_rule)
|
||||
@@ -105,10 +114,10 @@ func _render_invalid(parent: Control, notice_text: String, data: Dictionary) ->
|
||||
invalid.custom_minimum_size = Vector2(420, 120)
|
||||
invalid.add_theme_constant_override("separation", 8)
|
||||
parent.add_child(invalid)
|
||||
var invalid_title := make_label(localize("击倒回顾不可用", "KNOCKOUT REVIEW UNAVAILABLE", data), scaled(20), Color("#f5ead0"))
|
||||
var invalid_title := make_label(localize("击倒回顾不可用", "KNOCKOUT REVIEW UNAVAILABLE", data), scaled(20), PageChrome.INK)
|
||||
invalid_title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
invalid.add_child(invalid_title)
|
||||
var invalid_detail := make_label(notice_text, scaled(11), Color("#ffd4d4"))
|
||||
var invalid_detail := make_label(notice_text, scaled(11), UITokens.COLOR_DANGER)
|
||||
invalid_detail.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
invalid_detail.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
invalid.add_child(invalid_detail)
|
||||
@@ -125,7 +134,7 @@ func _member_presentation(position: int, recruit: Dictionary, data: Dictionary)
|
||||
ground.anchor_top = 0.80
|
||||
ground.anchor_right = 0.86
|
||||
ground.anchor_bottom = 0.86
|
||||
ground.color = Color("#8b7141")
|
||||
ground.color = PageChrome.INK_SOFT
|
||||
ground.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
member.add_child(ground)
|
||||
var portrait := TextureRect.new()
|
||||
@@ -139,14 +148,14 @@ func _member_presentation(position: int, recruit: Dictionary, data: Dictionary)
|
||||
portrait.anchor_bottom = 0.79
|
||||
portrait.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
member.add_child(portrait)
|
||||
var position_label := make_label(localize("%d 号", "POS %d", data) % position, scaled(9), Color("#e8d39d"))
|
||||
var position_label := make_label(localize("%d 号", "POS %d", data) % position, scaled(9), PageChrome.INK_SOFT)
|
||||
position_label.anchor_top = 0.79
|
||||
position_label.anchor_right = 1.0
|
||||
position_label.anchor_bottom = 0.90
|
||||
position_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
position_label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||
member.add_child(position_label)
|
||||
var name_label := make_label(_recruit_name(recruit, data), scaled(9), Color("#f5ead0"))
|
||||
var name_label := make_label(_recruit_name(recruit, data), scaled(9), PageChrome.INK)
|
||||
name_label.anchor_top = 0.89
|
||||
name_label.anchor_right = 1.0
|
||||
name_label.anchor_bottom = 1.0
|
||||
|
||||
@@ -9,11 +9,21 @@ extends "res://presentation/page_view.gd"
|
||||
## commands.
|
||||
|
||||
|
||||
const PageChrome = preload("res://ui/shared/page_chrome.gd")
|
||||
const UITokens = preload("res://foundation/ui_tokens.gd")
|
||||
|
||||
func _render_view(data: Dictionary) -> void:
|
||||
clear_view_children()
|
||||
var frame_safe := make_framed_page_safe("BattleRecovery")
|
||||
frame_safe.add_child(make_entry_chrome("BattleRecoveryFrame", "initial_company_scene_frame"))
|
||||
# M67-A: the shared parchment card owns the page surface; the authored node
|
||||
# name stays for the page contract.
|
||||
var frame_chrome := PageChrome.new().configure("card")
|
||||
frame_chrome.name = "BattleRecoveryFrame"
|
||||
frame_chrome.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||
frame_chrome.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
frame_safe.add_child(frame_chrome)
|
||||
var safe := make_content_page_safe("BattleRecovery")
|
||||
inset_safe_to_card_face(safe)
|
||||
if not bool(data.get("ok", false)):
|
||||
_render_invalid(safe, String(data.get("notice", "")))
|
||||
return
|
||||
@@ -29,8 +39,8 @@ func _render_view(data: Dictionary) -> void:
|
||||
var heading := VBoxContainer.new()
|
||||
heading.custom_minimum_size = Vector2(0, 48 if size.y < 500.0 else 58)
|
||||
layout.add_child(heading)
|
||||
heading.add_child(make_label(localize("下一阶段恢复", "NEXT-STAGE RECOVERY", data), scaled(21), Color("#f5ead0")))
|
||||
heading.add_child(make_label(localize("一次原子回执将恢复同一 Company 的下一阶段准备入口。", "One atomic receipt restores the next-stage preparation entry for the same Company.", data), scaled(10), Color("#e8d39d")))
|
||||
heading.add_child(make_label(localize("下一阶段恢复", "NEXT-STAGE RECOVERY", data), scaled(21), PageChrome.INK))
|
||||
heading.add_child(make_label(localize("一次原子回执将恢复同一 Company 的下一阶段准备入口。", "One atomic receipt restores the next-stage preparation entry for the same Company.", data), scaled(10), PageChrome.INK_SOFT))
|
||||
|
||||
var body := HBoxContainer.new()
|
||||
body.name = "BattleRecoveryBody"
|
||||
@@ -42,8 +52,8 @@ func _render_view(data: Dictionary) -> void:
|
||||
summary.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
summary.add_theme_constant_override("separation", 5)
|
||||
body.add_child(summary)
|
||||
summary.add_child(make_label(localize("恢复成员 %d 名", "%d Recruit(s) to return", data) % identities.size(), scaled(16), Color("#f0ca75")))
|
||||
var ids := make_label(_identity_lines(data), scaled(11), Color("#f5ead0"))
|
||||
summary.add_child(make_label(localize("恢复成员 %d 名", "%d Recruit(s) to return", data) % identities.size(), scaled(16), PageChrome.INK))
|
||||
var ids := make_label(_identity_lines(data), scaled(11), PageChrome.INK)
|
||||
ids.name = "BattleRecoveryIdentities"
|
||||
ids.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
ids.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
@@ -54,19 +64,19 @@ func _render_view(data: Dictionary) -> void:
|
||||
context_box.custom_minimum_size = Vector2(minf(350.0, size.x * 0.38), 0)
|
||||
context_box.add_theme_constant_override("separation", 5)
|
||||
body.add_child(context_box)
|
||||
context_box.add_child(make_label(localize("恢复承诺", "RECOVERY COMMITMENT", data), scaled(10), Color("#e8d39d")))
|
||||
var rule := make_label(localize("保留稳定 ID、Profession、Trait、等级、XP、历史和装备。战斗状态回到 Market;下一阶段可以重新建立 Party。", "Stable ID, Profession, Trait, level, XP, history and equipment are retained. Battle state returns to Market; the next stage can establish a new Party.", data), scaled(12), Color("#9ed7aa"))
|
||||
context_box.add_child(make_label(localize("恢复承诺", "RECOVERY COMMITMENT", data), scaled(10), PageChrome.INK_SOFT))
|
||||
var rule := make_label(localize("保留稳定 ID、Profession、Trait、等级、XP、历史和装备。战斗状态回到 Market;下一阶段可以重新建立 Party。", "Stable ID, Profession, Trait, level, XP, history and equipment are retained. Battle state returns to Market; the next stage can establish a new Party.", data), scaled(12), UITokens.COLOR_SUCCESS)
|
||||
rule.name = "BattleRecoveryRule"
|
||||
rule.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
rule.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
context_box.add_child(rule)
|
||||
var receipt := make_label(localize("恢复回执只提交一次;重试会返回原回执。", "The recovery receipt submits once; retries return the original receipt.", data), scaled(10), Color("#e8d39d"))
|
||||
var receipt := make_label(localize("恢复回执只提交一次;重试会返回原回执。", "The recovery receipt submits once; retries return the original receipt.", data), scaled(10), PageChrome.INK_SOFT)
|
||||
receipt.name = "BattleRecoveryReceiptRule"
|
||||
receipt.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
context_box.add_child(receipt)
|
||||
var notice_text := String(data.get("notice", ""))
|
||||
if notice_text.is_empty():
|
||||
var notice := make_label("", scaled(10), Color("#ffd4d4"))
|
||||
var notice := make_label("", scaled(10), UITokens.COLOR_DANGER)
|
||||
notice.name = "BattleRecoveryNotice"
|
||||
notice.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
context_box.add_child(notice)
|
||||
@@ -74,7 +84,7 @@ func _render_view(data: Dictionary) -> void:
|
||||
var notice_surface := UIFactory.notice_surface("BattleRecoveryNoticeSurface", "danger")
|
||||
notice_surface.custom_minimum_size = Vector2(0, 42)
|
||||
context_box.add_child(notice_surface)
|
||||
var notice := make_label(notice_text, scaled(10), Color("#ffd4d4"))
|
||||
var notice := make_label(notice_text, scaled(10), UITokens.COLOR_DANGER)
|
||||
notice.name = "BattleRecoveryNotice"
|
||||
notice.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
notice.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||
@@ -105,10 +115,10 @@ func _render_invalid(parent: Control, notice_text: String) -> void:
|
||||
invalid.custom_minimum_size = Vector2(420, 120)
|
||||
invalid.add_theme_constant_override("separation", 8)
|
||||
parent.add_child(invalid)
|
||||
var invalid_title := make_label(localize("恢复不可用", "RECOVERY UNAVAILABLE"), scaled(20), Color("#f5ead0"))
|
||||
var invalid_title := make_label(localize("恢复不可用", "RECOVERY UNAVAILABLE"), scaled(20), PageChrome.INK)
|
||||
invalid_title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
invalid.add_child(invalid_title)
|
||||
var invalid_detail := make_label(notice_text, scaled(11), Color("#ffd4d4"))
|
||||
var invalid_detail := make_label(notice_text, scaled(11), UITokens.COLOR_DANGER)
|
||||
invalid_detail.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
invalid_detail.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
invalid.add_child(invalid_detail)
|
||||
|
||||
@@ -8,6 +8,9 @@ extends "res://presentation/page_view.gd"
|
||||
## this class does not resolve content, load Save or call BattleService.
|
||||
|
||||
|
||||
const PageChrome = preload("res://ui/shared/page_chrome.gd")
|
||||
const UITokens = preload("res://foundation/ui_tokens.gd")
|
||||
|
||||
func _render_view(data: Dictionary) -> void:
|
||||
clear_view_children()
|
||||
if not bool(data.get("ok", false)):
|
||||
@@ -15,8 +18,15 @@ func _render_view(data: Dictionary) -> void:
|
||||
return
|
||||
|
||||
var frame_safe := make_framed_page_safe("BattleReward")
|
||||
frame_safe.add_child(make_entry_chrome("BattleRewardFrame", "initial_company_scene_frame"))
|
||||
# M67-A: the shared parchment card owns the page surface; the authored node
|
||||
# name stays for the page contract.
|
||||
var frame_chrome := PageChrome.new().configure("card")
|
||||
frame_chrome.name = "BattleRewardFrame"
|
||||
frame_chrome.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||
frame_chrome.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
frame_safe.add_child(frame_chrome)
|
||||
var safe := make_content_page_safe("BattleReward")
|
||||
inset_safe_to_card_face(safe)
|
||||
var reward_data: Dictionary = Dictionary(data.get("reward", {}))
|
||||
var paid_data: Dictionary = Dictionary(data.get("paid", {}))
|
||||
var options: Array = Array(reward_data.get("options", []))
|
||||
@@ -35,9 +45,9 @@ func _render_view(data: Dictionary) -> void:
|
||||
var heading := VBoxContainer.new()
|
||||
heading.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
header.add_child(heading)
|
||||
heading.add_child(make_label(localize("奖励选择", "REWARD CHOICE", data), scaled(21), Color("#f5ead0")))
|
||||
heading.add_child(make_label(localize("稳定选项 · 领取一次或明确跳过", "STABLE OPTIONS · CLAIM ONCE OR EXPLICITLY SKIP", data), scaled(10), Color("#e8d39d")))
|
||||
var paid := make_label(localize("战斗金币已结算 %d", "BATTLE COIN PAID %d", data) % int(paid_data.get("battle_reward_coin", 0)), scaled(12), Color("#f0ca75"))
|
||||
heading.add_child(make_label(localize("奖励选择", "REWARD CHOICE", data), scaled(21), PageChrome.INK))
|
||||
heading.add_child(make_label(localize("稳定选项 · 领取一次或明确跳过", "STABLE OPTIONS · CLAIM ONCE OR EXPLICITLY SKIP", data), scaled(10), PageChrome.INK_SOFT))
|
||||
var paid := make_label(localize("战斗金币已结算 %d", "BATTLE COIN PAID %d", data) % int(paid_data.get("battle_reward_coin", 0)), scaled(12), PageChrome.INK)
|
||||
paid.name = "BattleRewardPaid"
|
||||
paid.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||
header.add_child(paid)
|
||||
@@ -53,7 +63,7 @@ func _render_view(data: Dictionary) -> void:
|
||||
options_box.size_flags_stretch_ratio = 1.25
|
||||
options_box.add_theme_constant_override("separation", 6)
|
||||
body.add_child(options_box)
|
||||
var options_title := make_label(localize("同等决策区", "EQUAL DECISION REGIONS", data), scaled(10), Color("#e8d39d"))
|
||||
var options_title := make_label(localize("同等决策区", "EQUAL DECISION REGIONS", data), scaled(10), PageChrome.INK_SOFT)
|
||||
options_title.name = "BattleRewardOptionsTitle"
|
||||
options_box.add_child(options_title)
|
||||
for raw_option in options:
|
||||
@@ -80,18 +90,18 @@ func _render_view(data: Dictionary) -> void:
|
||||
context_box.custom_minimum_size = Vector2(minf(360.0, size.x * 0.38), 0)
|
||||
context_box.add_theme_constant_override("separation", 5)
|
||||
body.add_child(context_box)
|
||||
context_box.add_child(make_label(localize("当前选项", "SELECTED OPTION", data), scaled(10), Color("#e8d39d")))
|
||||
context_box.add_child(make_label(localize("当前选项", "SELECTED OPTION", data), scaled(10), PageChrome.INK_SOFT))
|
||||
if selected_option.is_empty():
|
||||
context_box.add_child(make_label(localize("选择一项以查看目标、冲突和跳过结果。", "Choose one option to read target, conflict and skip outcome.", data), scaled(12), Color("#aebbc2")))
|
||||
context_box.add_child(make_label(localize("选择一项以查看目标、冲突和跳过结果。", "Choose one option to read target, conflict and skip outcome.", data), scaled(12), PageChrome.INK_SOFT))
|
||||
else:
|
||||
var selected_detail := make_label(_option_detail(selected_option, data), scaled(12), Color("#f5ead0"))
|
||||
var selected_detail := make_label(_option_detail(selected_option, data), scaled(12), PageChrome.INK)
|
||||
selected_detail.name = "BattleRewardSelectedDetail"
|
||||
selected_detail.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
selected_detail.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
context_box.add_child(selected_detail)
|
||||
var notice_text := String(data.get("notice", ""))
|
||||
if not notice_text.is_empty():
|
||||
var notice := make_label(notice_text, scaled(10), Color("#ffd4d4"))
|
||||
var notice := make_label(notice_text, scaled(10), UITokens.COLOR_DANGER)
|
||||
notice.name = "BattleRewardNotice"
|
||||
notice.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
context_box.add_child(notice)
|
||||
@@ -128,8 +138,8 @@ func _render_invalid(data: Dictionary) -> void:
|
||||
invalid.add_theme_constant_override("separation", 8)
|
||||
var safe := make_content_page_safe("BattleReward")
|
||||
safe.add_child(invalid)
|
||||
invalid.add_child(make_label(localize("奖励选择不可用", "REWARD CHOICE UNAVAILABLE", data), scaled(20), Color("#f5ead0")))
|
||||
var invalid_detail := make_label(String(data.get("notice", "")), scaled(11), Color("#ffd4d4"))
|
||||
invalid.add_child(make_label(localize("奖励选择不可用", "REWARD CHOICE UNAVAILABLE", data), scaled(20), PageChrome.INK))
|
||||
var invalid_detail := make_label(String(data.get("notice", "")), scaled(11), UITokens.COLOR_DANGER)
|
||||
invalid_detail.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
invalid.add_child(invalid_detail)
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ const COLOR_IVORY := Color("#f5ead0")
|
||||
const COLOR_SKY := Color("#73b9e7")
|
||||
const COLOR_DANGER := Color("#a94b53")
|
||||
const COLOR_MUTED := Color("#73808a")
|
||||
# Success ink for parchment surfaces (dark enough for ink-on-paper contrast).
|
||||
const COLOR_SUCCESS := Color("#3d7449")
|
||||
const COLOR_SURFACE := Color("#182838", 0.90)
|
||||
const COLOR_SURFACE_BORDER := Color("#b99a5d", 0.78)
|
||||
const COLOR_SURFACE_INK := Color("#f5ead0")
|
||||
|
||||
@@ -228,6 +228,24 @@ func make_framed_page_safe(prefix: String) -> MarginContainer:
|
||||
return safe
|
||||
|
||||
|
||||
func inset_safe_to_card_face(safe: MarginContainer, edge_x := 0.055, edge_y := 0.15) -> void:
|
||||
"""Seat page content inside a shared card's rolled edges.
|
||||
|
||||
The card's authored roll owns the top/left/right face; content that keeps
|
||||
only the touch safe-area margin sits on the roll and gets clipped. M67
|
||||
pages call this right after make_content_page_safe (the M64/M65 pages do the
|
||||
equivalent inset per page).
|
||||
"""
|
||||
if safe == null:
|
||||
return
|
||||
var face_x := int(size.x * edge_x) + 14
|
||||
var face_y := int(size.y * edge_y) + 10
|
||||
safe.add_theme_constant_override("margin_left", face_x)
|
||||
safe.add_theme_constant_override("margin_right", face_x)
|
||||
safe.add_theme_constant_override("margin_top", face_y)
|
||||
safe.add_theme_constant_override("margin_bottom", int(face_y * 0.55))
|
||||
|
||||
|
||||
func make_content_page_safe(prefix: String) -> MarginContainer:
|
||||
var safe := MarginContainer.new()
|
||||
safe.name = "%sSafeArea" % prefix
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
extends SceneTree
|
||||
const Readiness = preload("res://entry/views/readiness_page_view.gd")
|
||||
const Result = preload("res://entry/views/battle_result_page_view.gd")
|
||||
const InkCheck = preload("res://tools/ui_ink_check.gd")
|
||||
const SIZES := [Vector2i(760,360), Vector2i(844,390), Vector2i(1280,720)]
|
||||
const LOCALES := ["zh_CN", "en"]
|
||||
@@ -23,7 +22,6 @@ func _run() -> void:
|
||||
for locale in LOCALES:
|
||||
for mode in ["static", "dynamic", "final"]:
|
||||
await _capture(Readiness, _readiness_data(locale), size, locale, "readiness", out, mode)
|
||||
await _capture(Result, _result_data(locale), size, locale, "result", out)
|
||||
var report_path := OS.get_environment("ABG_EVIDENCE_DIR").path_join("ink-violations-%s.json" % _probe_id())
|
||||
var file := FileAccess.open(report_path, FileAccess.WRITE)
|
||||
if file != null:
|
||||
@@ -33,7 +31,7 @@ func _run() -> void:
|
||||
print("ABG_M55_READINESS_RESULT_INK_OK scanned=%d violations=0" % ink_scanned)
|
||||
else:
|
||||
print("ABG_M55_READINESS_RESULT_INK_REPORT_OK scanned=%d violations=%d baseline=legacy" % [ink_scanned, ink_violations.size()])
|
||||
print("ABG_M55_READINESS_RESULT_VISUAL_PROBE_OK sizes=3 locales=2 pages=2")
|
||||
print("ABG_M55_READINESS_VISUAL_PROBE_OK sizes=3 locales=2 pages=readiness strict_result=m67")
|
||||
quit(0)
|
||||
|
||||
func _probe_id() -> String:
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
extends SceneTree
|
||||
|
||||
## M67 strict visual probe for the DEV-5R settlement pages: Battle Result,
|
||||
## Recovery, Knockout Review and Reward Choice. Single authoritative size
|
||||
## (owner policy), both shipped locales, static/dynamic/final views. Any ink
|
||||
## violation fails the probe.
|
||||
|
||||
const Result = preload("res://entry/views/battle_result_page_view.gd")
|
||||
const Recovery = preload("res://entry/views/recovery_page_view.gd")
|
||||
const Knockout = preload("res://entry/views/knockout_review_page_view.gd")
|
||||
const Reward = preload("res://entry/views/reward_choice_page_view.gd")
|
||||
const InkCheck = preload("res://tools/ui_ink_check.gd")
|
||||
const FIXTURES := [Vector2i(1280, 720)]
|
||||
const LOCALES := ["zh_CN", "en"]
|
||||
var ink_scanned := 0
|
||||
var ink_violations: Array = []
|
||||
|
||||
|
||||
func _initialize() -> void:
|
||||
call_deferred("_run")
|
||||
|
||||
|
||||
func _run() -> void:
|
||||
var out := OS.get_environment("ABG_EVIDENCE_DIR")
|
||||
if out.is_empty():
|
||||
push_error("requires ABG_EVIDENCE_DIR")
|
||||
quit(1)
|
||||
return
|
||||
DirAccess.make_dir_recursive_absolute(out)
|
||||
var ink_self := InkCheck.self_test(root)
|
||||
if ink_self.size() < 3:
|
||||
push_error("M67 ink self-test expected at least 3 violations, got %d" % ink_self.size())
|
||||
quit(1)
|
||||
return
|
||||
print("ABG_M67_INK_SELF_TEST_OK violations=%d" % ink_self.size())
|
||||
ink_scanned = 0
|
||||
ink_violations = []
|
||||
var pages: Array = [
|
||||
{"script": Result, "name": "result", "data": Callable(self, "_result_data")},
|
||||
{"script": Recovery, "name": "recovery", "data": Callable(self, "_recovery_data")},
|
||||
{"script": Knockout, "name": "knockout", "data": Callable(self, "_knockout_data")},
|
||||
{"script": Reward, "name": "reward", "data": Callable(self, "_reward_data")},
|
||||
]
|
||||
for fixture in FIXTURES:
|
||||
for locale in LOCALES:
|
||||
for page in pages:
|
||||
await _capture(page, fixture, String(locale), out)
|
||||
if ink_violations.is_empty():
|
||||
print("ABG_M67_RESULT_RECOVERY_INK_OK scanned=%d violations=0" % ink_scanned)
|
||||
else:
|
||||
for violation in ink_violations:
|
||||
push_error("M67 ink violation %s %s %s %s: %s" % [
|
||||
violation.get("page", "?"), violation.get("locale", "?"),
|
||||
violation.get("fixture", "?"), violation.get("kind", "?"),
|
||||
violation.get("detail", ""),
|
||||
])
|
||||
print("ABG_M67_RESULT_RECOVERY_INK_FAIL scanned=%d violations=%d" % [ink_scanned, ink_violations.size()])
|
||||
quit(1)
|
||||
return
|
||||
print("ABG_M67_RESULT_RECOVERY_VISUAL_PROBE_OK pages=result,recovery,knockout,reward locales=%d scans=%d views=static,dynamic,final" % [LOCALES.size(), ink_scanned])
|
||||
quit(0)
|
||||
|
||||
|
||||
func _capture(page: Dictionary, fixture: Vector2i, locale: String, out: String) -> void:
|
||||
var page_name := String(page.get("name", "page"))
|
||||
for mode in ["static", "dynamic", "final"]:
|
||||
var viewport := SubViewport.new()
|
||||
viewport.size = fixture
|
||||
viewport.render_target_update_mode = SubViewport.UPDATE_ALWAYS
|
||||
root.add_child(viewport)
|
||||
var view: Control = page.script.new()
|
||||
view.name = "M67ProbeView"
|
||||
view.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||
view.configure_presentation({"safe_area": 24, "text_scale": 1.0, "locale": locale})
|
||||
viewport.add_child(view)
|
||||
view.render(page.data.call(locale))
|
||||
_apply_mode(view, page_name, mode)
|
||||
for _i in range(3):
|
||||
await process_frame
|
||||
var violations := InkCheck.scan(view)
|
||||
ink_scanned += 1
|
||||
for violation in violations:
|
||||
violation["page"] = page_name
|
||||
violation["locale"] = locale
|
||||
violation["fixture"] = "%dx%d" % [fixture.x, fixture.y]
|
||||
violation["mode"] = mode
|
||||
ink_violations.append(violation)
|
||||
var image := viewport.get_texture().get_image()
|
||||
if image != null:
|
||||
image.save_png(out.path_join("%s-%dx%d-%s-%s.png" % [page_name, fixture.x, fixture.y, locale, mode]))
|
||||
view.queue_free()
|
||||
viewport.queue_free()
|
||||
await process_frame
|
||||
|
||||
|
||||
func _apply_mode(view: Control, page_name: String, mode: String) -> void:
|
||||
# static-only: authored chrome with no runtime content.
|
||||
# dynamic-only: runtime content on a neutral field.
|
||||
var frame_names: Array = {
|
||||
"result": ["BattleResultFrame"],
|
||||
"recovery": ["BattleRecoveryFrame"],
|
||||
"knockout": ["BattleKnockoutFrame"],
|
||||
"reward": ["BattleRewardFrame"],
|
||||
}.get(page_name, [])
|
||||
if mode == "static":
|
||||
for name in frame_names:
|
||||
var frame := view.find_child(name, true, false) as Control
|
||||
if frame != null:
|
||||
frame.visible = false
|
||||
elif mode == "dynamic":
|
||||
for name in frame_names:
|
||||
var frame := view.find_child(name, true, false) as Control
|
||||
if frame != null:
|
||||
frame.visible = false
|
||||
var neutral := ColorRect.new()
|
||||
neutral.name = "M67NeutralProbeBackground"
|
||||
neutral.color = Color("#26353c")
|
||||
neutral.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||
neutral.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
view.add_child(neutral)
|
||||
view.move_child(neutral, 0)
|
||||
|
||||
|
||||
func _result_data(locale: String) -> Dictionary:
|
||||
return {
|
||||
"ok": true, "locale": locale,
|
||||
"result": {"outcome": "victory"},
|
||||
"economy": {"coin_before": 24, "coin_after": 38, "reward_coin": 14, "xp_award": 20, "xp_per_recruit": 5},
|
||||
"knockouts": {"ids": []},
|
||||
"decisive_event": {"caption_id": "first_hit"},
|
||||
"diagnosis": {"open": true},
|
||||
"commands": {"diagnosis_enabled": true, "continue_enabled": true},
|
||||
}
|
||||
|
||||
|
||||
func _recovery_data(locale: String) -> Dictionary:
|
||||
return {
|
||||
"ok": true, "page_id": "recovery", "locale": locale,
|
||||
"knockouts": {"identities": [{"recruit": {
|
||||
"recruit_id": "r-1",
|
||||
"rendered_name_snapshot": {locale: "阿里" if locale == "zh_CN" else "Ari"},
|
||||
"profession_name": {locale: "侦察兵" if locale == "zh_CN" else "Scout"},
|
||||
}}]},
|
||||
"commands": {"back_enabled": true, "commit_enabled": false},
|
||||
"notice": "",
|
||||
}
|
||||
|
||||
|
||||
func _knockout_data(locale: String) -> Dictionary:
|
||||
return {
|
||||
"ok": true, "page_id": "knockout_review", "locale": locale,
|
||||
"presentation": {"equipment_names": {"EQ-002": "Open Line Cord"}},
|
||||
"knockouts": {"identities": [{
|
||||
"recruit_id": "r-1", "position": 0,
|
||||
"recruit": {
|
||||
"recruit_id": "r-1", "profession_id": "PF-B01",
|
||||
"rendered_name_snapshot": {locale: "阿里" if locale == "zh_CN" else "Ari"},
|
||||
"profession_name": {locale: "护心卫士" if locale == "zh_CN" else "Hearthguard"},
|
||||
"trait_name": {locale: "稳固" if locale == "zh_CN" else "Steady"},
|
||||
"trait_id": "TR-001", "level": 2, "xp": 16,
|
||||
"starting_item_id": "EQ-001",
|
||||
"starting_item_name": {locale: "橡木盾" if locale == "zh_CN" else "Oak Shield"},
|
||||
"equipped_item_id": "EQ-002",
|
||||
},
|
||||
}]},
|
||||
"commands": {"back_enabled": true, "acknowledge_enabled": true},
|
||||
"notice": "",
|
||||
}
|
||||
|
||||
|
||||
func _reward_data(locale: String) -> Dictionary:
|
||||
var option := {
|
||||
"reward_id": "reward-1", "kind": "equipment", "catalog_id": "EQ-001",
|
||||
"next_decision": "选择佩戴者" if locale == "zh_CN" else "Choose a wearer",
|
||||
"eligible_target": "任一存活成员" if locale == "zh_CN" else "Any surviving Recruit",
|
||||
"conflict": "无" if locale == "zh_CN" else "None",
|
||||
"skip_outcome": "保留已结算金币" if locale == "zh_CN" else "Keep paid Coin",
|
||||
}
|
||||
return {
|
||||
"ok": true, "page_id": "reward_choice", "locale": locale,
|
||||
"presentation": {"equipment_names": {"EQ-001": "Open Line Cord"}},
|
||||
"paid": {"battle_reward_coin": 27},
|
||||
"reward": {"selected_reward_id": "reward-1", "selected_option": option, "options": [option, {
|
||||
"reward_id": "reward-2", "kind": "coin", "amount": 8,
|
||||
"next_decision": "储备金币" if locale == "zh_CN" else "Reserve Coin",
|
||||
"eligible_target": "远征团" if locale == "zh_CN" else "Company",
|
||||
"conflict": "无" if locale == "zh_CN" else "None",
|
||||
"skip_outcome": "无奖励物" if locale == "zh_CN" else "No reward object",
|
||||
}]},
|
||||
"commands": {"back_enabled": true, "select_enabled": true, "claim_enabled": true, "skip_enabled": true},
|
||||
"notice": "",
|
||||
}
|
||||
@@ -2,10 +2,11 @@ class_name ABGM55ResultHeader
|
||||
extends Control
|
||||
|
||||
const UIFactory = preload("res://ui/shared/ui_factory.gd")
|
||||
const PageChrome = preload("res://ui/shared/page_chrome.gd")
|
||||
var title_text := "战斗结果"
|
||||
var subtitle_text := "战后回看 · 奖励与影响"
|
||||
var outcome_text := ""
|
||||
var outcome_color := Color("#9ed7aa")
|
||||
var outcome_color := PageChrome.INK
|
||||
|
||||
func configure(next_title: String, next_subtitle: String, next_outcome: String, next_color: Color) -> ABGM55ResultHeader:
|
||||
title_text = next_title
|
||||
@@ -16,16 +17,14 @@ func configure(next_title: String, next_subtitle: String, next_outcome: String,
|
||||
|
||||
func _ready() -> void:
|
||||
clip_contents = true
|
||||
var title := UIFactory.label(title_text, "title", 1.0, Color("#fff4d6"))
|
||||
var title := UIFactory.label(title_text, "title", 1.0, PageChrome.INK)
|
||||
title.name = "BattleResultHeaderTitle"
|
||||
title.anchor_right = 0.65
|
||||
title.anchor_bottom = 0.62
|
||||
title.clip_text = true
|
||||
title.text_overrun_behavior = TextServer.OVERRUN_TRIM_ELLIPSIS
|
||||
title.add_theme_color_override("font_outline_color", Color(0.03, 0.07, 0.09, 0.92))
|
||||
title.add_theme_constant_override("outline_size", 3)
|
||||
add_child(title)
|
||||
var subtitle := UIFactory.label(subtitle_text, "micro", 1.0, Color("#ffe5a8"))
|
||||
var subtitle := UIFactory.label(subtitle_text, "micro", 1.0, PageChrome.INK_SOFT)
|
||||
subtitle.name = "BattleResultHeaderSubtitle"
|
||||
subtitle.anchor_top = 0.58
|
||||
subtitle.anchor_right = 0.65
|
||||
|
||||
@@ -2,10 +2,12 @@ class_name ABGM55ResultOutcomeSummary
|
||||
extends VBoxContainer
|
||||
|
||||
const UIFactory = preload("res://ui/shared/ui_factory.gd")
|
||||
const PageChrome = preload("res://ui/shared/page_chrome.gd")
|
||||
const UITokens = preload("res://foundation/ui_tokens.gd")
|
||||
var reward_text := ""
|
||||
var xp_text := ""
|
||||
var knockout_text := ""
|
||||
var knockout_color := Color("#9ed7aa")
|
||||
var knockout_color := UITokens.COLOR_SUCCESS
|
||||
|
||||
func configure(next_reward: String, next_xp: String, next_knockout: String, next_color: Color) -> ABGM55ResultOutcomeSummary:
|
||||
reward_text = next_reward
|
||||
@@ -21,12 +23,12 @@ func _ready() -> void:
|
||||
totals.custom_minimum_size = Vector2(0, 48)
|
||||
totals.add_theme_constant_override("separation", 8)
|
||||
add_child(totals)
|
||||
var reward := UIFactory.label(reward_text, "body", 1.0, Color("#f0ca75"))
|
||||
var reward := UIFactory.label(reward_text, "body", 1.0, PageChrome.INK)
|
||||
reward.name = "BattleResultReward"
|
||||
reward.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
reward.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
totals.add_child(reward)
|
||||
var xp := UIFactory.label(xp_text, "body", 1.0, Color("#9ed7aa"))
|
||||
var xp := UIFactory.label(xp_text, "body", 1.0, UITokens.COLOR_SUCCESS)
|
||||
xp.name = "BattleResultXP"
|
||||
xp.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
xp.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
|
||||
Reference in New Issue
Block a user