diff options
Diffstat (limited to 'App/Main.cpp')
-rw-r--r-- | App/Main.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/App/Main.cpp b/App/Main.cpp index f8b7422..78726ed 100644 --- a/App/Main.cpp +++ b/App/Main.cpp | |||
@@ -17,6 +17,8 @@ | |||
17 | #define RANDOMIZE_DONE 0x404 | 17 | #define RANDOMIZE_DONE 0x404 |
18 | #define RANDOMIZE_CHALLENGE_DONE 0x405 | 18 | #define RANDOMIZE_CHALLENGE_DONE 0x405 |
19 | #define CHALLENGE_ONLY 0x406 | 19 | #define CHALLENGE_ONLY 0x406 |
20 | #define DISABLE_SNIPES 0x407 | ||
21 | #define SPEED_UP_AUTOSCROLLERS 0x408 | ||
20 | 22 | ||
21 | // Globals | 23 | // Globals |
22 | HWND g_hwnd; | 24 | HWND g_hwnd; |
@@ -79,8 +81,14 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) | |||
79 | RedrawWindow(g_seed, NULL, NULL, RDW_UPDATENOW); | 81 | RedrawWindow(g_seed, NULL, NULL, RDW_UPDATENOW); |
80 | } | 82 | } |
81 | Random::SetSeed(seed); | 83 | Random::SetSeed(seed); |
82 | std::thread([hwnd]{ | 84 | std::thread([]{ |
83 | if (IsDlgButtonChecked(hwnd, CHALLENGE_ONLY)) { | 85 | if (IsDlgButtonChecked(g_hwnd, DISABLE_SNIPES)) { |
86 | g_randomizer->PreventSnipes(); | ||
87 | } | ||
88 | if (IsDlgButtonChecked(g_hwnd, SPEED_UP_AUTOSCROLLERS)) { | ||
89 | g_randomizer->AdjustSpeed(); | ||
90 | } | ||
91 | if (IsDlgButtonChecked(g_hwnd, CHALLENGE_ONLY)) { | ||
84 | SetWindowText(g_randomizerStatus, L"Randomizing Challenge..."); | 92 | SetWindowText(g_randomizerStatus, L"Randomizing Challenge..."); |
85 | g_randomizer->RandomizeChallenge(); | 93 | g_randomizer->RandomizeChallenge(); |
86 | PostMessage(g_hwnd, WM_COMMAND, RANDOMIZE_CHALLENGE_DONE, NULL); | 94 | PostMessage(g_hwnd, WM_COMMAND, RANDOMIZE_CHALLENGE_DONE, NULL); |
@@ -106,6 +114,12 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) | |||
106 | PostMessage(g_hwnd, WM_COMMAND, RANDOMIZE_READY, NULL); | 114 | PostMessage(g_hwnd, WM_COMMAND, RANDOMIZE_READY, NULL); |
107 | } | 115 | } |
108 | break; | 116 | break; |
117 | case DISABLE_SNIPES: | ||
118 | CheckDlgButton(hwnd, DISABLE_SNIPES, !IsDlgButtonChecked(hwnd, DISABLE_SNIPES)); | ||
119 | break; | ||
120 | case SPEED_UP_AUTOSCROLLERS: | ||
121 | CheckDlgButton(hwnd, SPEED_UP_AUTOSCROLLERS, !IsDlgButtonChecked(hwnd, SPEED_UP_AUTOSCROLLERS)); | ||
122 | break; | ||
109 | } | 123 | } |
110 | } | 124 | } |
111 | return DefWindowProc(hwnd, message, wParam, lParam); | 125 | return DefWindowProc(hwnd, message, wParam, lParam); |
@@ -167,6 +181,11 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance | |||
167 | EnableWindow(g_randomizerStatus, FALSE); | 181 | EnableWindow(g_randomizerStatus, FALSE); |
168 | CreateCheckbox(10, 300, CHALLENGE_ONLY); | 182 | CreateCheckbox(10, 300, CHALLENGE_ONLY); |
169 | CreateLabel(30, 300, 200, L"Randomize the challenge only"); | 183 | CreateLabel(30, 300, 200, L"Randomize the challenge only"); |
184 | CreateCheckbox(10, 320, DISABLE_SNIPES); | ||
185 | CheckDlgButton(g_hwnd, DISABLE_SNIPES, TRUE); | ||
186 | CreateLabel(30, 320, 240, L"Disable Swamp and Shadows snipes"); | ||
187 | CreateCheckbox(10, 340, SPEED_UP_AUTOSCROLLERS); | ||
188 | CreateLabel(30, 340, 205, L"Speed up various autoscrollers"); | ||
170 | EnableWindow(g_randomizerStatus, FALSE); | 189 | EnableWindow(g_randomizerStatus, FALSE); |
171 | 190 | ||
172 | g_witnessProc->StartHeartbeat(g_hwnd); | 191 | g_witnessProc->StartHeartbeat(g_hwnd); |