about summary refs log tree commit diff stats
path: root/App
diff options
context:
space:
mode:
authorjbzdarkid <jbzdarkid@gmail.com>2019-11-07 09:02:13 -0800
committerjbzdarkid <jbzdarkid@gmail.com>2019-11-07 09:02:13 -0800
commit5085af8b5163f14d37284b5ee0e8fb2c4aaef7cb (patch)
treefa222a472835953e0eada02ed2350e3aeefcfe08 /App
parente5e7309fc273dcc2cb2b6dd727117fd11ae38d0f (diff)
downloadwitness-tutorializer-5085af8b5163f14d37284b5ee0e8fb2c4aaef7cb.tar.gz
witness-tutorializer-5085af8b5163f14d37284b5ee0e8fb2c4aaef7cb.tar.bz2
witness-tutorializer-5085af8b5163f14d37284b5ee0e8fb2c4aaef7cb.zip
Add previously-available settings
Diffstat (limited to 'App')
-rw-r--r--App/App.rc7
-rw-r--r--App/App.vcxproj6
-rw-r--r--App/Main.cpp23
-rw-r--r--App/Version.h2
-rw-r--r--App/Version.rc6
5 files changed, 32 insertions, 12 deletions
diff --git a/App/App.rc b/App/App.rc new file mode 100644 index 0000000..760bba0 --- /dev/null +++ b/App/App.rc
@@ -0,0 +1,7 @@
1#include "winres.h"
2#include "Version.h"
3
4VS_VERSION_INFO VERSIONINFO
5 FILEVERSION VERSION
6BEGIN
7END
diff --git a/App/App.vcxproj b/App/App.vcxproj index 698d364..25ec076 100644 --- a/App/App.vcxproj +++ b/App/App.vcxproj
@@ -174,13 +174,13 @@
174 <ClCompile Include="Main.cpp" /> 174 <ClCompile Include="Main.cpp" />
175 </ItemGroup> 175 </ItemGroup>
176 <ItemGroup> 176 <ItemGroup>
177 <ResourceCompile Include="Version.rc" />
178 </ItemGroup>
179 <ItemGroup>
180 <ProjectReference Include="..\Source\Source.vcxproj"> 177 <ProjectReference Include="..\Source\Source.vcxproj">
181 <Project>{6b5df051-a51a-48cb-8acd-c6fad726019f}</Project> 178 <Project>{6b5df051-a51a-48cb-8acd-c6fad726019f}</Project>
182 </ProjectReference> 179 </ProjectReference>
183 </ItemGroup> 180 </ItemGroup>
181 <ItemGroup>
182 <ResourceCompile Include="App.rc" />
183 </ItemGroup>
184 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> 184 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
185 <ImportGroup Label="ExtensionTargets"> 185 <ImportGroup Label="ExtensionTargets">
186 </ImportGroup> 186 </ImportGroup>
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
22HWND g_hwnd; 24HWND 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);
diff --git a/App/Version.h b/App/Version.h index cbb8fa3..32753aa 100644 --- a/App/Version.h +++ b/App/Version.h
@@ -5,7 +5,7 @@
5 5
6#define MAJOR 5 6#define MAJOR 5
7#define MINOR 1 7#define MINOR 1
8#define PATCH 0 8#define PATCH 1
9 9
10#define VERSION_STR TO_STRING(MAJOR) L"." TO_STRING(MINOR) L"." TO_STRING(PATCH) 10#define VERSION_STR TO_STRING(MAJOR) L"." TO_STRING(MINOR) L"." TO_STRING(PATCH)
11#define VERSION MAJOR, MINOR, PATCH 11#define VERSION MAJOR, MINOR, PATCH
diff --git a/App/Version.rc b/App/Version.rc deleted file mode 100644 index 9b90884..0000000 --- a/App/Version.rc +++ /dev/null
@@ -1,6 +0,0 @@
1#include "version.h"
2
3VS_VERSION_INFO VERSIONINFO
4 FILEVERSION VERSION
5BEGIN
6END