mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-31 00:11:54 +08:00
feat(UI): 添加显示实体属性的面板和动画效果
添加新的输入动作"showFields"用于显示/隐藏实体属性面板 创建新的FieldShow组件用于显示实体属性值 为属性面板添加显示/隐藏动画效果 调整EntityBase中属性初始化的顺序
This commit is contained in:
@@ -7,6 +7,8 @@ class_name UIState
|
||||
@onready var items = $"%items"
|
||||
@onready var energyLabel: Label = $"%energy"
|
||||
@onready var energyMaxLabel: Label = $"%energyMax"
|
||||
@onready var fields: VBoxContainer = $"%fields"
|
||||
@onready var fieldsAnimator: AnimationPlayer = $"%fieldsAnimator"
|
||||
|
||||
static var player: EntityBase = null
|
||||
static var bossbar: EntityStateBar
|
||||
@@ -33,6 +35,14 @@ func _physics_process(_delta):
|
||||
WorldManager.rootNode.process_mode = Node.PROCESS_MODE_DISABLED
|
||||
else:
|
||||
WorldManager.rootNode.process_mode = Node.PROCESS_MODE_INHERIT
|
||||
if Input.is_action_just_pressed("showFields"):
|
||||
for i in fields.get_children():
|
||||
fields.remove_child(i)
|
||||
for i in player.fields:
|
||||
fields.add_child(FieldShow.create(i, player.fields[i], false))
|
||||
fieldsAnimator.play("show")
|
||||
if Input.is_action_just_released("showFields"):
|
||||
fieldsAnimator.play("hide")
|
||||
|
||||
static func setPanel(targetName: String = ""):
|
||||
currentPanel = null
|
||||
|
||||
Reference in New Issue
Block a user