Skip to content

Commit

Permalink
Make default palettes available for clean installs on MacOS (#1008)
Browse files Browse the repository at this point in the history
* resolved issue where pixelorama_data folder is to registered on MacOS builds

* Reverted changes to workflows and added Mac Resource directory to search path for palettes

* format Global.gd with gdtoolkit
  • Loading branch information
haythamnikolaidis authored Apr 30, 2024
1 parent 4893448 commit 8e9ba69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Autoload/Global.gd
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,10 @@ func _init() -> void:
loaded_locales.sort() # Make sure locales are always sorted
if OS.has_feature("template"):
root_directory = OS.get_executable_path().get_base_dir()
if OS.get_name() == "macOS":
data_directories.append(
root_directory.path_join("../Resources").path_join(CONFIG_SUBDIR_NAME)
)
data_directories.append(root_directory.path_join(CONFIG_SUBDIR_NAME))
if OS.get_name() in ["Linux", "FreeBSD", "NetBSD", "OpenBSD", "BSD"]:
# Checks the list of files var, and processes them.
Expand Down
2 changes: 1 addition & 1 deletion src/Autoload/Palettes.gd
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ func _get_palette_files(path: String) -> PackedStringArray:
var dir := DirAccess.open(path)
var results: PackedStringArray = []

if not is_instance_valid(dir) or not dir.dir_exists(path):
if !dir:
return []

dir.list_dir_begin()
Expand Down

0 comments on commit 8e9ba69

Please sign in to comment.