mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-27 04:41:39 +00:00
Add HUD toggle.
This commit is contained in:
parent
33b6b09e5d
commit
1a1754f435
1 changed files with 11 additions and 1 deletions
|
|
@ -1,24 +1,34 @@
|
|||
#pragma once
|
||||
|
||||
#include "kernel/memory.h"
|
||||
#include "ui/window_listener.h"
|
||||
|
||||
class FrontendListener : public WindowListener
|
||||
{
|
||||
private:
|
||||
bool m_isF8KeyDown = false;
|
||||
bool m_isF9KeyDown = false;
|
||||
bool m_isF10KeyDown = false;
|
||||
|
||||
public:
|
||||
void OnKeyDown(SDL_Keycode key) override
|
||||
{
|
||||
if (key == SDLK_F8 && !m_isF8KeyDown)
|
||||
{
|
||||
printf("F8 pressed!\n");
|
||||
m_isF8KeyDown = true;
|
||||
|
||||
// アプリケーション設定 / 開発用 / デバッグ / HUD / 全 HUD 描画
|
||||
const auto ms_IsRenderHud = (bool*)g_memory.Translate(0x8328BB26);
|
||||
|
||||
*ms_IsRenderHud = !*ms_IsRenderHud; // Toggle the entire HUD
|
||||
(void)printf("HUD %s\n", *ms_IsRenderHud ? "On" : "Off");
|
||||
}
|
||||
}
|
||||
|
||||
void OnKeyUp(SDL_Keycode key) override
|
||||
{
|
||||
m_isF8KeyDown = key != SDLK_F8;
|
||||
m_isF9KeyDown = key != SDLK_F9;
|
||||
m_isF10KeyDown = key != SDLK_F10;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue