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)