Initial project sync

This commit is contained in:
wxm
2026-07-06 22:55:14 -07:00
commit 8cca00d0da
1066 changed files with 58585 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
class_name EnergyBar
extends ProgressBar
func _ready() -> void:
show_percentage = false
_event_bus().connect("player_energy_changed", refresh)
func refresh(current: float, maximum: float) -> void:
max_value = maxf(0.01, maximum)
value = clampf(current, 0.0, maximum)
func _event_bus() -> Node:
var root := get_tree().root
var bus := root.get_node_or_null("EventBus")
if bus == null:
bus = load("res://autoload/event_bus.gd").new()
bus.name = "EventBus"
root.add_child(bus)
return bus