diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-08-24 00:32:31 +0100 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-08-25 21:32:55 +0200 |
commit | 46bed8d09f32360377350d71816a76abdfbf2c7c (patch) | |
tree | 7feedae4910dbfe0e53d26ea1e00c4616d2c1850 /NorthstarDLL/configurables.cpp | |
parent | a97f1f07bb5aa31629cd87023e09669eb4bf1fe9 (diff) | |
download | NorthstarLauncher-1.9.5-rc1.tar.gz NorthstarLauncher-1.9.5-rc1.zip |
Adjust folder structure (#242)v1.9.5-rc1v1.9.5
* Adjust folder structure
* change launcher directory name
Diffstat (limited to 'NorthstarDLL/configurables.cpp')
-rw-r--r-- | NorthstarDLL/configurables.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/NorthstarDLL/configurables.cpp b/NorthstarDLL/configurables.cpp new file mode 100644 index 00000000..389e6e0b --- /dev/null +++ b/NorthstarDLL/configurables.cpp @@ -0,0 +1,38 @@ +#include <string> +#include "pch.h" +#include "configurables.h" + +std::string GetNorthstarPrefix() +{ + return NORTHSTAR_FOLDER_PREFIX; +} + +void parseConfigurables() +{ + char* clachar = strstr(GetCommandLineA(), "-profile="); + if (clachar) + { + std::string cla = std::string(clachar); + if (strncmp(cla.substr(9, 1).c_str(), "\"", 1)) + { + int space = cla.find(" "); + std::string dirname = cla.substr(9, space - 9); + spdlog::info("Found profile in command line arguments: " + dirname); + NORTHSTAR_FOLDER_PREFIX = dirname; + } + else + { + std::string quote = "\""; + int quote1 = cla.find(quote); + int quote2 = (cla.substr(quote1 + 1)).find(quote); + std::string dirname = cla.substr(quote1 + 1, quote2); + spdlog::info("Found profile in command line arguments: " + dirname); + NORTHSTAR_FOLDER_PREFIX = dirname; + } + } + else + { + spdlog::info("Profile was not found in command line arguments. Using default: R2Northstar"); + NORTHSTAR_FOLDER_PREFIX = "R2Northstar"; + } +} |