From a7f6fd6ef6971e16d6f078ed10f86c7ef223ab79 Mon Sep 17 00:00:00 2001 From: illusion98 <37698908+illusion98@users.noreply.github.com> Date: Sat, 1 Feb 2020 03:58:31 -0500 Subject: [PATCH] Add F2 Hotkey to open current commit ID URL --- src/xenia/app/emulator_window.cc | 19 +++++++++++++------ src/xenia/app/emulator_window.h | 1 + 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/xenia/app/emulator_window.cc b/src/xenia/app/emulator_window.cc index a15d33f8c..6b1b55ed6 100644 --- a/src/xenia/app/emulator_window.cc +++ b/src/xenia/app/emulator_window.cc @@ -167,6 +167,10 @@ bool EmulatorWindow::Initialize() { case 0x70: { // VK_F1 ShowHelpWebsite(); } break; + + case 0x71: { // VK_F2 + ShowCommitID(); + } break; default: { handled = false; } break; } @@ -299,12 +303,8 @@ bool EmulatorWindow::Initialize() { auto help_menu = MenuItem::Create(MenuItem::Type::kPopup, L"&Help"); { help_menu->AddChild(MenuItem::Create( - MenuItem::Type::kString, L"Build commit on GitHub...", [this]() { - std::wstring url = - std::wstring(L"https://github.com/xenia-canary/xenia-canary/commit/") + - xe::to_wstring(XE_BUILD_COMMIT) + L"/"; - LaunchBrowser(url.c_str()); - })); + MenuItem::Type::kString, L"Build commit on GitHub...", L"F2", + std::bind(&EmulatorWindow::ShowCommitID, this))); help_menu->AddChild(MenuItem::Create( MenuItem::Type::kString, L"Recent changes on GitHub...", [this]() { std::wstring url = @@ -557,6 +557,13 @@ void EmulatorWindow::ToggleFullscreen() { void EmulatorWindow::ShowHelpWebsite() { LaunchBrowser(L"https://xenia.jp"); } +void EmulatorWindow::ShowCommitID() { + std::wstring url = + std::wstring(L"https://github.com/xenia-canary/xenia-canary/commit/") + + xe::to_wstring(XE_BUILD_COMMIT) + L"/"; + LaunchBrowser(url.c_str()); + } + void EmulatorWindow::UpdateTitle() { std::wstring title(base_title_); diff --git a/src/xenia/app/emulator_window.h b/src/xenia/app/emulator_window.h index 5083ae786..8367f1a3c 100644 --- a/src/xenia/app/emulator_window.h +++ b/src/xenia/app/emulator_window.h @@ -59,6 +59,7 @@ class EmulatorWindow { void GpuTraceFrame(); void GpuClearCaches(); void ShowHelpWebsite(); + void ShowCommitID(); Emulator* emulator_; std::unique_ptr loop_;