aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Windows64
diff options
context:
space:
mode:
authorrtm516 <rtm516@users.noreply.github.com>2026-03-04 04:31:47 +0000
committerGitHub <noreply@github.com>2026-03-04 12:31:47 +0800
commitb1b622c303a40a5533962fc63559a0346cfbca04 (patch)
treec5c064b7f9c4d5047f35d6a6a28256d7ce989d17 /Minecraft.Client/Windows64
parentf216abca4217b3fe4497d5aea5e4a3d6cf679b46 (diff)
Fix overlapping debug menus and screens (#294)
* Fix overlapping debug menus and screens Also resolves a formatting issue with clang-format * Update readme
Diffstat (limited to 'Minecraft.Client/Windows64')
-rw-r--r--Minecraft.Client/Windows64/Windows64_Minecraft.cpp67
1 files changed, 31 insertions, 36 deletions
diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp
index 4a3d835c..9d9537c5 100644
--- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp
+++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp
@@ -1278,7 +1278,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
}
}
- // F1 toggles the HUD, F3 toggles the debug console overlay, F11 toggles fullscreen
+ // F1 toggles the HUD
if (KMInput.IsKeyPressed(VK_F1))
{
int primaryPad = ProfileManager.GetPrimaryPad();
@@ -1286,21 +1286,43 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
app.SetGameSettings(primaryPad, eGameSetting_DisplayHUD, displayHud ? 0 : 1);
app.SetGameSettings(primaryPad, eGameSetting_DisplayHand, displayHud ? 0 : 1);
}
-
+
+ // F3 toggles onscreen debug info
if (KMInput.IsKeyPressed(VK_F3))
{
- static bool s_debugConsole = false;
- s_debugConsole = !s_debugConsole;
- ui.ShowUIDebugConsole(s_debugConsole);
+ if (Minecraft* pMinecraft = Minecraft::GetInstance())
+ {
+ if (pMinecraft->options)
+ {
+ pMinecraft->options->renderDebug = !pMinecraft->options->renderDebug;
+ }
+ }
}
#ifdef _DEBUG_MENUS_ENABLED
- if (KMInput.IsKeyPressed(VK_F4))
- {
- ui.NavigateToScene(ProfileManager.GetPrimaryPad(), eUIScene_DebugOverlay, NULL, eUILayer_Debug);
- }
+ // F4 Open debug overlay
+ if (KMInput.IsKeyPressed(VK_F4))
+ {
+ if (Minecraft *pMinecraft = Minecraft::GetInstance())
+ {
+ if (pMinecraft->options &&
+ app.GetGameStarted() && !ui.GetMenuDisplayed(0) && pMinecraft->screen == NULL)
+ {
+ ui.NavigateToScene(0, eUIScene_DebugOverlay, NULL, eUILayer_Debug);
+ }
+ }
+ }
+
+ // F6 Open debug console
+ if (KMInput.IsKeyPressed(VK_F6))
+ {
+ static bool s_debugConsole = false;
+ s_debugConsole = !s_debugConsole;
+ ui.ShowUIDebugConsole(s_debugConsole);
+ }
#endif
+ // F11 Toggle fullscreen
if (KMInput.IsKeyPressed(VK_F11))
{
ToggleFullscreen();
@@ -1318,33 +1340,6 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
}
}
-#ifdef _DEBUG_MENUS_ENABLED
- // F3 toggles onscreen debug info
- if (KMInput.IsKeyPressed(VK_F3))
- {
- if (Minecraft* pMinecraft = Minecraft::GetInstance())
- {
- if (pMinecraft->options && app.DebugSettingsOn())
- {
- pMinecraft->options->renderDebug = !pMinecraft->options->renderDebug;
- }
- }
- }
-
- // F4 opens debug overlay
- if (KMInput.IsKeyPressed(VK_F4))
- {
- if (Minecraft* pMinecraft = Minecraft::GetInstance())
- {
- if (pMinecraft->options && app.DebugSettingsOn() &&
- app.GetGameStarted() && !ui.GetMenuDisplayed(0) && pMinecraft->screen == NULL)
- {
- ui.NavigateToScene(0, eUIScene_DebugOverlay, NULL, eUILayer_Debug);
- }
- }
- }
-#endif
-
#if 0
// has the game defined profile data been changed (by a profile load)
if(app.uiGameDefinedDataChangedBitmask!=0)