42 lines
1.1 KiB
GDScript
42 lines
1.1 KiB
GDScript
extends CanvasLayer
|
|
class_name UI
|
|
|
|
@onready var monster_list: MarginContainer = %MonsterList
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready() -> void:
|
|
pass # Replace with function body.
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta: float) -> void:
|
|
pass
|
|
|
|
func _on_ingame_controls_menu_button_clicked() -> void:
|
|
monster_list.visible = true
|
|
|
|
# Updates the whole UI
|
|
func _update_ui() -> void:
|
|
# Updating the monster list
|
|
monster_list._update_monster_list()
|
|
|
|
print("UI updated")
|
|
|
|
|
|
func _on_ingame_controls_save_button_clicked() -> void:
|
|
%SaveUI.visible = true
|
|
|
|
func _on_ingame_controls_save_button_released() -> void:
|
|
%SaveUI.visible = false
|
|
|
|
func _on_ingame_controls_save_timer_incremented(value) -> void:
|
|
%SavePercentage.text = str(value)
|
|
|
|
|
|
func _on_ingame_controls_save_timer_reached() -> void:
|
|
%SavePercentage.text = "Saved!"
|
|
print("Saved Game")
|
|
%IngameControls.disable_save_button()
|
|
await get_tree().create_timer(1.0).timeout
|
|
%IngameControls.enable_save_button()
|
|
$SaveUI.visible = false
|
|
%SavePercentage.text = "0 % ..."
|