32 lines
1.2 KiB
GDScript3
32 lines
1.2 KiB
GDScript3
extends Control
|
|
|
|
|
|
# Declare member variables here. Examples:
|
|
# var a = 2
|
|
# var b = "text"
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
connect("ship_stats_changed", self, "_on_update_stats")
|
|
self.update_stats()
|
|
|
|
func _on_update_stats():
|
|
self.update_stats()
|
|
|
|
func update_stats():
|
|
get_node("Container/Health").set_value(GameState.ship_stats["health"])
|
|
get_node("Container/Supplies").set_value(GameState.ship_stats["supplies"])
|
|
get_node("Container/Crew").set_value(len(GameState.ship_stats["crew"]))
|
|
get_node("Container/Crew").set_max(GameState.get_difficulty_data("maximum_crew"))
|
|
get_node("Container/DeltaV").set_bbcode("[center]" + str(GameState.ship_stats["deltav"]) + " DeltaV[/center]")
|
|
get_node("Container/Altitude").set_value(GameState.orbit_stats["altitude"])
|
|
get_node("Container/Altitude").set_max(GameState.get_difficulty_data("starting_altitude"))
|
|
get_node("Container/Altitude").set_min(GameState.get_difficulty_data("minimum_altitude"))
|
|
get_node("Container/AltitudeLabel").set_bbcode("[center]xxx / yyy[/center]")
|
|
get_node("Container/DragContainer/Drag").set_text(str(GameState.orbit_stats["drag"]))
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
#func _process(delta):
|
|
# pass
|