From 73830832cef3d1b35a0c985f2ea81f86f721adc0 Mon Sep 17 00:00:00 2001 From: CheetoHead Date: Mon, 16 Dec 2019 20:47:19 -0500 Subject: [PATCH] Update PaletteContainer.gd --- Scripts/PaletteContainer.gd | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Scripts/PaletteContainer.gd b/Scripts/PaletteContainer.gd index 7759f8c..096c350 100644 --- a/Scripts/PaletteContainer.gd +++ b/Scripts/PaletteContainer.gd @@ -115,12 +115,16 @@ func on_color_select(index : int) -> void: Global.update_right_custom_brush() func _load_palettes() -> void: + var file := File.new() var dir := Directory.new() if not dir.dir_exists("user://palettes"): dir.make_dir("user://palettes"); - dir.make_dir("user://custom/palettes") + if not dir.dir_exists("user://palettes/custom"): + dir.make_dir("user://palettes/custom") + if not file.file_exists("user://palettes/default_palette.json"): dir.copy("res://Assets/Graphics/Palette/default_palette.json","user://palettes/default_palette.json"); + if not file.file_exists("user://palettes/bubblegum16.json"): dir.copy("res://Assets/Graphics/Palette/bubblegum16.json","user://palettes/bubblegum16.json"); var palette_files : Array = get_palette_files("user://palettes")