From fa2a54a01970bf2ff81c56750765042aeed25efb Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 17 Feb 2024 22:14:44 +0100 Subject: [PATCH] Added a way for platforms to define a custom resource pack location. --- core/config/project_settings.cpp | 8 ++++++++ core/os/os.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index cc93dd540f..09ed90b1c3 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -399,6 +399,14 @@ Error ProjectSettings::_setup(const String &p_path, const String &p_main_pack, b } #endif + if (!found) { + String crl = OS::get_singleton()->get_custom_platform_resource_pack_location(); + + if (!crl.empty()) { + found = _load_resource_pack(crl); + } + } + if (!found) { // Try to load data pack at the location of the executable. // As mentioned above, we have two potential names to attempt. diff --git a/core/os/os.h b/core/os/os.h index e3f9967e53..2e9078d5e0 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -687,6 +687,8 @@ class OS { virtual void process_and_drop_events() {} + virtual String get_custom_platform_resource_pack_location() { return String(); } + OS(); virtual ~OS(); };