Fixed issue where Brushes and Palettes wouldn't load if you opened Pixelorama from a file

It now uses "OS.get_executable_path().get_base_dir()" to find the root directory of Pixelorama, instead of just "."
This commit is contained in:
OverloadedOrama 2020-02-10 01:23:33 +02:00
parent 9e7a3059f2
commit a6d129526c
6 changed files with 11 additions and 7 deletions

View file

@ -1,8 +1,8 @@
extends GridContainer
const palette_button = preload("res://Prefabs/PaletteButton.tscn");
const palettes_path := "Palettes"
const palette_button = preload("res://Prefabs/PaletteButton.tscn")
var palettes_path := "Palettes"
var current_palette = "Default"
var from_palette : Palette
@ -150,8 +150,9 @@ func on_color_select(index : int) -> void:
Global.update_right_custom_brush()
func _load_palettes() -> void:
palettes_path = Global.root_directory.plus_file(palettes_path)
var dir := Directory.new()
dir.open(".")
dir.open(Global.root_directory)
if not dir.dir_exists(palettes_path):
dir.make_dir(palettes_path)