chore(structure): 垂直切片转正——prototypes/dungeon-sweeper-vertical-slice 迁为 game/,26 文件路径同步(CLAUDE.md/tools×4/tests×3/QA脚本×3/GDD×6/架构文档),static_scan S1/S2+S4 规则集首跑收敛(用户拍板 2026-09-24,台账 148)
This commit is contained in:
1 parent
bc433936b7
commit
13f93c74ff
220 files changed
+66
-63
No files matched your search
@@ -0,0 +1,34 @@
|
||||
# VERTICAL SLICE - NOT FOR PRODUCTION
|
||||
# 实现 GDD:design/ux/interaction-patterns.md(pattern 6 模态 overlay 层级纪律)。
|
||||
# Date: 2026-09-12(code-review 修复批——自 main.gd 拆出,规范 1.1 状态装配独立成类)
|
||||
# 模态层级状态机:登记序 = 树序 = z 遮挡序;打开时显式隐藏树序在其上方的可见层、关闭恢复
|
||||
# (缺陷⑤纪律载体:功能存在 ≠ 功能可达——遮挡关系不得靠树序巧合)。
|
||||
# 纯逻辑零节点构建——组合根持有本类并喂入 Control;不持久化核心状态。
|
||||
extends RefCounted
|
||||
|
||||
var _list: Array = [] # 登记序 = z 遮挡序(低 → 高)
|
||||
var _occluded := {} # modal → 被其隐藏的上方层(关闭恢复)
|
||||
|
||||
|
||||
func register(m: Control) -> void:
|
||||
_list.append(m)
|
||||
|
||||
|
||||
func open(m: Control) -> void:
|
||||
var hidden: Array = []
|
||||
var idx := _list.find(m)
|
||||
for i in range(idx + 1, _list.size()):
|
||||
var higher: Control = _list[i]
|
||||
if is_instance_valid(higher) and higher.visible:
|
||||
higher.visible = false
|
||||
hidden.append(higher)
|
||||
_occluded[m] = hidden
|
||||
m.visible = true
|
||||
|
||||
|
||||
func close(m: Control) -> void:
|
||||
m.visible = false
|
||||
for h in _occluded.get(m, []):
|
||||
if is_instance_valid(h):
|
||||
h.visible = true
|
||||
_occluded.erase(m)
|
||||
Reference in new issue
Block a user