This repository has been archived on 2020-09-30. You can view files and clone it, but cannot push or open issues or pull requests.
odyssey-old/Actors/Objects/Computer/UI/ControlComp.gd

16 lines
651 B
GDScript3
Raw Permalink Normal View History

2020-07-06 22:00:39 +00:00
extends Control
onready var scene = $"/root/scene" as GameInstance
2020-07-07 18:42:22 +00:00
func _physics_process(_delta):
2020-07-10 00:09:54 +00:00
var speed_str = str(round(scene.world.map.current_ship_speed)) + " u/s"
$Container/VelocityBox/HBoxContainer3/CurrentSpeed.text = speed_str
var dir_str = str(round(rad2deg(scene.world.map.current_ship_direction))) + " deg"
$Container/VelocityBox/HBoxContainer2/CurrentDirection.text = dir_str
2020-07-06 22:00:39 +00:00
func _ship_velocity_changed(value):
scene.process_command(UICommand.new(UICommand.CommandType.SetShipSpeed, [value]))
func _ship_direction_changed(value):
scene.process_command(UICommand.new(UICommand.CommandType.SetShipDirection, [deg2rad(value)]))