Skip to content

Commit 43745b4

Browse files
committed
Fix config
1 parent f06db09 commit 43745b4

6 files changed

Lines changed: 15 additions & 15 deletions

Auto_Modificator_C++.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ struct AppConfig {
3333
std::wstring path; // path to file to patch (relative to EXE directory allowed)
3434
std::vector<SwitchEntry> switches;
3535
bool enableAll = false; // show master toggle if true
36-
bool enableRam = false; // show RAM Patch Mode toggle if true
37-
bool ramWarningDisabled = false; // skip RAM warning dialog if true
36+
bool enableRAM = false; // show RAM Patch Mode toggle if true
37+
bool RAMWarningDisabled = false; // skip RAM warning dialog if true
3838
};
3939

4040
// Utility: trim spaces
@@ -130,12 +130,12 @@ static bool ParseJsonConfig(const std::wstring& filePath, AppConfig& out) {
130130

131131
// Optional RAM toggle and warning disabled flag
132132
bool ramToggle = false;
133-
if (findBooleanValue("enableRam", ramToggle)) {
134-
out.enableRam = ramToggle;
133+
if (findBooleanValue("enableRAM", ramToggle)) {
134+
out.enableRAM = ramToggle;
135135
}
136136
bool warnDisabled = false;
137-
if (findBooleanValue("ramWarningDisabled", warnDisabled)) {
138-
out.ramWarningDisabled = warnDisabled;
137+
if (findBooleanValue("RAMWarningDisabled", warnDisabled)) {
138+
out.RAMWarningDisabled = warnDisabled;
139139
}
140140

141141
// Find switches array with proper depth handling
@@ -501,7 +501,7 @@ static void LayoutAndCreateControls(HWND hwnd) {
501501
int rowsHeight = (totalRows > 0 ? (totalRows * 24 + (totalRows - 1) * rowGap) : 0);
502502
int extraBottomToggles = 0;
503503
if (g_config.enableAll) extraBottomToggles += (rowGap + 22);
504-
if (g_config.enableRam) extraBottomToggles += (rowGap + 22);
504+
if (g_config.enableRAM) extraBottomToggles += (rowGap + 22);
505505
int clientHeight = padding + rowsHeight + padding + extraBottomToggles + bottomBarHeight + padding;
506506

507507
// Resize window to fit desired client area
@@ -564,7 +564,7 @@ static void LayoutAndCreateControls(HWND hwnd) {
564564
}
565565

566566
// Create/position bottom toggles at bottom after individual states are initialized
567-
if (g_config.enableAll || g_config.enableRam) {
567+
if (g_config.enableAll || g_config.enableRAM) {
568568
RECT rcClient{}; GetClientRect(hwnd, &rcClient);
569569
int statusH = 0;
570570
if (g_status) {
@@ -597,7 +597,7 @@ static void LayoutAndCreateControls(HWND hwnd) {
597597
SendMessageW(g_masterToggle, BM_SETCHECK, (anyEnabled && allChecked) ? BST_CHECKED : BST_UNCHECKED, 0);
598598
}
599599
// RAM mode toggle (right of master or alone at left)
600-
if (g_config.enableRam) {
600+
if (g_config.enableRAM) {
601601
int xRam = x + (g_config.enableAll ? 210 : 0);
602602
if (!g_ramToggle) {
603603
g_ramToggle = CreateWindowExW(0, L"BUTTON", L"RAM Patch Mode",
@@ -645,13 +645,13 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
645645
if (id == kMasterToggleId && g_config.enableAll) {
646646
LRESULT state = SendMessageW((HWND)lParam, BM_GETCHECK, 0, 0);
647647
SetAllSwitches(state == BST_CHECKED);
648-
} else if (id == kRamToggleId && g_config.enableRam) {
648+
} else if (id == kRamToggleId && g_config.enableRAM) {
649649
LRESULT state = SendMessageW((HWND)lParam, BM_GETCHECK, 0, 0);
650650
bool wantEnable = (state == BST_CHECKED);
651-
if (wantEnable && !g_config.ramWarningDisabled) {
651+
if (wantEnable && !g_config.RAMWarningDisabled) {
652652
bool dontShow = false;
653653
INT_PTR res = ShowRamWarningDialogAndGetResult(dontShow);
654-
if (dontShow) { g_config.ramWarningDisabled = true; }
654+
if (dontShow) { g_config.RAMWarningDisabled = true; }
655655
if (res != IDOK) {
656656
SendMessageW(g_ramToggle, BM_SETCHECK, BST_UNCHECKED, 0);
657657
return 0;
@@ -716,7 +716,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
716716
SetWindowPos(g_masterToggle, nullptr, x, y, 200, 22, SWP_NOZORDER | SWP_NOACTIVATE);
717717
}
718718
// Re-anchor RAM toggle
719-
if (g_ramToggle && g_config.enableRam) {
719+
if (g_ramToggle && g_config.enableRAM) {
720720
RECT rcClient{}; GetClientRect(hwnd, &rcClient);
721721
int statusH = 0;
722722
if (g_status) {
-512 Bytes
Binary file not shown.
-512 Bytes
Binary file not shown.
-512 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

example/config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"enableAll": true,
3-
"enableRam": true,
4-
"ramWarningDisabled": true,
3+
"enableRAM": true,
4+
"RAMWarningDisabled": true,
55
"path": "0.bin",
66
"switches": [
77
{

0 commit comments

Comments
 (0)