21 lines
505 B
GDScript
21 lines
505 B
GDScript
extends Panel
|
|
# planet_menu.gd - UI for interacting with a planet
|
|
|
|
onready var label = $VBox/Label
|
|
onready var build_btn = $VBox/BuildButton
|
|
var current_planet = null
|
|
|
|
func _ready():
|
|
visible = false
|
|
build_btn.pressed = false
|
|
build_btn.connect("pressed", Callable(self, "_on_build_pressed"))
|
|
|
|
func open_for(planet):
|
|
current_planet = planet
|
|
label.text = "Planet: %s" % planet.name
|
|
visible = true
|
|
|
|
func _on_build_pressed():
|
|
if current_planet:
|
|
current_planet.build("Mine")
|