mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 15:54:44 -04:00
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:
parent
9e7a3059f2
commit
a6d129526c
6 changed files with 11 additions and 7 deletions
|
@ -2,7 +2,7 @@ extends Node
|
|||
|
||||
func import_brushes(path : String) -> void:
|
||||
var brushes_dir := Directory.new()
|
||||
brushes_dir.open(".")
|
||||
brushes_dir.open(Global.root_directory)
|
||||
if !brushes_dir.dir_exists(path):
|
||||
brushes_dir.make_dir(path)
|
||||
|
||||
|
@ -16,6 +16,7 @@ func import_brushes(path : String) -> void:
|
|||
func find_brushes(brushes_dir : Directory, path : String) -> Array:
|
||||
var subdirectories := []
|
||||
var found_random_brush := 0
|
||||
path = Global.root_directory.plus_file(path)
|
||||
brushes_dir.open(path)
|
||||
brushes_dir.list_dir_begin(true)
|
||||
var file := brushes_dir.get_next()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue