From 6ea3da7205b407f469c785d22d2d99430baceaeb Mon Sep 17 00:00:00 2001 From: hpham474 Date: Mon, 22 Nov 2021 22:39:42 -0600 Subject: [PATCH] Themes now work on credits page --- godot_ship/script/credits/Credits.gd | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/godot_ship/script/credits/Credits.gd b/godot_ship/script/credits/Credits.gd index fdd48eb..5fcd343 100644 --- a/godot_ship/script/credits/Credits.gd +++ b/godot_ship/script/credits/Credits.gd @@ -1,22 +1,21 @@ extends Control - -# Declare member variables here. Examples: -# var a = 2 -# var b = "text" - +var light_theme = load("res://light_theme.tres") +var dark_theme = load("res://dark_theme.tres") # Called when the node enters the scene tree for the first time. func _ready(): - pass # Replace with function body. - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -#func _process(delta): -# pass - + var _errno = 0; + _errno += OptionsController.connect("change_theme", self, "_on_change_theme") + _on_change_theme(OptionsController.get_theme()) func _on_Back_pressed(): AudioBus.emit_signal("button_clicked") queue_free() pass # Replace with function body. + +func _on_change_theme(theme): + if theme == "light": + self.set_theme(light_theme) + elif theme == "dark": + self.set_theme(dark_theme)