2021-10-20 02:13:23 +00:00
|
|
|
extends Control
|
|
|
|
|
2021-11-14 08:50:39 +00:00
|
|
|
var light_theme = load("res://light_theme.tres")
|
|
|
|
var dark_theme = load("res://dark_theme.tres")
|
|
|
|
|
2021-10-20 02:13:23 +00:00
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
|
|
func _ready():
|
2021-10-21 06:24:27 +00:00
|
|
|
$VBoxContainer/Singleplayer.grab_focus()
|
2021-11-14 08:50:39 +00:00
|
|
|
var _errno = 0;
|
|
|
|
_errno += OptionsController.connect("change_theme", self, "_on_change_theme")
|
|
|
|
_on_change_theme(OptionsController.get_theme())
|
2021-10-20 02:13:23 +00:00
|
|
|
|
|
|
|
func _on_Singleplayer_pressed():
|
2021-11-08 02:53:08 +00:00
|
|
|
AudioBus.emit_signal("button_clicked")
|
2021-11-24 18:17:07 +00:00
|
|
|
MessageBus.emit_signal("change_scene", "Gameplay")
|
2021-10-21 06:24:27 +00:00
|
|
|
queue_free()
|
|
|
|
|
2021-10-20 02:13:23 +00:00
|
|
|
func _on_Multiplayer_pressed():
|
2021-11-08 02:53:08 +00:00
|
|
|
AudioBus.emit_signal("button_clicked")
|
2021-10-20 05:40:31 +00:00
|
|
|
MessageBus.emit_signal("change_scene", "Multiplayer")
|
2021-10-21 06:24:27 +00:00
|
|
|
queue_free()
|
2021-10-20 02:13:23 +00:00
|
|
|
|
|
|
|
func _on_Options_pressed():
|
2021-11-08 02:53:08 +00:00
|
|
|
AudioBus.emit_signal("button_clicked")
|
2021-10-20 05:40:31 +00:00
|
|
|
MessageBus.emit_signal("change_scene", "Options")
|
2021-10-21 06:24:27 +00:00
|
|
|
queue_free()
|
2021-10-20 02:13:23 +00:00
|
|
|
|
2021-11-23 04:35:28 +00:00
|
|
|
func _on_Credits_pressed():
|
|
|
|
AudioBus.emit_signal("button_clicked")
|
|
|
|
MessageBus.emit_signal("change_scene", "Credits")
|
|
|
|
queue_free()
|
|
|
|
|
2021-10-20 02:13:23 +00:00
|
|
|
func _on_Quit_pressed():
|
2021-11-08 02:53:08 +00:00
|
|
|
AudioBus.emit_signal("button_clicked")
|
2021-10-20 05:40:31 +00:00
|
|
|
MessageBus.emit_signal("quit")
|
2021-10-21 06:24:27 +00:00
|
|
|
queue_free()
|
2021-11-14 08:50:39 +00:00
|
|
|
|
|
|
|
func _on_change_theme(theme):
|
|
|
|
if theme == "light":
|
|
|
|
self.set_theme(light_theme)
|
|
|
|
elif theme == "dark":
|
|
|
|
self.set_theme(dark_theme)
|