Rescaled maps and reworked drone code to support fpv remote and joy controller with a menu switch
40 lines
1.0 KiB
GDScript
40 lines
1.0 KiB
GDScript
extends Control
|
|
|
|
@export var start_button: Button
|
|
@export var quit_button: Button
|
|
@export var controller_mode_button: CheckButton
|
|
@export var joy_controller_label: Label
|
|
@export var fpv_remote_label: Label
|
|
|
|
|
|
func _ready():
|
|
start_button.pressed.connect(_on_start_button_pressed)
|
|
quit_button.pressed.connect(_on_quit_button_pressed)
|
|
self.visibility_changed.connect(_on_visibility_changed)
|
|
start_button.grab_focus()
|
|
|
|
|
|
func _on_start_button_pressed():
|
|
hide()
|
|
GameManager.start_game()
|
|
|
|
|
|
func _on_quit_button_pressed():
|
|
get_tree().quit()
|
|
|
|
|
|
func _on_visibility_changed() -> void:
|
|
if visible:
|
|
start_button.grab_focus()
|
|
|
|
|
|
func _on_controller_mode_button_toggled(toggled_on):
|
|
if toggled_on:
|
|
GameManager.controller_mode = "FPVRemote"
|
|
joy_controller_label.self_modulate = Color(0.5, 0.5, 0.5, 1.0)
|
|
fpv_remote_label.self_modulate = Color(0.0, 1.0, 0.0, 1.0)
|
|
elif !toggled_on:
|
|
GameManager.controller_mode = "JoyController"
|
|
joy_controller_label.self_modulate = Color(0.0, 1.0, 0.0, 1.0)
|
|
fpv_remote_label.self_modulate = Color(0.5, 0.5, 0.5, 1.0)
|