Files
gplan-2/game/presentation/views/node_overlay.gd

39 lines
1.3 KiB
GDScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## VERTICAL SLICE - NOT FOR PRODUCTION
## 关卡节点覆盖层(模态):奖励点/恢复点兑付结果的确认呈现;节点文案的玩家可读化内聚于此。
class_name NodeOverlay
extends Control
signal continue_pressed
var _label: Label
var _btn: Button
func _init() -> void:
# M5(UI 落码批):rest 兑付面板 plate9 石板化+暖金头带字(demo ④休息弹层;暗字上亮板 §7.2)
var shell: Dictionary[Variant, Variant] = UiKit.modal_shell(self, Color(0, 0, 0, 0.6), Vector2.ZERO, 14,
UiKit.panel_skinned(Vector4(26, 18, 26, 18)))
var box: VBoxContainer = shell.box
_label = UiKit.label("",UiKit.FS_SUB, true, UiKit.INK_TITLE)
_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
box.add_child(_label)
_btn = UiKit.primary_button("继续")
_btn.pressed.connect(_emit_continue_pressed)
box.add_child(_btn)
visible = false
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()
func _emit_continue_pressed() -> void:
continue_pressed.emit()