Skip to content

Commit

Permalink
Merge pull request #149 from Kyle873/master
Browse files Browse the repository at this point in the history
Made the console key configurable
  • Loading branch information
Yamashi authored Dec 19, 2020
2 parents edc965e + efc843a commit 150616f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Options::Options(HMODULE aModule)

this->DumpGameOptions = config.value("dump_game_options", this->DumpGameOptions);
this->Console = config.value("console", this->Console);
this->ConsoleKey = config.value("console_key", this->ConsoleKey);

// check old config names
if (config.value("unlock_menu", false))
Expand All @@ -78,6 +79,7 @@ Options::Options(HMODULE aModule)
config["disable_antialiasing"] = this->PatchAntialiasing;
config["dump_game_options"] = this->DumpGameOptions;
config["console"] = this->Console;
config["console_key"] = this->ConsoleKey;
config["disable_intro_movies"] = this->PatchDisableIntroMovies;
config["disable_vignette"] = this->PatchDisableVignette;
config["disable_boundary_teleport"] = this->PatchDisableBoundaryTeleport;
Expand Down
1 change: 1 addition & 0 deletions src/Options.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ struct Options

bool DumpGameOptions{ false };
bool Console{ true };
int ConsoleKey{ VK_OEM_3 };
float CPUMemoryPoolFraction{ 0.5f };
float GPUMemoryPoolFraction{ 1.f };
std::filesystem::path Path;
Expand Down
8 changes: 2 additions & 6 deletions src/overlay/Overlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "imgui_impl_dx12.h"
#include "imgui_impl_win32.h"


static std::shared_ptr<Overlay> s_pOverlay;

void Overlay::Initialize(Image* apImage)
Expand Down Expand Up @@ -83,12 +82,9 @@ LRESULT APIENTRY WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
switch (uMsg)
{
case WM_KEYDOWN:
switch (wParam)
{
case VK_END:
if (wParam == Options::Get().ConsoleKey)
s_pOverlay->Toggle();
break;
}
break;
default:
break;
}
Expand Down

0 comments on commit 150616f

Please sign in to comment.