Skip to content

Commit

Permalink
Cleanup packaging story, add more settings
Browse files Browse the repository at this point in the history
  • Loading branch information
jbzdarkid committed Nov 19, 2018
1 parent 0d4ebf3 commit eb42060
Show file tree
Hide file tree
Showing 12 changed files with 195 additions and 146 deletions.
3 changes: 3 additions & 0 deletions App/App.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<TargetName>WitnessRandomizer</TargetName>
<OutDir>..\GithubPackage\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand Down Expand Up @@ -140,6 +141,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand All @@ -162,6 +164,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
63 changes: 34 additions & 29 deletions App/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
#define IDC_WRITE 0x407
#define IDC_DUMP 0x408
#define IDT_RANDOMIZED 0x409
#define IDC_TOGGLELASERS 0x410
#define IDC_TOGGLESNIPES 0x411

HWND hwndSeed, hwndRandomize, hwndDebug;
HWND hwndSeed, hwndRandomize;
// int panel = 0x18AF;
int panel = 0x33D4;
std::shared_ptr<Panel> _panel;
Expand All @@ -38,13 +40,15 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
seedIsRNG = false;
}
switch (LOWORD(wParam)) {
// Speed checkbox
// Checkboxes
case IDC_TOGGLESPEED:
if (IsDlgButtonChecked(hwnd, IDC_TOGGLESPEED)) {
CheckDlgButton(hwnd, IDC_TOGGLESPEED, BST_UNCHECKED);
} else {
CheckDlgButton(hwnd, IDC_TOGGLESPEED, BST_CHECKED);
}
CheckDlgButton(hwnd, IDC_TOGGLESPEED, !IsDlgButtonChecked(hwnd, IDC_TOGGLESPEED));
break;
case IDC_TOGGLELASERS:
CheckDlgButton(hwnd, IDC_TOGGLELASERS, !IsDlgButtonChecked(hwnd, IDC_TOGGLELASERS));
break;
case IDC_TOGGLESNIPES:
CheckDlgButton(hwnd, IDC_TOGGLESNIPES, !IsDlgButtonChecked(hwnd, IDC_TOGGLESNIPES));
break;

// Randomize button
Expand All @@ -70,30 +74,27 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
if (randomizer->GameIsRandomized()) break;
Random::SetSeed(seed);


std::wstringstream debug;

// Show seed and force redraw
std::wstring seedString = std::to_wstring(seed);
SetWindowText(hwndRandomize, L"Randomizing...");
SetWindowText(hwndSeed, seedString.c_str());
RedrawWindow(hwnd, NULL, NULL, RDW_UPDATENOW);

// Randomize, then apply settings
randomizer->Randomize();
debug << Random::RandInt(0, 1000) << " ";
debug << Random::RandInt(0, 1000) << "\n";
debug << Random::RandInt(0, 1000) << " ";
debug << Random::RandInt(0, 1000);
SetWindowText(hwndDebug, debug.str().c_str());
if (IsDlgButtonChecked(hwnd, IDC_TOGGLESPEED)) {
randomizer->AdjustSpeed();
}
SetWindowText(hwndRandomize, L"Randomized!");
if (IsDlgButtonChecked(hwnd, IDC_TOGGLESPEED)) randomizer->AdjustSpeed();
if (IsDlgButtonChecked(hwnd, IDC_TOGGLELASERS)) randomizer->RandomizeLasers();
if (IsDlgButtonChecked(hwnd, IDC_TOGGLESNIPES)) randomizer->PreventSnipes();

// Cleanup, and set timer for "randomization done"
SetWindowText(hwndRandomize, L"Randomized!");
SetTimer(hwnd, IDT_RANDOMIZED, 10000, NULL);
break;
}

case IDT_RANDOMIZED:
SetWindowText(hwndRandomize, L"Randomize");
randomizer->GameIsRandomized(); // "Check" if the game is randomized to update the last known safe frame.
break;
case IDC_READ:
_panel = std::make_shared<Panel>(panel);
Expand Down Expand Up @@ -171,11 +172,22 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd
10, 52, 12, 12, hwnd, (HMENU)IDC_TOGGLESPEED, hInstance, NULL);
CreateWindow(L"STATIC", L"Speed up various autoscrollers",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT,
27, 50, 205, 16, hwnd, NULL, hInstance, NULL);
27, 50, 210, 16, hwnd, NULL, hInstance, NULL);

