mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-09-12 11:35:09 -04:00
Move mods to config dir & updates for macOS
This commit is contained in:
@@ -253,7 +253,7 @@ void ModLoader::tryLoadDusk(const std::filesystem::path& modPath) {
|
||||
return;
|
||||
}
|
||||
|
||||
const fs::path cacheDir = fs::path("mods") / ".cache" / modPath.stem();
|
||||
const fs::path cacheDir = m_modsDir / ".cache" / modPath.stem();
|
||||
std::error_code ec;
|
||||
fs::create_directories(cacheDir, ec);
|
||||
|
||||
@@ -315,7 +315,7 @@ void ModLoader::init() {
|
||||
m_initialized = true;
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
if (!fs::exists(m_modsDir)) {
|
||||
if (!fs::is_directory(m_modsDir)) {
|
||||
DuskLog.info("ModLoader: mods directory '{}' not found — mod loading skipped",
|
||||
m_modsDir.string());
|
||||
return;
|
||||
|
||||
+10
-2
@@ -493,7 +493,7 @@ int game_main(int argc, char* argv[]) {
|
||||
("h,help", "Print usage")
|
||||
("console", "Show the Windows console window for logs", cxxopts::value<bool>()->default_value("false")->implicit_value("true"))
|
||||
("dvd", "Path to DVD image file", cxxopts::value<std::string>())
|
||||
("mods", "Path to mods directory", cxxopts::value<std::string>()->default_value("mods"))
|
||||
("mods", "Path to mods directory", cxxopts::value<std::string>())
|
||||
("backend", "Graphics API backend to use (auto, d3d12, metal, vulkan, null)", cxxopts::value<std::string>())
|
||||
("cvar", "Override configuration variables without modifying config", cxxopts::value<std::vector<std::string>>());
|
||||
|
||||
@@ -619,7 +619,15 @@ int game_main(int argc, char* argv[]) {
|
||||
mDoMain::developmentMode = 1; // Force Dev Mode for Debugging
|
||||
mDoDvdThd::SyncWidthSound = false;
|
||||
|
||||
dusk::ModLoader::instance().setModsDir(parsed_arg_options["mods"].as<std::string>());
|
||||
// Setup mods
|
||||
if (parsed_arg_options.contains("mods") &&
|
||||
!parsed_arg_options["mods"].as<std::string>().empty())
|
||||
{
|
||||
dusk::ModLoader::instance().setModsDir(parsed_arg_options["mods"].as<std::string>());
|
||||
} else {
|
||||
dusk::ModLoader::instance().setModsDir(dusk::ConfigPath / "mods");
|
||||
}
|
||||
|
||||
OSReport("Starting main01 (Game Loop)...\n");
|
||||
main01();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user