You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.1 KiB
GDScript
42 lines
1.1 KiB
GDScript
extends Control
|
|
|
|
@onready var mp_scene = preload("res://scene/ui/item/mp_item.tscn")
|
|
@onready var hp_bar = $HpBar as TextureProgressBar
|
|
@onready var mp_sub_bar = $MpSubBar as TextureProgressBar
|
|
@onready var mp_list = $MpList as HBoxContainer
|
|
@onready var break_level_label = $TestBreakLevel as Label
|
|
|
|
func _process(delta: float) -> void:
|
|
# test
|
|
var player: Character = Global.character_mgr.get_player()
|
|
break_level_label.text = str(player.get_status("break_level"))
|
|
|
|
func on_hp_max_changed(value: float):
|
|
hp_bar.max_value = value
|
|
|
|
|
|
func on_hp_changed(value: float):
|
|
hp_bar.value = value
|
|
|
|
|
|
func on_mp_sub_max_changed(value: float):
|
|
mp_sub_bar.max_value = value
|
|
|
|
|
|
func on_mp_sub_changed(value: float):
|
|
mp_sub_bar.value = value
|
|
|
|
|
|
func on_mp_max_changed(value: int):
|
|
for child in mp_list.get_children():
|
|
child.queue_free()
|
|
for i in range(value):
|
|
var mp_item = mp_scene.instantiate() as MpItemSub
|
|
mp_list.add_child(mp_item)
|
|
|
|
|
|
func on_mp_changed(value: int):
|
|
for i in range(mp_list.get_child_count()):
|
|
var mp_item = mp_list.get_child(i) as MpItemSub
|
|
mp_item.set_active(i<value)
|