forked from Skewjo/SysLat_Software
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSysLatPreferences.h
86 lines (74 loc) · 2.34 KB
/
SysLatPreferences.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#pragma once
// 12-28-2020
// The default values in the following 4 structures get overwritten when ReadPreferences() is called
struct SysLatOptions {
string m_targetApp = "dota2";
//vector<string> m_favoriteTargets;
string m_PortSpecifier = "COM3";
int m_maxTestDuration = 15; //does this need to be of type "duration<int>" ???
int m_maxLogs = 10;
string m_LogDir;// = ".\\SysLat_Logs\\";
bool m_bDarkMode = false;
};
struct PrivacyOptions {
bool m_bFirstRun = true;
bool m_bRunOnStartup = true;
bool m_bAutoCheckUpdates = true;
bool m_bAutoExportLogs = true;
bool m_bAutoUploadLogs = true;
bool m_bAutoUploadMachineID = true;
bool m_bAutoUploadMachineInfo = true;
};
struct DebugOptions {
bool m_bDebugMode = false; //save to config
bool m_bTestUploadMode = false; //change name?
bool m_bSysLatInOSD = false;
};
struct RTSSOptions {
// text color
// box colors??
DWORD m_positionX = 0;
DWORD m_positionY = 0;
bool m_bPositionManualOverride = false;
int m_internalX = 0;
int m_internalY = 0;
};
class SysLatPreferences
{
//TestCtrl::TestCtrl(vector<CSysLatData*>* p_previousSLD, CWnd* pParent /*=nullptr*/)
// : CDialogEx(IDD_TESTCTRL_DIALOG, pParent), m_pPreviousSLD(p_previousSLD)
//{
//}
//HardwareID() {
// GetUserAndComputerName();
// ::GetCurrentHwProfileA(&hwProfileInfo);
// m_pMac = GetMAC();
// GetMachineSID();
// CreateJSON();
//}
Json::Value m_JSONPreferences;
CHAR pathToSysLat[MAX_PATH];
string pathOnly;
void WriteSysLatOptions();
void WritePrivacyOptions();
void WriteDebugOptions();
void WriteRTSSOptions();
void ReadSysLatOptions();
void ReadPrivacyOptions();
void ReadDebugOptions();
void ReadRTSSOptions();
public:
SysLatPreferences() {
GetModuleFileName(NULL, pathToSysLat, MAX_PATH);
pathOnly = pathToSysLat;
SL::RemoveFileNameFromPath(pathOnly);
ReadPreferences();
}
//The use of "./" in filepaths in the following 2 functions makes the program create the file where it is run from... not where the actual executable is located...
void WritePreferences();
void ReadPreferences();
SysLatOptions m_SysLatOptions;
PrivacyOptions m_PrivacyOptions;
DebugOptions m_DebugOptions;
RTSSOptions m_RTSSOptions;
};