fix(readiness): anchor warning stack to authored card

This commit is contained in:
2026-09-13 11:22:40 +08:00
parent 0beb71c00b
commit 5879f967fb
4 changed files with 13 additions and 11 deletions
+3
View File
@@ -108,6 +108,9 @@ audio, packaging, device release or unrelated postgame pages.
beneath the readiness summary. Their empty frames leaked through the
translucent runtime band and looked like unexplained controls; the summary
surface is now opaque and is the sole owner of that region.
- `M56-I21`: The warning stack was floating over the world and under the
foreground flag. It now uses the authored upper-right parchment as its sole
surface, with the risk and knockout hints kept in the adjacent left column.
## Gate record
+1 -1
View File
@@ -11,7 +11,7 @@ surface over it.
| --- | --- | --- | --- |
| Top parchment rail, crest, icons and five value slots | `static_master` | `HEADER_VALUE_SLOTS` | Runtime supplies values only; no frame/icon/background copy. The gear at the far right is static; Settings is hit-area only. |
| Four party portraits and their hit targets | `runtime_content` + `hit_area_only` | `MEMBER_HIT_SLOTS` | Portraits and names are runtime content; the surrounding scene is static. |
| Right warning parchment | `static_master` + `runtime_content` + `hit_area_only` | `WARNING_HIT_SLOT` | Runtime supplies warning rows inside the authored parchment. |
| Right warning parchment | `static_master` + `runtime_content` + `hit_area_only` | `WARNING_HIT_SLOT` | Runtime supplies warning rows inside the authored upper-right parchment; the control itself draws no second surface. |
| Readiness summary band | `runtime_content` | `Rect2(0.04, 0.645, 0.73, 0.19)` | Opaque runtime parchment owns the facts and metrics; two unused static transition placeholders beneath it are intentionally occluded. |
| Four lower command surfaces, icons and cream label plates | `static_master` | `ACTION_HIT_SLOTS` | Runtime controls are transparent hit areas. |
| Lower command labels | `runtime_content` | `ACTION_LABEL_SLOTS` | Labels are engine-rendered inside the measured cream plates. |
+8 -9
View File
@@ -154,10 +154,10 @@ func _build_overlay(data: Dictionary) -> void:
overlay.add_child(summary)
var warning_button := _readiness_warning_button(warning_rows, data)
_readiness_place(warning_button, Rect2(0.77, 0.56, 0.15, 0.23))
_readiness_place(warning_button, M55_READINESS_SLOTS.WARNING_HIT_SLOT)
warning_button.z_index = 45
overlay.add_child(warning_button)
var knockout := _readiness_label(overlay, "ReadinessKnockoutRule", Rect2(0.75, 0.42, 0.12, 0.07), localize("击倒后下关归队", "KNOCKOUT RETURNS NEXT STAGE", data), 7, Color("#f5ead0"))
var knockout := _readiness_label(overlay, "ReadinessKnockoutRule", Rect2(0.75, 0.43, 0.12, 0.06), localize("击倒后下关归队", "KNOCKOUT RETURNS NEXT STAGE", data), 7, Color("#f5ead0"))
knockout.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
if bool(Dictionary(data.get("receipt", {})).get("present", false)):
var receipt_surface := UIFactory.notice_surface("ReadinessReceiptSurface", "success")
@@ -171,7 +171,7 @@ func _build_overlay(data: Dictionary) -> void:
var risk_hint := _readiness_label(
overlay,
"ReadinessRiskUnavailable",
Rect2(0.75, 0.27, 0.12, 0.15),
Rect2(0.75, 0.31, 0.12, 0.10),
localize("接受后\n比较风险", "ACCEPT\nTHEN RISK", data),
8,
Color("#f0ca75") if not bool(command_data.get("risk_enabled", false)) else Color("#9ed7aa")
@@ -314,11 +314,10 @@ func _readiness_warning_button(warning_rows: Array, data: Dictionary) -> Button:
button.focus_mode = Control.FOCUS_ALL
button.tooltip_text = localize("查看允许的警告与归属", "Review allowed warnings and ownership", data)
button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND
button.add_theme_stylebox_override("normal", Tokens.surface_style("overlay"))
button.add_theme_stylebox_override("hover", Tokens.flat_command_style("utility", "hover"))
button.add_theme_stylebox_override("pressed", Tokens.flat_command_style("utility", "pressed"))
button.add_theme_stylebox_override("focus", Tokens.flat_command_style("utility", "focus"))
button.add_theme_stylebox_override("disabled", Tokens.surface_style("overlay"))
## The static master already contains the parchment card for this stack.
## Keep the warning control transparent and use it only for input/focus.
for style_name in ["normal", "hover", "pressed", "focus", "disabled", "hover_pressed"]:
button.add_theme_stylebox_override(style_name, StyleBoxEmpty.new())
button.pressed.connect(func(): emit_intent("review_warnings"), CONNECT_DEFERRED)
var lines: Array[String] = []
for row in warning_rows:
@@ -348,7 +347,7 @@ func _readiness_warning_button(warning_rows: Array, data: Dictionary) -> Button:
var label := make_label(lines[index], _readiness_text_size(8), Color("#514331"))
label.name = "WarningLabel"
label.anchor_left = 0.07
label.anchor_right = 0.62
label.anchor_right = 0.95
label.anchor_bottom = 1.0
label.horizontal_alignment = HORIZONTAL_ALIGNMENT_LEFT
label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
+1 -1
View File
@@ -45,7 +45,7 @@ const MEMBER_HIT_SLOTS := [
Rect2(0.460, 0.290, 0.140, 0.300),
Rect2(0.610, 0.290, 0.150, 0.300),
]
const WARNING_HIT_SLOT := Rect2(0.780, 0.560, 0.210, 0.230)
const WARNING_HIT_SLOT := Rect2(0.750, 0.165, 0.230, 0.145)
static func action_hit(index: int) -> Rect2:
return ACTION_HIT_SLOTS[clampi(index, 0, ACTION_HIT_SLOTS.size() - 1)]