From 13f86339bb5e5eddd4f5366f0f8df5ce1c57bb9b Mon Sep 17 00:00:00 2001 From: Daniel Scalzi Date: Sat, 25 Feb 2023 03:28:40 -0500 Subject: [PATCH] Inject common/instance dir. --- app/assets/js/distromanager.js | 2 ++ app/assets/js/preloader.js | 5 +++++ app/assets/js/scripts/landing.js | 1 + 3 files changed, 8 insertions(+) diff --git a/app/assets/js/distromanager.js b/app/assets/js/distromanager.js index 406744fe..ce3ea87a 100644 --- a/app/assets/js/distromanager.js +++ b/app/assets/js/distromanager.js @@ -6,6 +6,8 @@ exports.REMOTE_DISTRO_URL = 'http://mc.westeroscraft.com/WesterosCraftLauncher/d const api = new DistributionAPI( ConfigManager.getLauncherDirectory(), + null, // Injected forcefully by the preloader. + null, // Injected forcefully by the preloader. exports.REMOTE_DISTRO_URL, false ) diff --git a/app/assets/js/preloader.js b/app/assets/js/preloader.js index 4f66086c..ae01bb83 100644 --- a/app/assets/js/preloader.js +++ b/app/assets/js/preloader.js @@ -17,6 +17,11 @@ logger.info('Loading..') // Load ConfigManager ConfigManager.load() +// Yuck! +// TODO Fix this +DistroAPI['commonDir'] = ConfigManager.getCommonDirectory() +DistroAPI['instanceDir'] = ConfigManager.getInstanceDirectory() + // Load Strings LangLoader.loadLanguage('en_US') diff --git a/app/assets/js/scripts/landing.js b/app/assets/js/scripts/landing.js index 22e5d912..a36f8706 100644 --- a/app/assets/js/scripts/landing.js +++ b/app/assets/js/scripts/landing.js @@ -515,6 +515,7 @@ async function dlAsync(login = true) { const fullRepairModule = new FullRepair( ConfigManager.getCommonDirectory(), + ConfigManager.getInstanceDirectory(), ConfigManager.getLauncherDirectory(), ConfigManager.getSelectedServer(), DistroAPI.isDevMode()