52 lines
1.7 KiB
GDScript
52 lines
1.7 KiB
GDScript
# VERTICAL SLICE - NOT FOR PRODUCTION
|
||
# Date: 2026-09-11
|
||
# 关卡节点覆盖层(模态):奖励点/恢复点兑付结果的确认呈现。
|
||
# 高内聚边界:节点文案的玩家可读化(谁获得什么/回复多少)内聚于此;"继续"意图经信号外发。
|
||
class_name NodeOverlay
|
||
extends Control
|
||
|
||
signal continue_pressed
|
||
|
||
var _label: Label
|
||
var _btn: Button
|
||
|
||
|
||
func _init() -> void:
|
||
var dim := ColorRect.new()
|
||
dim.color = Color(0, 0, 0, 0.6)
|
||
dim.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||
add_child(dim)
|
||
var center := CenterContainer.new()
|
||
center.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||
dim.add_child(center)
|
||
var box := VBoxContainer.new()
|
||
box.add_theme_constant_override("separation", 12)
|
||
center.add_child(box)
|
||
_label = UiKit.label("", 20, true)
|
||
_label.add_theme_color_override("font_color", UiKit.WARM)
|
||
_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||
box.add_child(_label)
|
||
_btn = UiKit.button("继续")
|
||
_btn.pressed.connect(func(): continue_pressed.emit())
|
||
box.add_child(_btn)
|
||
visible = false
|
||
|
||
|
||
func show_reward() -> void:
|
||
# 格面资源批(2026-09-15):奖励点内容随可选类道具删除悬置(功能道具渠道 P1 待拍板)——直通节点确认
|
||
_label.text = "关卡奖励点\n(节点内容待定——冒险结构/关卡节点地图 定稿批裁决)"
|
||
_btn.text = "继续"
|
||
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
|
||
|
||
|
||
# 探针复用:以真实按钮路径触发继续
|
||
func press_continue() -> void:
|
||
_btn.pressed.emit()
|