Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Denellyne committed May 11, 2024
1 parent 6df9413 commit 8c719fd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/GUI/GUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion src/User Settings/Game Profiles/gameProfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <filesystem>
#include "User Settings/Macros/macro.h"


extern unsigned char ptrCurrentTriggerProfile[8];
extern bool profileOpen;

Expand Down
16 changes: 5 additions & 11 deletions src/User Settings/Game Profiles/saveLoad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,31 +60,25 @@ void saveProfiles(const std::vector<gameProfile> 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(&currentProfile.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(&currentProfile.appNameLiteral[0],
&currentProfile.appNameLiteral[currentProfile.appNameLiteral.length()]);


for (short int i = 0; i < 9; i++) writeStrings >> trigger[i];
Expand Down
2 changes: 1 addition & 1 deletion src/User Settings/Lightbar/Lightbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]{};
Expand Down

0 comments on commit 8c719fd

Please sign in to comment.