Added state component

This commit is contained in:
2024-02-15 13:45:17 +01:00
parent 17a507d07c
commit 37ed8890ec
19 changed files with 172 additions and 86 deletions

View File

@ -3,6 +3,6 @@ extends Control
var text: String:
get:
return get_child(1).text
return %Value.text
set(value):
get_child(1).text = value
%Value.text = value

View File

@ -12,4 +12,5 @@ text = "Container:"
script = ExtResource("2_l1apn")
[node name="Value" type="Label" parent="."]
unique_name_in_owner = true
layout_mode = 2

View File

@ -0,0 +1,14 @@
extends DebugLabel
var keys := StateComponent.State.keys()
var state: StateComponent
func _process(_delta):
if !Global.player:
return
if !state:
state = Global.player.get_node("State")
return
text = keys[state.current]