From 14afabda0eff279a737b32302df320ddeba7ac4f Mon Sep 17 00:00:00 2001 From: Matthew Toro Date: Sat, 4 Apr 2026 15:35:40 -0400 Subject: [PATCH] fix: fixing an oopsie where password mode would briefly show the real text in the buffer before switching to asterisks when sent to exchange for token. (elyby) --- Minecraft.Client/Common/UI/UIScene_Keyboard.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Minecraft.Client/Common/UI/UIScene_Keyboard.cpp b/Minecraft.Client/Common/UI/UIScene_Keyboard.cpp index e21cf85b..f57b21e1 100644 --- a/Minecraft.Client/Common/UI/UIScene_Keyboard.cpp +++ b/Minecraft.Client/Common/UI/UIScene_Keyboard.cpp @@ -173,7 +173,7 @@ void UIScene_Keyboard::tick() // Sync our buffer from Flash so we pick up changes made via controller/on-screen buttons. // Without this, switching between controller and keyboard would use stale text. // In PC mode we own the buffer — skip sync to preserve cursor position. - if (!m_bPCMode) + if (!m_bPCMode && m_eKeyboardMode != C_4JInput::EKeyboardMode_Password) { const wchar_t* flashText = m_KeyboardTextInput.getLabel(); if (flashText) @@ -417,8 +417,12 @@ void UIScene_Keyboard::KeyboardDonePressed() // Use getLabel() here — this is a timer callback (not an Iggy callback) so it's safe. // getLabel() reflects both physical keyboard input (pushed via setLabel) and // on-screen button input (set directly by Flash ActionScript). - const wchar_t* finalText = m_KeyboardTextInput.getLabel(); - app.DebugPrintf("UI Keyboard - DONE - [%ls]\n", finalText); + // in password mode the label is masked with asterisks, so use the real buffer instead + const wchar_t* finalText = (m_eKeyboardMode == C_4JInput::EKeyboardMode_Password) + ? m_win64TextBuffer.c_str() + : m_KeyboardTextInput.getLabel(); + app.DebugPrintf("UI Keyboard - DONE - [%ls]\n", + (m_eKeyboardMode == C_4JInput::EKeyboardMode_Password) ? L"" : finalText); // Store the typed text so callbacks can retrieve it via Win64_GetKeyboardText() wcsncpy_s(g_Win64KeyboardResult, 256, finalText, _TRUNCATE);