Skip to content

Commit

Permalink
changed colors
Browse files Browse the repository at this point in the history
  • Loading branch information
Sajeg committed Jan 6, 2024
1 parent ea04baa commit eb9fc09
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 13 deletions.
18 changes: 9 additions & 9 deletions Scripts/Main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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")
Expand Down
11 changes: 8 additions & 3 deletions Scripts/Palette.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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()
8 changes: 8 additions & 0 deletions Scripts/TutorialShort.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
10 changes: 9 additions & 1 deletion Scripts/settings.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit eb9fc09

Please sign in to comment.