You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.1 KiB
47 lines
1.1 KiB
extends Node
|
|
|
|
|
|
var config:ConfigResource
|
|
var config_path := "user://settings.tres"
|
|
|
|
|
|
func _ready():
|
|
load_config()
|
|
|
|
|
|
func go_to_main_menu():
|
|
var _done = get_tree().change_scene("res://gui/MainMenu.tscn")
|
|
|
|
|
|
func go_to_settings():
|
|
var _done = get_tree().change_scene("res://gui/forms/SettingsForm.tscn")
|
|
|
|
|
|
func go_to_twitch_settings():
|
|
var _done = get_tree().change_scene("res://gui/forms/twitch_config/TwitchAuthConfig.tscn")
|
|
|
|
|
|
func load_config():
|
|
if File.new().file_exists(self.config_path):
|
|
self.config = load(self.config_path)
|
|
if null == self.config:
|
|
self.config = ConfigResource.new()
|
|
|
|
|
|
func save_config():
|
|
var saved = ResourceSaver.save(self.config_path, self.config)
|
|
if OK != saved:
|
|
printerr("Failed to save configuration.")
|
|
|
|
|
|
func start_poll(poll):
|
|
prints("Starting poll", poll)
|
|
# Start listening to chat commands
|
|
# Prepare timer for automatic closing of the poll
|
|
# Move to poll results scene
|
|
var _done = get_tree().change_scene("res://addons/majority_judgment/nodes/MajorityJudgmentLinearResultsControl.tscn")
|
|
yield(get_tree(), "idle_frame")
|
|
get_tree().current_scene.set_poll(poll)
|
|
|
|
|