From b42a4a4e4d72f6dea0a243c77247f7b9e739f5eb Mon Sep 17 00:00:00 2001 From: void_17 <61356189+void2012@users.noreply.github.com> Date: Tue, 3 Mar 2026 10:31:09 +0700 Subject: Revert "Revert "Win64: configurable username (username.txt) and persistent ga…" (#235) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7f7d99501cf87fcc234a5d3af453e7e0642f96a3. --- Minecraft.Client/Windows64/Windows64_Minecraft.cpp | 27 ++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'Minecraft.Client/Windows64/Windows64_Minecraft.cpp') diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index 272b29bf..48040c66 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -729,7 +729,16 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); - dyn_SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE); + // 4J-Win64: set CWD to exe dir so asset paths resolve correctly + { + char szExeDir[MAX_PATH] = {}; + GetModuleFileNameA(NULL, szExeDir, MAX_PATH); + char *pSlash = strrchr(szExeDir, '\\'); + if (pSlash) { *(pSlash + 1) = '\0'; SetCurrentDirectoryA(szExeDir); } + } + + // Declare DPI awareness so GetSystemMetrics returns physical pixels + SetProcessDPIAware(); g_iScreenWidth = GetSystemMetrics(SM_CXSCREEN); g_iScreenHeight = GetSystemMetrics(SM_CYSCREEN); @@ -1263,7 +1272,21 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, } } - // F11 toggles fullscreen + // F3 toggles the debug console overlay, F11 toggles fullscreen + if (KMInput.IsKeyPressed(VK_F3)) + { + static bool s_debugConsole = false; + s_debugConsole = !s_debugConsole; + ui.ShowUIDebugConsole(s_debugConsole); + } + +#ifdef _DEBUG_MENUS_ENABLED + if (KMInput.IsKeyPressed(VK_F4)) + { + ui.NavigateToScene(ProfileManager.GetPrimaryPad(), eUIScene_DebugOverlay, NULL, eUILayer_Debug); + } +#endif + if (KMInput.IsKeyPressed(VK_F11)) { ToggleFullscreen(); -- cgit v1.2.3