-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
175 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#include <Windows.h> | ||
#include <iostream> | ||
#include <string> | ||
#include "Settings.h" | ||
#include <errno.h> | ||
#include <stdio.h> | ||
|
||
SETTINGS Settings = { 0 }; | ||
|
||
namespace SettingsHelper { | ||
|
||
std::string GetPath() { | ||
std::string filename = "splitgate.settings"; | ||
/* | ||
WCHAR szPath[MAX_PATH]; | ||
GetModuleFileName(NULL, szPath, MAX_PATH); | ||
std::wstring ws(szPath); | ||
std::string path(ws.begin(), ws.end()); | ||
path += filename; | ||
*/ | ||
|
||
CHAR path[0xFF] = { 0 }; | ||
GetTempPathA(sizeof(path) / sizeof(path[0]), path); | ||
|
||
return std::string(path).append(filename); | ||
} | ||
|
||
VOID Save() { | ||
std::string path = GetPath(); | ||
FILE* file; | ||
errno_t error = fopen_s(&file, path.data(), "wb"); | ||
|
||
if (error == 0) { | ||
fwrite(&Settings, sizeof(Settings), 1, file); | ||
fclose(file); | ||
//free(path.data()); | ||
} | ||
} | ||
|
||
bool Init() { | ||
std::string path = GetPath(); | ||
FILE* file; | ||
errno_t error = fopen_s(&file, path.data(), "wb"); | ||
|
||
if (error == 0) { | ||
fseek(file, 0, SEEK_END); | ||
auto size = ftell(file); | ||
|
||
if (size == sizeof(Settings)) { | ||
fseek(file, 0, SEEK_SET); | ||
fread(&Settings, sizeof(Settings), 1, file); | ||
fclose(file); | ||
|
||
//free(path.data()); | ||
|
||
printf("abc"); | ||
return true; | ||
} | ||
|
||
fclose(file); | ||
} | ||
|
||
//free(path.data()); | ||
Reset(); | ||
return false; | ||
} | ||
|
||
VOID Reset() { | ||
Settings = { 0 }; | ||
|
||
Settings.MENU.ShowMenu = true; | ||
Settings.MENU.ShowWatermark = true; | ||
Settings.MENU.Watermark = "github.com/SplitgateDevelopment/Launcher"; | ||
|
||
Settings.EXPLOITS.FOV = 80; | ||
Settings.EXPLOITS.GodMode = false; | ||
Settings.EXPLOITS.SpinBot = false; | ||
Settings.EXPLOITS.NoClip = VK_OEM_PLUS; | ||
|
||
Settings.MISC.LoadIntoMap = false; | ||
Settings.MISC.Unload = false; | ||
Settings.MISC.DestroyConsole = false; | ||
Settings.MISC.PlayerName = "SplitgateDevelopement"; | ||
|
||
Save(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#pragma once | ||
|
||
typedef struct { | ||
struct { | ||
bool ShowMenu; | ||
bool ShowWatermark; | ||
std::string Watermark; | ||
} MENU; | ||
|
||
struct { | ||
float FOV; | ||
bool GodMode; | ||
bool SpinBot; | ||
int NoClip; | ||
} EXPLOITS; | ||
|
||
struct { | ||
bool LoadIntoMap; | ||
float Unload; | ||
bool DestroyConsole; | ||
std::string PlayerName; | ||
} MISC; | ||
} SETTINGS; | ||
|
||
extern SETTINGS Settings; | ||
|
||
namespace SettingsHelper { | ||
std::string GetPath(); | ||
bool Init(); | ||
VOID Save(); | ||
VOID Reset(); | ||
} |