36 lines
987 B
GDScript
36 lines
987 B
GDScript
extends Control
|
|
class_name MonsterList
|
|
|
|
@onready var monster_list_entry_container: VBoxContainer = %MonsterListEntryContainer/VBoxContainer
|
|
@onready var monster_list_entry: PackedScene = preload("res://ui/ingame_menu/party_list_entry.tscn")
|
|
|
|
func _ready() -> void:
|
|
# INFO: Add debug heal function for the "Party" button
|
|
%PartyButton.pressed.connect(debug_heal)
|
|
|
|
visible = false
|
|
for i: int in range(6):
|
|
var entry: Node = monster_list_entry.instantiate()
|
|
monster_list_entry_container.add_child(entry)
|
|
|
|
func _on_close_button_pressed() -> void:
|
|
visible = false
|
|
|
|
func update() -> void:
|
|
for i: int in range(6):
|
|
var entry: Node = monster_list_entry_container.get_child(i)
|
|
|
|
if SaveManager.current_save.party.size() >= i+1:
|
|
var monster: MonsterData = SaveManager.current_save.party[i]
|
|
entry.update(monster)
|
|
else:
|
|
entry.hide_entry()
|
|
|
|
|
|
func _update_player_info() -> void:
|
|
#%PlayerName.text =
|
|
pass
|
|
|
|
func debug_heal() -> void:
|
|
Utils.heal_all()
|
|
UI.ingame_menu.update()
|