按 code-conventions §1.4.1 第三轮定稿执行:core 22+schemas 18+presentation 根 14+views 28,全部头注 #→##、删日期/变更叙事/GDD 与架构反向链接/字段与域清单/机制描述,保留职责摘要+真实使用约束(防事故禁令/单一入口/信号契约每信号一行)。main.gd 31→5 行、save_manager 45→5 行、adventure_runner 37→5 行为最大单件。子代理分模块执行(波一 core+schemas、波二 presentation+views,并发≤2)。验收=tools/verify_comment_only_change.py 逐字节校验(82 文件头注区外逐行一致=零行为变更)+audit_file_headers 全绿;纯注释批免冒烟(先例 5843270)
85 lines
3.4 KiB
GDScript
85 lines
3.4 KiB
GDScript
## VERTICAL SLICE - NOT FOR PRODUCTION
|
|
## 格态语义图例模态(自持 open/close 开关)。
|
|
class_name LegendOverlay
|
|
extends Control
|
|
|
|
signal closed
|
|
|
|
const ENTRIES := [
|
|
["#C9AF83", "完整覆尘地砖", "未开格——左键挖开(1AP,须相邻)· 右键插旗(1AP)"],
|
|
["#B39A78", "碎裂裸土", "已开 0 格——可通行,左键移动(免费)"],
|
|
["#000000", "旗", "封印印记(呈现名·不能拔)——轮末自动判定标中;插错可左键直接挖开(安全格零奖励、雷格吃挖雷惩罚)"],
|
|
["#2e86de", "小人", "探险者——8 向相邻未开格常驻微光 = 可挖域"],
|
|
["#F0A828", "金徽章", "已开格奖励身份 icon(旗之下、数值之上,不进数字区)"],
|
|
["#F0A828", "九徽章解码", "攻=攻击 · 守=护甲 · 爆=爆裂 · 医=回复 · 弱=削弱 · 穿=穿刺 · 魔=魔法 · 行=行动点 · 金=金币(打磨包 2026-09-29 入列)"],
|
|
["#33261B", "状态槽空态", "无状态效果时槽位隐藏,数据框上移补位——非异常"],
|
|
]
|
|
|
|
var _panel: PanelContainer
|
|
|
|
|
|
var _rap_cost := -1 # <0 = 不渲染 RAP 行(打磨包 2026-09-29——构造参数注表值,禁字面量)
|
|
|
|
|
|
func _init(rap_cost: int = -1) -> void:
|
|
_rap_cost = rap_cost
|
|
var shell := UiKit.modal_shell(self, Color(UiKit.DIM, 0.55), Vector2(520, 0), 6, true,
|
|
UiKit.panel_skinned(Vector4(12, 10, 12, 10))) # 石板皮(T2;缺位回退 flat)
|
|
_panel = shell.panel
|
|
(shell.dim as ColorRect).gui_input.connect(_on_dim_gui_input)
|
|
var box: VBoxContainer = shell.box
|
|
var title := UiKit.label("图例 · 格态",UiKit.FS_SUB, true, UiKit.INK_TITLE) # 亮底墨字(§7.2 数据素面)
|
|
box.add_child(title)
|
|
box.add_child(HSeparator.new())
|
|
for e in ENTRIES:
|
|
var row := HBoxContainer.new()
|
|
row.add_theme_constant_override("separation", 8)
|
|
var chip := ColorRect.new()
|
|
chip.custom_minimum_size = Vector2(18, 18)
|
|
chip.color = Color(e[0])
|
|
row.add_child(chip)
|
|
var lab := UiKit.label("%s —— %s" % [e[1], e[2]], 13, false, UiKit.INK_LABEL) # 亮底墨字(§7.2 数据素面)
|
|
lab.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
|
lab.custom_minimum_size = Vector2(440, 0)
|
|
row.add_child(lab)
|
|
box.add_child(row)
|
|
box.add_child(HSeparator.new())
|
|
# RAP 行(打磨包 2026-09-29——表值驱动,禁字面量:刷新代价读行动经济表)
|
|
if _rap_cost >= 0:
|
|
var rap_row := HBoxContainer.new()
|
|
rap_row.add_theme_constant_override("separation", 8)
|
|
var rap_chip := ColorRect.new()
|
|
rap_chip.custom_minimum_size = Vector2(18, 18)
|
|
rap_chip.color = UiKit.GOLD # 同 #F0A828——金徽章同源单点(T4 裸色收口)
|
|
rap_row.add_child(rap_chip)
|
|
var rap_lab := UiKit.label("RAP 储备行动点 —— 停手时剩余 AP 转存;弃图刷新消耗 RAP−%d(旧板旗作废,AP 保留继续挖)" % _rap_cost,UiKit.FS_HINT, false, UiKit.INK_LABEL)
|
|
rap_lab.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
|
rap_lab.custom_minimum_size = Vector2(440, 0)
|
|
rap_row.add_child(rap_lab)
|
|
box.add_child(rap_row)
|
|
box.add_child(HSeparator.new())
|
|
var close_btn := UiKit.button("关闭")
|
|
close_btn.pressed.connect(close)
|
|
box.add_child(close_btn)
|
|
visible = false
|
|
|
|
|
|
func is_open() -> bool:
|
|
return visible
|
|
|
|
|
|
func open() -> void:
|
|
visible = true
|
|
|
|
|
|
func close() -> void:
|
|
if not visible:
|
|
return
|
|
visible = false
|
|
closed.emit()
|
|
|
|
|
|
func _on_dim_gui_input(ev: InputEvent) -> void:
|
|
if ev is InputEventMouseButton and ev.pressed:
|
|
close()
|