summary refs log tree commit diff stats
path: root/App
diff options
context:
space:
mode:
Diffstat (limited to 'App')
-rw-r--r--App/App.vcxproj3
-rw-r--r--App/Main.cpp63
-rw-r--r--App/Version.h4
3 files changed, 39 insertions, 31 deletions
diff --git a/App/App.vcxproj b/App/App.vcxproj index 2597b8d..9b10e92 100644 --- a/App/App.vcxproj +++ b/App/App.vcxproj
@@ -85,6 +85,7 @@
85 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> 85 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
86 <LinkIncremental>false</LinkIncremental> 86 <LinkIncremental>false</LinkIncremental>
87 <TargetName>WitnessRandomizer</TargetName> 87 <TargetName>WitnessRandomizer</TargetName>
88 <OutDir>..\GithubPackage\</OutDir>
88 </PropertyGroup> 89 </PropertyGroup>
89 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> 90 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
90 <ClCompile> 91 <ClCompile>
@@ -140,6 +141,7 @@
140 <EnableCOMDATFolding>true</EnableCOMDATFolding> 141 <EnableCOMDATFolding>true</EnableCOMDATFolding>
141 <OptimizeReferences>true</OptimizeReferences> 142 <OptimizeReferences>true</OptimizeReferences>
142 <GenerateDebugInformation>true</GenerateDebugInformation> 143 <GenerateDebugInformation>true</GenerateDebugInformation>
144 <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
143 </Link> 145 </Link>
144 </ItemDefinitionGroup> 146 </ItemDefinitionGroup>
145 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> 147 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -162,6 +164,7 @@
162 <EnableCOMDATFolding>true</EnableCOMDATFolding> 164 <EnableCOMDATFolding>true</EnableCOMDATFolding>
163 <OptimizeReferences>true</OptimizeReferences> 165 <OptimizeReferences>true</OptimizeReferences>
164 <GenerateDebugInformation>true</GenerateDebugInformation> 166 <GenerateDebugInformation>true</GenerateDebugInformation>
167 <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
165 </Link> 168 </Link>
166 </ItemDefinitionGroup> 169 </ItemDefinitionGroup>
167 <ItemGroup> 170 <ItemGroup>
diff --git a/App/Main.cpp b/App/Main.cpp index 7e802e9..82600bf 100644 --- a/App/Main.cpp +++ b/App/Main.cpp
@@ -18,8 +18,10 @@
18#define IDC_WRITE 0x407 18#define IDC_WRITE 0x407
19#define IDC_DUMP 0x408 19#define IDC_DUMP 0x408
20#define IDT_RANDOMIZED 0x409 20#define IDT_RANDOMIZED 0x409
21#define IDC_TOGGLELASERS 0x410
22#define IDC_TOGGLESNIPES 0x411
21 23
22HWND hwndSeed, hwndRandomize, hwndDebug; 24HWND hwndSeed, hwndRandomize;
23// int panel = 0x18AF; 25// int panel = 0x18AF;
24int panel = 0x33D4; 26int panel = 0x33D4;
25std::shared_ptr<Panel> _panel; 27std::shared_ptr<Panel> _panel;
@@ -38,13 +40,15 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
38 seedIsRNG = false; 40 seedIsRNG = false;
39 } 41 }
40 switch (LOWORD(wParam)) { 42 switch (LOWORD(wParam)) {
41 // Speed checkbox 43 // Checkboxes
42 case IDC_TOGGLESPEED: 44 case IDC_TOGGLESPEED:
43 if (IsDlgButtonChecked(hwnd, IDC_TOGGLESPEED)) { 45 CheckDlgButton(hwnd, IDC_TOGGLESPEED, !IsDlgButtonChecked(hwnd, IDC_TOGGLESPEED));
44 CheckDlgButton(hwnd, IDC_TOGGLESPEED, BST_UNCHECKED); 46 break;
45 } else { 47 case IDC_TOGGLELASERS:
46 CheckDlgButton(hwnd, IDC_TOGGLESPEED, BST_CHECKED); 48 CheckDlgButton(hwnd, IDC_TOGGLELASERS, !IsDlgButtonChecked(hwnd, IDC_TOGGLELASERS));
47 } 49 break;
50 case IDC_TOGGLESNIPES:
51 CheckDlgButton(hwnd, IDC_TOGGLESNIPES, !IsDlgButtonChecked(hwnd, IDC_TOGGLESNIPES));
48 break; 52 break;
49 53
50 // Randomize button 54 // Randomize button
@@ -70,30 +74,27 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
70 if (randomizer->GameIsRandomized()) break; 74 if (randomizer->GameIsRandomized()) break;
71 Random::SetSeed(seed); 75 Random::SetSeed(seed);
72 76
73 77 // Show seed and force redraw
74 std::wstringstream debug;
75
76 std::wstring seedString = std::to_wstring(seed); 78 std::wstring seedString = std::to_wstring(seed);
77 SetWindowText(hwndRandomize, L"Randomizing..."); 79 SetWindowText(hwndRandomize, L"Randomizing...");
78 SetWindowText(hwndSeed, seedString.c_str()); 80 SetWindowText(hwndSeed, seedString.c_str());
79 RedrawWindow(hwnd, NULL, NULL, RDW_UPDATENOW); 81 RedrawWindow(hwnd, NULL, NULL, RDW_UPDATENOW);
80 82
83 // Randomize, then apply settings
81 randomizer->Randomize(); 84 randomizer->Randomize();
82 debug << Random::RandInt(0, 1000) << " "; 85 if (IsDlgButtonChecked(hwnd, IDC_TOGGLESPEED)) randomizer->AdjustSpeed();
83 debug << Random::RandInt(0, 1000) << "\n"; 86 if (IsDlgButtonChecked(hwnd, IDC_TOGGLELASERS)) randomizer->RandomizeLasers();
84 debug << Random::RandInt(0, 1000) << " "; 87 if (IsDlgButtonChecked(hwnd, IDC_TOGGLESNIPES)) randomizer->PreventSnipes();
85 debug << Random::RandInt(0, 1000); 88
86 SetWindowText(hwndDebug, debug.str().c_str()); 89 // Cleanup, and set timer for "randomization done"
87 if (IsDlgButtonChecked(hwnd, IDC_TOGGLESPEED)) { 90 SetWindowText(hwndRandomize, L"Randomized!");
88 randomizer->AdjustSpeed();
89 }
90 SetWindowText(hwndRandomize, L"Randomized!");
91 SetTimer(hwnd, IDT_RANDOMIZED, 10000, NULL); 91 SetTimer(hwnd, IDT_RANDOMIZED, 10000, NULL);
92 break; 92 break;
93 } 93 }
94 94
95 case IDT_RANDOMIZED: 95 case IDT_RANDOMIZED:
96 SetWindowText(hwndRandomize, L"Randomize"); 96 SetWindowText(hwndRandomize, L"Randomize");
97 randomizer->GameIsRandomized(); // "Check" if the game is randomized to update the last known safe frame.
97 break; 98 break;
98 case IDC_READ: 99 case IDC_READ:
99 _panel = std::make_shared<Panel>(panel); 100 _panel = std::make_shared<Panel>(panel);
@@ -171,11 +172,22 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd
171 10, 52, 12, 12, hwnd, (HMENU)IDC_TOGGLESPEED, hInstance, NULL); 172 10, 52, 12, 12, hwnd, (HMENU)IDC_TOGGLESPEED, hInstance, NULL);
172 CreateWindow(L"STATIC", L"Speed up various autoscrollers", 173 CreateWindow(L"STATIC", L"Speed up various autoscrollers",
173 WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT, 174 WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT,
174 27, 50, 205, 16, hwnd, NULL, hInstance, NULL); 175 27, 50, 210, 16, hwnd, NULL, hInstance, NULL);
176
177 CreateWindow(L"BUTTON", L"",
178 WS_VISIBLE | WS_CHILD | BS_CHECKBOX,
179 10, 72, 12, 12, hwnd, (HMENU)IDC_TOGGLELASERS, hInstance, NULL);
180 CreateWindow(L"STATIC", L"Randomize laser activations",
181 WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT,
182 27, 70, 210, 16, hwnd, NULL, hInstance, NULL);
175 183
176 hwndDebug = CreateWindow(L"STATIC", L"", 184 CreateWindow(L"BUTTON", L"",
185 WS_VISIBLE | WS_CHILD | BS_CHECKBOX,
186 10, 92, 12, 12, hwnd, (HMENU)IDC_TOGGLESNIPES, hInstance, NULL);
187 CheckDlgButton(hwnd, IDC_TOGGLESNIPES, TRUE);
188 CreateWindow(L"STATIC", L"Prevent sniping certain puzzles",
177 WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT, 189 WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT,
178 200, 200, 100, 100, hwnd, NULL, hInstance, NULL); 190 27, 90, 210, 16, hwnd, NULL, hInstance, NULL);
179 191
180 /* 192 /*
181 CreateWindow(L"BUTTON", L"", 193 CreateWindow(L"BUTTON", L"",
@@ -206,13 +218,6 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd
206 WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT, 218 WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT,
207 27, 50, 205, 16, hwnd, NULL, hInstance, NULL); 219 27, 50, 205, 16, hwnd, NULL, hInstance, NULL);
208 220
209 CreateWindow(L"BUTTON", L"",
210 WS_VISIBLE | WS_CHILD | BS_CHECKBOX,
211 10, 52, 12, 12, hwnd, (HMENU)IDC_BANSNIPES, hInstance, NULL);
212 CreateWindow(L"STATIC", L"Prevent sniping certain puzzles",
213 WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT,
214 27, 50, 205, 16, hwnd, NULL, hInstance, NULL);
215
216*/ 221*/
217 222
218 ShowWindow(hwnd, nCmdShow); 223 ShowWindow(hwnd, nCmdShow);
diff --git a/App/Version.h b/App/Version.h index 61473e6..1167925 100644 --- a/App/Version.h +++ b/App/Version.h
@@ -3,9 +3,9 @@
3#define TO_STRING2(s) L#s 3#define TO_STRING2(s) L#s
4#define TO_STRING(s) TO_STRING2(s) 4#define TO_STRING(s) TO_STRING2(s)
5 5
6#define MAJOR 4 6#define MAJOR 5
7#define MINOR 0 7#define MINOR 0
8#define PATCH 6 8#define PATCH 0
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