godot-third-person-basic-scene/scenes/developper/sky_panel.gd

24 lines
1.1 KiB
GDScript

extends VBoxContainer
signal celestial_manual_moved(parameters)
func _ready():
# Get the initial positions of celestial objects from shader paramaters
# to display them in proper panel
# var positions = get_node("/root/maine_scene/terrain_basic_setup/WorldEnvironment").Environment.get_celestial_coordinates()
var positions = khanat_world.celestial_positions
print("Positions : %s" %positions)
for planet in ["samayun", "stigi", "zabr"]:
get_node("%s_panel/data_panel/%s_pos" %[planet, planet]).text = "%s :\n - X %2f\n - Y %2f\n - Z %2f" % [tr("lab_position"), positions["%s_position" %[planet]][0], positions["%s_position" %[planet]][1], positions["%s_position" %[planet]][2]]
get_node("%s_panel/data_panel/%s_arc" %[planet, planet]).text = "%s : %s" % [tr("lab_size"), positions["%s_arc" %[planet]]]
func _process(delta):
pass
func _on_samayun_arc_value_value_changed(value):
khanat_world.celestial_positions["samayun_arc"] = value
$samayun_panel/data_panel/samayun_arc_value.value = value
$samayun_panel/data_panel/samayun_arc.text = "%s : %s" % [tr("lab_size"), str(value)]
emit_signal("celestial_manual_moved", khanat_world.celestial_positions)