From eb9fc09d262c3223b0a2a635e3589adc031c220a Mon Sep 17 00:00:00 2001 From: Sajeg Date: Sat, 6 Jan 2024 17:06:28 +0100 Subject: [PATCH] changed colors --- Scripts/Main.gd | 18 +++++++++--------- Scripts/Palette.gd | 11 ++++++++--- Scripts/TutorialShort.gd | 8 ++++++++ Scripts/settings.gd | 10 +++++++++- 4 files changed, 34 insertions(+), 13 deletions(-) diff --git a/Scripts/Main.gd b/Scripts/Main.gd index abe35b3..854390c 100644 --- a/Scripts/Main.gd +++ b/Scripts/Main.gd @@ -18,9 +18,9 @@ export var dark_mode = false export var fdroid_version = false #The Colors of the Blocks -var block0 = [63, 124, 180] -var block1 = [129, 194, 78] -var block2 = [168, 66, 183] +var block0 = [130, 183, 232] +var block1 = [174, 232, 129] +var block2 = [219, 129, 232] func _ready(): @@ -97,15 +97,15 @@ func load_settings(): func load_colors(): var config = ConfigFile.new() var default_options = { - "block0": [63, 124, 180], - "block1": [129, 194, 78], - "block2": [168, 66, 183] + "block0": [130, 183, 232], + "block1": [174, 232, 129], + "block2": [219, 129, 232] } var err = config.load(color_path) if err != OK: - config.set_value("color", "block0", [63, 124, 180]) - config.set_value("color", "block1", [129, 194, 78]) - config.set_value("color", "block2", [168, 66, 183]) + config.set_value("color", "block0", block0) + config.set_value("color", "block1", block1) + config.set_value("color", "block2", block2) err = config.save(color_path) load_colors() block0 = config.get_value("color", "block0") diff --git a/Scripts/Palette.gd b/Scripts/Palette.gd index f5ffa8f..f29898e 100644 --- a/Scripts/Palette.gd +++ b/Scripts/Palette.gd @@ -216,9 +216,14 @@ func _on_SaveButton_pressed(): func _on_Reset_pressed(): - G.block0 = [63, 124, 180] - G.block1 = [129, 194, 78] - G.block2 = [168, 66, 183] + if G.dark_mode: + G.block0 = [63, 124, 180] + G.block1 = [129, 194, 78] + G.block2 = [168, 66, 183] + else: + G.block0 = [130, 183, 232] + G.block1 = [174, 232, 129] + G.block2 = [219, 129, 232] update_labels() save_colors() diff --git a/Scripts/TutorialShort.gd b/Scripts/TutorialShort.gd index 4a3f8a0..1dc87d0 100644 --- a/Scripts/TutorialShort.gd +++ b/Scripts/TutorialShort.gd @@ -26,12 +26,20 @@ func update_mode(): $ShortTutorial.add_color_override("default_color", Color(1,1,1)) $DarkModeLabel.add_color_override("font_color", Color(1,1,1)) $PlayLabel.add_color_override("font_color", Color(1,1,1)) + if G.block0 == [130, 183, 232] and G.block1 == [174, 232, 129] and G.block2 == [219, 129, 232]: + G.block0 = [63, 124, 180] + G.block1 = [129, 194, 78] + G.block2 = [168, 66, 183] else: VisualServer.set_default_clear_color(Color(1,1,1)) $Title.add_color_override("default_color", Color(0,0,0)) $ShortTutorial.add_color_override("default_color", Color(0,0,0)) $DarkModeLabel.add_color_override("font_color", Color(0,0,0)) $PlayLabel.add_color_override("font_color", Color(0,0,0)) + if G.block0 == [63, 124, 180] and G.block1 == [129, 194, 78] and G.block2 == [168, 66, 183]: + G.block0 = [130, 183, 232] + G.block1 = [174, 232, 129] + G.block2 = [219, 129, 232] save_colors() $AnimationPlayer.play("start") diff --git a/Scripts/settings.gd b/Scripts/settings.gd index aa3d7a4..3311b3d 100644 --- a/Scripts/settings.gd +++ b/Scripts/settings.gd @@ -37,7 +37,15 @@ func update_ui(): $Back/Back.set_texture(preload("res://Assets/angle-left-solid.png")) func update_block_color(): - pass + if G.dark_mode and (G.block0 == [130, 183, 232] and G.block1 == [174, 232, 129] and G.block2 == [219, 129, 232]): + G.block0 = [63, 124, 180] + G.block1 = [129, 194, 78] + G.block2 = [168, 66, 183] + elif G.dark_mode == false and (G.block0 == [63, 124, 180] and G.block1 == [129, 194, 78] and G.block2 == [168, 66, 183]): + G.block0 = [130, 183, 232] + G.block1 = [174, 232, 129] + G.block2 = [219, 129, 232] + func save_settings():