diff options
author | Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> | 2023-12-27 00:32:01 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-27 01:32:01 +0100 |
commit | f5ab6fb5e8be7b73e6003d4145081d5e0c0ce287 (patch) | |
tree | 90f2c6a4885dbd181799e2325cf33588697674e1 /primedev/config | |
parent | bb8ed59f6891b1196c5f5bbe7346cd171c8215fa (diff) | |
download | NorthstarLauncher-f5ab6fb5e8be7b73e6003d4145081d5e0c0ce287.tar.gz NorthstarLauncher-f5ab6fb5e8be7b73e6003d4145081d5e0c0ce287.zip |
Folder restructuring from primedev (#624)v1.21.2-rc3v1.21.2
Copies of over the primedev folder structure for easier cherry-picking of further changes
Co-authored-by: F1F7Y <filip.bartos07@proton.me>
Diffstat (limited to 'primedev/config')
-rw-r--r-- | primedev/config/profile.cpp | 40 | ||||
-rw-r--r-- | primedev/config/profile.h | 7 |
2 files changed, 47 insertions, 0 deletions
diff --git a/primedev/config/profile.cpp b/primedev/config/profile.cpp new file mode 100644 index 00000000..d5361efa --- /dev/null +++ b/primedev/config/profile.cpp @@ -0,0 +1,40 @@ +#include "config/profile.h" +#include "dedicated/dedicated.h" +#include <string> + +std::string GetNorthstarPrefix() +{ + return NORTHSTAR_FOLDER_PREFIX; +} + +void InitialiseNorthstarPrefix() +{ + 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); + 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); + NORTHSTAR_FOLDER_PREFIX = dirname; + } + } + else + { + NORTHSTAR_FOLDER_PREFIX = "R2Northstar"; + } + + // set the console title to show the current profile + // dont do this on dedi as title contains useful information on dedi and setting title breaks it as well + if (!IsDedicatedServer()) + SetConsoleTitleA((std::string("NorthstarLauncher | ") + NORTHSTAR_FOLDER_PREFIX).c_str()); +} diff --git a/primedev/config/profile.h b/primedev/config/profile.h new file mode 100644 index 00000000..9f3087fb --- /dev/null +++ b/primedev/config/profile.h @@ -0,0 +1,7 @@ +#pragma once +#include <string> + +static std::string NORTHSTAR_FOLDER_PREFIX; + +void InitialiseNorthstarPrefix(); +std::string GetNorthstarPrefix(); |