iter10 追加批: 奖励节点三选一共享池(用户拍板)——AdventureRunner 节点API+AuxItems 句柄面+main 共用面分派+node_overlay 道具面退役+autoplay 节点驱动+reward_overlay_test 随面迁移+a裁备选(L3复杀3)+g裁semver(v2兼容断言+存档序列化v1.3)+f裁调研待办(06新条)+文档五件+任务书(冒烟628/0+run_all 15套+五探针+三闸零新增+熵增PASS)

This commit is contained in:
DKChan committed 2026-10-01 06:12:25 +08:00
1 parent 93e4764ca0
commit 4f62a489b6
19 files changed
+377 -154

No files matched your search

-42
View File
@@ -6,11 +6,9 @@ class_name NodeOverlay
extends Control
signal continue_pressed
signal item_chosen(item_id: String) # 迭代 7 T5——奖励节点三选一兑付(拍板②丙:奖励屏=小构筑点)
var _label: Label
var _btn: Button
var _choice_box: HBoxContainer # 道具三选一按钮区(show_reward_items 时呈现)
func _init() -> void:
@@ -30,56 +28,16 @@ func _init() -> void:
box.add_child(_label)
_btn = UiKit.button("继续")
_btn.pressed.connect(_emit_continue_pressed)
_choice_box = HBoxContainer.new()
_choice_box.add_theme_constant_override("separation", 12)
_choice_box.alignment = BoxContainer.ALIGNMENT_CENTER
box.add_child(_choice_box)
box.add_child(_btn)
visible = false
# 奖励节点兑付(迭代 7 T5——「节点奖励=功能道具正式渠道」关卡节点地图.md:110 定稿兑现;
# 拍板②丙=三选一呈现:池 ≤3 全列(当前有效道具三件——选一即全列),池扩充后加权摇三)。
# choices = [{item_id, display_name, glyph}](组合根组装——视图纯呈现,选择经信号外发)。
# 选择前「继续」隐藏(强制选择);选择即入库存+屏收。
func show_reward_items(choices: Array) -> void:
for c in _choice_box.get_children():
c.queue_free()
if choices.is_empty():
# 池空(全未解锁/表空合法态)——直通节点确认(切片期合法空态语义保留)
_label.text = "关卡奖励点
(此行无道具可取——继续前行)"
_btn.text = "继续"
_btn.visible = true
_choice_box.visible = false
visible = true
return
_label.text = "关卡奖励点
取一件魔法道具(加入关卡背包——关卡结束清空)"
for ch in choices:
var cid := String(ch.get("item_id", ""))
var btn := UiKit.button("%s %s" % [String(ch.get("glyph", "?")), String(ch.get("display_name", ""))])
btn.custom_minimum_size = Vector2(150, 72)
btn.pressed.connect(func(): item_chosen.emit(cid))
_choice_box.add_child(btn)
_btn.visible = false # 选择前不给出口(强制三选一——构筑点语义)
_choice_box.visible = true
visible = true
func show_rest(healed: int, hp_after: int, max_hp: int) -> void:
_label.text = "血量恢复点\n休息回复 %d HP(%d → %d / %d)" % [
healed, hp_after - healed, hp_after, max_hp]
_btn.text = "休息完毕,继续"
visible = true
# 选择完成收屏(组合根在 item_chosen 处理毕调——入库存+确认后回选路由同拍)
func close_reward() -> void:
_choice_box.visible = false
_btn.visible = true
visible = false
# 探针复用:以真实按钮路径触发继续
func press_continue() -> void:
_btn.pressed.emit()