CreateWindow(L"BUTTON", L"",
WS_VISIBLE | WS_CHILD | BS_CHECKBOX,
10, 72, 12, 12, hwnd, (HMENU)IDC_TOGGLELASERS, hInstance, NULL);
CreateWindow(L"STATIC", L"Randomize laser activations",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT,
27, 70, 210, 16, hwnd, NULL, hInstance, NULL);

hwndDebug = CreateWindow(L"STATIC", L"",
CreateWindow(L"BUTTON", L"",
WS_VISIBLE | WS_CHILD | BS_CHECKBOX,
10, 92, 12, 12, hwnd, (HMENU)IDC_TOGGLESNIPES, hInstance, NULL);
CheckDlgButton(hwnd, IDC_TOGGLESNIPES, TRUE);
CreateWindow(L"STATIC", L"Prevent sniping certain puzzles",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT,
200, 200, 100, 100, hwnd, NULL, hInstance, NULL);
27, 90, 210, 16, hwnd, NULL, hInstance, NULL);

/*
CreateWindow(L"BUTTON", L"",
Expand Down Expand Up @@ -206,13 +218,6 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd
WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT,
27, 50, 205, 16, hwnd, NULL, hInstance, NULL);
CreateWindow(L"BUTTON", L"",
WS_VISIBLE | WS_CHILD | BS_CHECKBOX,
10, 52, 12, 12, hwnd, (HMENU)IDC_BANSNIPES, hInstance, NULL);
CreateWindow(L"STATIC", L"Prevent sniping certain puzzles",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT,
27, 50, 205, 16, hwnd, NULL, hInstance, NULL);
*/

ShowWindow(hwnd, nCmdShow);
Expand Down
4 changes: 2 additions & 2 deletions App/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#define TO_STRING2(s) L#s
#define TO_STRING(s) TO_STRING2(s)

#define MAJOR 4
#define MAJOR 5
#define MINOR 0
#define PATCH 6
#define PATCH 0

#define VERSION_STR TO_STRING(MAJOR) L"." TO_STRING(MINOR) L"." TO_STRING(PATCH)
#define VERSION MAJOR, MINOR, PATCH
Expand Down
Binary file added GithubPackage/WitnessRandomizer.exe
Binary file not shown.
Binary file added GithubPackage/WitnessRandomizerInstaller.msi
Binary file not shown.
Binary file added GithubPackage/setup.exe
Binary file not shown.
12 changes: 6 additions & 6 deletions Installer/Installer.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"DisplayName" = "8:Debug"
"IsDebugOnly" = "11:TRUE"
"IsReleaseOnly" = "11:FALSE"
"OutputFilename" = "8:WitnessRandomizerInstaller.msi"
"OutputFilename" = "8:..\\GithubPackage\\WitnessRandomizerInstaller.msi"
"PackageFilesAs" = "3:2"
"PackageFileSize" = "3:-2147483648"
"CabType" = "3:1"
Expand Down Expand Up @@ -59,7 +59,7 @@
"DisplayName" = "8:Release"
"IsDebugOnly" = "11:FALSE"
"IsReleaseOnly" = "11:TRUE"
"OutputFilename" = "8:WitnessRandomizerInstaller.msi"
"OutputFilename" = "8:..\\GithubPackage\\WitnessRandomizerInstaller.msi"
"PackageFilesAs" = "3:2"
"PackageFileSize" = "3:-2147483648"
"CabType" = "3:1"
Expand Down Expand Up @@ -162,15 +162,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Witness Randomizer"
"ProductCode" = "8:{ED6B3515-B039-4560-B97F-A61695CCDE5F}"
"PackageCode" = "8:{4C062EDD-4A06-4DC6-9C37-82A2BD37A0B5}"
"ProductCode" = "8:{2AC8C329-8190-4A51-9861-5C922763C6F3}"
"PackageCode" = "8:{05B49C89-4B7E-4E42-B061-3BAB51527E54}"
"UpgradeCode" = "8:{4CB5496B-A47E-41D3-B4A7-677E29AB7513}"
"AspNetVersion" = "8:2.0.50727.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:FALSE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:4.0.8"
"ProductVersion" = "8:5.0.0"
"Manufacturer" = "8:jbzdarkid"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:https://www.github.com/jbzdarkid/witness-randomizer/issues"
Expand Down Expand Up @@ -698,7 +698,7 @@
{
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_F4835D5BBF3E437390127C4C49888F07"
{
"SourcePath" = "8:..\\x64\\Release\\WitnessRandomizer.exe"
"SourcePath" = "8:..\\x64\\Debug\\WitnessRandomizer.exe"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_8E9D847124D34D9D9008762077D816DE"
Expand Down
Loading

0 comments on commit eb42060

Please sign in to comment.