Done refactoring
This commit is contained in:
parent
3a136ff215
commit
2176e9d798
88 changed files with 821 additions and 880 deletions
19
scripts/misc/Counter.gd
Normal file
19
scripts/misc/Counter.gd
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
extends Label
|
||||
|
||||
@export var counter_id : String
|
||||
@onready var ship = $"../../.."
|
||||
@onready var hull = $"../../../Hull"
|
||||
@onready var shield = $"../../../Shield"
|
||||
|
||||
func _process(_delta) -> void:
|
||||
match counter_id:
|
||||
"ammo":
|
||||
text = str(hull.ammunition)
|
||||
"fuel":
|
||||
text = "Fuel: {fuel} / {max} units".format({"fuel":hull.fuel, "max":hull.max_fuel})
|
||||
"hp":
|
||||
text = "Hull Strength: {hp} / {max} units".format({"hp":"%0.2f" % hull.hp, "max":hull.max_hp})
|
||||
"money":
|
||||
text = "Available Money: {money} units".format({"money":ship.money})
|
||||
"shield":
|
||||
text = "Shield Capacity: {shield} / {max} units".format({"shield":"%0.2f" % shield.capacity, "max":shield.max_capacity})
|
||||
Loading…
Add table
Add a link
Reference in a new issue