From 8e9ba696f160634d19ef83687b36e799b8cba606 Mon Sep 17 00:00:00 2001 From: Ivan Kruger Date: Tue, 30 Apr 2024 13:21:19 +0200 Subject: [PATCH] Make default palettes available for clean installs on MacOS (#1008) * 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 --- src/Autoload/Global.gd | 4 ++++ src/Autoload/Palettes.gd | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Autoload/Global.gd b/src/Autoload/Global.gd index ca0f1724f..60739f71e 100644 --- a/src/Autoload/Global.gd +++ b/src/Autoload/Global.gd @@ -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. diff --git a/src/Autoload/Palettes.gd b/src/Autoload/Palettes.gd index 579f4b9e1..2b1dde23d 100644 --- a/src/Autoload/Palettes.gd +++ b/src/Autoload/Palettes.gd @@ -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()