-
Notifications
You must be signed in to change notification settings - Fork 3
/
ModSettings.h
43 lines (40 loc) · 1.46 KB
/
ModSettings.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
#pragma once
#include <string>
namespace ModSettings
{
extern bool bShowCrosshair;
extern bool bSpecialItemIconVisible;
extern bool bCrosshairItemCardVisible;
extern bool bQuickContainerItemCardVisible;
extern bool bBriefItemInfoWidgetVisible;
extern UInt32 iQuickUseHotkey;
extern UInt32 iCrosshairItemCardCoordX;
extern UInt32 iCrosshairItemCardCoordY;
extern UInt32 iQuickContainerItemCardCoordX;
extern UInt32 iBriefItemInfoWidgetCoordX;
extern UInt32 iBriefItemInfoWidgetCoordY;
extern float fCrosshairItemCardAlpha;
extern float fCrosshairItemCardScale;
extern float fQuickContainerItemCardAlpha;
extern float fQuickContainerItemCardScale;
extern float fBriefItemInfoWidgetScale;
template<typename T>
inline void CommitModSettings(const char * sectionName, const char * settingName, T value) //bool
{
constexpr char * iniPath = ".\\Data\\MCM\\Settings\\HUDPlusPlus.ini";
if (GetFileAttributesA("Data\\MCM\\Settings") != INVALID_FILE_ATTRIBUTES)
{
WritePrivateProfileStringA(sectionName, settingName, std::to_string(value).c_str(), iniPath);
}
}
template<>
inline void CommitModSettings(const char * sectionName, const char * settingName, const char * value)
{
constexpr char * iniPath = ".\\Data\\MCM\\Settings\\HUDPlusPlus.ini";
if (GetFileAttributesA("Data\\MCM\\Settings") != INVALID_FILE_ATTRIBUTES)
{
WritePrivateProfileStringA(sectionName, settingName, value, iniPath);
}
}
void ReadModSettings();
}