diff --git a/src/GUI/GUI.h b/src/GUI/GUI.h index a9595c0..e468dc8 100644 --- a/src/GUI/GUI.h +++ b/src/GUI/GUI.h @@ -4,8 +4,8 @@ #include "User Settings/Macros/macro.h" #include "User Settings/Game Profiles/gameProfile.h" -#define defaultWindowWidth 1280 -#define defaultWindowHeigth 720 +constexpr short defaultWindowWidth = 1280; +constexpr short defaultWindowHeigth = 720; extern BOOL WINAPI exitFunction(_In_ DWORD dwCtrlType); diff --git a/src/User Settings/Game Profiles/gameProfile.h b/src/User Settings/Game Profiles/gameProfile.h index 43f493e..355bf41 100644 --- a/src/User Settings/Game Profiles/gameProfile.h +++ b/src/User Settings/Game Profiles/gameProfile.h @@ -5,7 +5,6 @@ #include #include "User Settings/Macros/macro.h" - extern unsigned char ptrCurrentTriggerProfile[8]; extern bool profileOpen; diff --git a/src/User Settings/Game Profiles/saveLoad.cpp b/src/User Settings/Game Profiles/saveLoad.cpp index ebf21b9..762666e 100644 --- a/src/User Settings/Game Profiles/saveLoad.cpp +++ b/src/User Settings/Game Profiles/saveLoad.cpp @@ -60,31 +60,25 @@ void saveProfiles(const std::vector gameProfiles) { } } - void inline writeProfiles(std::string dirEntry, gameProfile& currentProfile) { //Write strings and TriggerProfile std::ifstream writeStrings(std::format("{}/profile.txt", dirEntry)); if (writeStrings.is_open()) { - std::string profileName{}; - std::string appName{}; int trigger[9]{}; RGB Lightbar{}; - while (writeStrings.good()) { - std::getline(writeStrings, profileName, '\n'); - memcpy(¤tProfile.profileName[0], &profileName[0], profileName.length()); + if (writeStrings.good()) { + std::getline(writeStrings, currentProfile.profileName, '\n'); //It just works if I add this idk - writeStrings.ignore(); writeStrings.unget(); - // - std::getline(writeStrings, appName, '\n'); + std::getline(writeStrings, currentProfile.appNameLiteral, '\n'); - currentProfile.appName = std::wstring(&appName[0], &appName[appName.length()]); - currentProfile.appNameLiteral = appName; + currentProfile.appName = std::wstring(¤tProfile.appNameLiteral[0], + ¤tProfile.appNameLiteral[currentProfile.appNameLiteral.length()]); for (short int i = 0; i < 9; i++) writeStrings >> trigger[i]; diff --git a/src/User Settings/Lightbar/Lightbar.cpp b/src/User Settings/Lightbar/Lightbar.cpp index 6bd1c44..422cd86 100644 --- a/src/User Settings/Lightbar/Lightbar.cpp +++ b/src/User Settings/Lightbar/Lightbar.cpp @@ -42,7 +42,7 @@ void lightbarEditor(bool& lightbarOpen,RGB* RGB) { std::string modifier; - constexpr static std::string batteryLevel[] = {"0%%: ","12%%: ","27%%: ","37%%: ","50%%: ", + static std::string batteryLevel[] = {"0%%: ","12%%: ","27%%: ","37%%: ","50%%: ", "62%%: ","75%%: ","87%%: ","100%%:" }; static bool isOpen[9]{};