From a3b9f0f2cd2a02c6dcc66ca8f3522abd0f332e5e Mon Sep 17 00:00:00 2001 From: KKNecmi Date: Fri, 6 Mar 2026 01:22:49 +0300 Subject: [PATCH 01/17] Fix mouse getting grabbed outside window of the game --- .../Windows64/KeyboardMouseInput.cpp | 51 +++++++++++++++---- .../Windows64/KeyboardMouseInput.h | 2 + MinecraftConsoles.sln | 2 +- 3 files changed, 44 insertions(+), 11 deletions(-) diff --git a/Minecraft.Client/Windows64/KeyboardMouseInput.cpp b/Minecraft.Client/Windows64/KeyboardMouseInput.cpp index fe3c39194..6af2a54ab 100644 --- a/Minecraft.Client/Windows64/KeyboardMouseInput.cpp +++ b/Minecraft.Client/Windows64/KeyboardMouseInput.cpp @@ -4,6 +4,7 @@ #include "KeyboardMouseInput.h" #include +#include KeyboardMouseInput g_KBMInput; @@ -125,16 +126,40 @@ void KeyboardMouseInput::Tick() } } - if ((m_mouseGrabbed || m_cursorHiddenForUI) && g_hWnd) - { - RECT rc; - GetClientRect(g_hWnd, &rc); - POINT center; - center.x = (rc.right - rc.left) / 2; - center.y = (rc.bottom - rc.top) / 2; - ClientToScreen(g_hWnd, ¢er); - SetCursorPos(center.x, center.y); - } + #ifdef _WINDOWS64 + if (!IsGameInFront()) + { + ClipCursor(NULL); + while (ShowCursor(TRUE) < 0) {} + } + else if (m_cursorHiddenForUI) + { + ClipCursor(NULL); + } + else if (m_mouseGrabbed && g_hWnd) + { + ClipCursorToWindow(g_hWnd); + + RECT rc; + GetClientRect(g_hWnd, &rc); + POINT center; + center.x = (rc.right - rc.left) / 2; + center.y = (rc.bottom - rc.top) / 2; + ClientToScreen(g_hWnd, ¢er); + SetCursorPos(center.x, center.y); + } + #else + if ((m_mouseGrabbed || m_cursorHiddenForUI) && g_hWnd) + { + RECT rc; + GetClientRect(g_hWnd, &rc); + POINT center; + center.x = (rc.right - rc.left) / 2; + center.y = (rc.bottom - rc.top) / 2; + ClientToScreen(g_hWnd, ¢er); + SetCursorPos(center.x, center.y); + } + #endif } void KeyboardMouseInput::OnKeyDown(int vkCode) @@ -408,4 +433,10 @@ void KeyboardMouseInput::ClearCharBuffer() m_charBufferTail = 0; } +bool KeyboardMouseInput::IsGameInFront() +{ + HWND InFrontWindow = GetForegroundWindow(); + return (InFrontWindow == g_hWnd); +} + #endif // _WINDOWS64 diff --git a/Minecraft.Client/Windows64/KeyboardMouseInput.h b/Minecraft.Client/Windows64/KeyboardMouseInput.h index fff924bfd..f59d9fe08 100644 --- a/Minecraft.Client/Windows64/KeyboardMouseInput.h +++ b/Minecraft.Client/Windows64/KeyboardMouseInput.h @@ -139,6 +139,8 @@ private: wchar_t m_charBuffer[CHAR_BUFFER_SIZE]; int m_charBufferHead; int m_charBufferTail; + + bool IsGameInFront(); }; extern KeyboardMouseInput g_KBMInput; diff --git a/MinecraftConsoles.sln b/MinecraftConsoles.sln index 1ce395672..8ffbbe602 100644 --- a/MinecraftConsoles.sln +++ b/MinecraftConsoles.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 -VisualStudioVersion = 17.14.37012.4 d17.14 +VisualStudioVersion = 17.14.37012.4 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Minecraft.World", "Minecraft.World\Minecraft.World.vcxproj", "{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}" EndProject From 76b501ab4785bf9ee08805ff5c83838987432d57 Mon Sep 17 00:00:00 2001 From: KKNecmi Date: Fri, 6 Mar 2026 21:05:23 +0300 Subject: [PATCH 02/17] revert sln --- MinecraftConsoles.sln | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MinecraftConsoles.sln b/MinecraftConsoles.sln index 8ffbbe602..1ce395672 100644 --- a/MinecraftConsoles.sln +++ b/MinecraftConsoles.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 -VisualStudioVersion = 17.14.37012.4 +VisualStudioVersion = 17.14.37012.4 d17.14 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Minecraft.World", "Minecraft.World\Minecraft.World.vcxproj", "{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}" EndProject From 9983756f85771dc03e9ecb67000aeafed9afcfa8 Mon Sep 17 00:00:00 2001 From: KKNecmi Date: Fri, 6 Mar 2026 22:43:33 +0300 Subject: [PATCH 03/17] removed iggy chat --- Minecraft.Client/Common/UI/UIScene_HUD.cpp | 2 +- Minecraft.Client/Gui.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Minecraft.Client/Common/UI/UIScene_HUD.cpp b/Minecraft.Client/Common/UI/UIScene_HUD.cpp index 5f401c39d..e01757abe 100644 --- a/Minecraft.Client/Common/UI/UIScene_HUD.cpp +++ b/Minecraft.Client/Common/UI/UIScene_HUD.cpp @@ -753,7 +753,7 @@ void UIScene_HUD::handleTimerComplete(int id) float opacity = pGui->getOpacity(m_iPad, i); if( opacity > 0 ) { -#if 0 // def _WINDOWS64 // Use Iggy chat until Gui::render has visual parity +#ifdef _WINDOWS64 // Chat drawn by Gui::render with color codes. Hides Iggy chat to avoid double chats. m_controlLabelBackground[i].setOpacity(0); m_labelChatText[i].setOpacity(0); diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index 0a890d931..365ddeac7 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -971,7 +971,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glDisable(GL_ALPHA_TEST); -#if 0 // defined(_WINDOWS64) // Temporarily disable this chat in favor of iggy chat until we have better visual parity +#if defined(_WINDOWS64) glPushMatrix(); glTranslatef(0.0f, static_cast(screenHeight - iSafezoneYHalf - iTooltipsYOffset - 16 - 3 + 22) - 24.0f, 0.0f); From b987e135b86f4d264ab5a7016126ab57b86b2ffe Mon Sep 17 00:00:00 2001 From: KKNecmi Date: Fri, 6 Mar 2026 23:09:18 +0300 Subject: [PATCH 04/17] changed chat text size,background color and opacity to suit legacy's style --- Minecraft.Client/Gui.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index 365ddeac7..993f48050 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -994,16 +994,22 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) if (alpha > 0) { int x = iSafezoneXHalf+2; - int y = -(static_cast(i)) * 9; + int y = -(static_cast(i)) * 9 - 10; if(bTwoPlayerSplitscreen) { y+= iHeightOffset; } wstring msg = guiMessages[iPad][i].string; - this->fill(0, y - 1, screenWidth/fScaleFactorWidth, y + 8, (alpha / 2) << 24); + int bgColor = ((alpha / 4) << 24) | (0x404040); + this->fill(0, y - 1, screenWidth/fScaleFactorWidth, y + 8, bgColor); glEnable(GL_BLEND); - font->drawShadow(msg, iSafezoneXHalf+4, y, 0xffffff + (alpha << 24)); + + glPushMatrix(); + glTranslatef((float)(iSafezoneXHalf+4), (float)y, 0); + glScalef(0.6f, 0.6f, 1.0f); + font->drawShadow(msg, 0, 0, 0xffffff + (alpha << 24)); + glPopMatrix(); } } } From 7d755029d1549cfdad9211bff861c477547c43a3 Mon Sep 17 00:00:00 2001 From: KKNecmi Date: Fri, 6 Mar 2026 23:44:52 +0300 Subject: [PATCH 05/17] fix background opacity & heigth --- Minecraft.Client/Gui.cpp | 4 ++-- Minecraft.Client/Windows64/KeyboardMouseInput.cpp | 6 ------ Minecraft.Client/Windows64/KeyboardMouseInput.h | 2 -- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index 993f48050..cc18d67a6 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -994,14 +994,14 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) if (alpha > 0) { int x = iSafezoneXHalf+2; - int y = -(static_cast(i)) * 9 - 10; + int y = -(static_cast(i)) * 9 - 20; if(bTwoPlayerSplitscreen) { y+= iHeightOffset; } wstring msg = guiMessages[iPad][i].string; - int bgColor = ((alpha / 4) << 24) | (0x404040); + int bgColor = ((alpha / 2) << 24) | (0x404040); this->fill(0, y - 1, screenWidth/fScaleFactorWidth, y + 8, bgColor); glEnable(GL_BLEND); diff --git a/Minecraft.Client/Windows64/KeyboardMouseInput.cpp b/Minecraft.Client/Windows64/KeyboardMouseInput.cpp index c174e8959..a1d779a80 100644 --- a/Minecraft.Client/Windows64/KeyboardMouseInput.cpp +++ b/Minecraft.Client/Windows64/KeyboardMouseInput.cpp @@ -409,10 +409,4 @@ void KeyboardMouseInput::ClearCharBuffer() m_charBufferTail = 0; } -bool KeyboardMouseInput::IsGameInFront() -{ - HWND InFrontWindow = GetForegroundWindow(); - return (InFrontWindow == g_hWnd); -} - #endif // _WINDOWS64 diff --git a/Minecraft.Client/Windows64/KeyboardMouseInput.h b/Minecraft.Client/Windows64/KeyboardMouseInput.h index 82618d8c8..0f14dfa1f 100644 --- a/Minecraft.Client/Windows64/KeyboardMouseInput.h +++ b/Minecraft.Client/Windows64/KeyboardMouseInput.h @@ -139,8 +139,6 @@ private: wchar_t m_charBuffer[CHAR_BUFFER_SIZE]; int m_charBufferHead; int m_charBufferTail; - - bool IsGameInFront(); }; extern KeyboardMouseInput g_KBMInput; From 1624629817b20a4457c2dd4aecc17ec32f2da09f Mon Sep 17 00:00:00 2001 From: KKNecmi Date: Sat, 7 Mar 2026 06:16:40 +0300 Subject: [PATCH 06/17] design changes --- Minecraft.Client/Gui.cpp | 10 +++------- Minecraft.Client/Windows64/KeyboardMouseInput.cpp | 1 - 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index cc18d67a6..587b08e4e 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -994,7 +994,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) if (alpha > 0) { int x = iSafezoneXHalf+2; - int y = -(static_cast(i)) * 9 - 20; + int y = -(static_cast(i)) * 13 - 19; if(bTwoPlayerSplitscreen) { y+= iHeightOffset; @@ -1002,14 +1002,10 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) wstring msg = guiMessages[iPad][i].string; int bgColor = ((alpha / 2) << 24) | (0x404040); - this->fill(0, y - 1, screenWidth/fScaleFactorWidth, y + 8, bgColor); + this->fill(0, y - 3 - 1, screenWidth/fScaleFactorWidth, y + 10 - 1, bgColor); glEnable(GL_BLEND); - glPushMatrix(); - glTranslatef((float)(iSafezoneXHalf+4), (float)y, 0); - glScalef(0.6f, 0.6f, 1.0f); - font->drawShadow(msg, 0, 0, 0xffffff + (alpha << 24)); - glPopMatrix(); + font->drawShadowLiteral(msg, iSafezoneXHalf+4, y + 0, 0xffffff + (alpha << 24)); } } } diff --git a/Minecraft.Client/Windows64/KeyboardMouseInput.cpp b/Minecraft.Client/Windows64/KeyboardMouseInput.cpp index a1d779a80..3a98a0987 100644 --- a/Minecraft.Client/Windows64/KeyboardMouseInput.cpp +++ b/Minecraft.Client/Windows64/KeyboardMouseInput.cpp @@ -4,7 +4,6 @@ #include "KeyboardMouseInput.h" #include -#include KeyboardMouseInput g_KBMInput; From 38e25b16709c276843c1cccaf38c580630d7c3db Mon Sep 17 00:00:00 2001 From: KKNecmi Date: Sat, 7 Mar 2026 06:26:59 +0300 Subject: [PATCH 07/17] fix draw history --- Minecraft.Client/Gui.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index 587b08e4e..ad390a5aa 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -1005,7 +1005,11 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) this->fill(0, y - 3 - 1, screenWidth/fScaleFactorWidth, y + 10 - 1, bgColor); glEnable(GL_BLEND); - font->drawShadowLiteral(msg, iSafezoneXHalf+4, y + 0, 0xffffff + (alpha << 24)); + glPushMatrix(); + glTranslatef((float)(iSafezoneXHalf+4), (float)(y), 0); + glScalef(0.6f, 0.6f, 1.0f); + font->drawShadowLiteral(msg, 0, 0, 0xffffff + (alpha << 24)); + glPopMatrix(); } } } From a03bfc87899c22bc4baa8bed6c901598be9644ab Mon Sep 17 00:00:00 2001 From: KKNecmi Date: Sat, 7 Mar 2026 06:57:04 +0300 Subject: [PATCH 08/17] add method for drawing shadows with custom shadow color & added scale formatting to chat history --- Minecraft.Client/Font.cpp | 6 ++++++ Minecraft.Client/Font.h | 1 + Minecraft.Client/Gui.cpp | 26 ++++++++++++++++++++++++-- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/Minecraft.Client/Font.cpp b/Minecraft.Client/Font.cpp index ce2275f69..294919b05 100644 --- a/Minecraft.Client/Font.cpp +++ b/Minecraft.Client/Font.cpp @@ -251,6 +251,12 @@ void Font::drawShadowLiteral(const wstring& str, int x, int y, int color) drawLiteral(str, x, y, color); } +void Font::drawShadowLiteralCustom(const wstring& str, int x, int y, int color, int shadowColor) +{ + drawLiteral(str, x + 1, y + 1, shadowColor); + drawLiteral(str, x, y, color); +} + void Font::drawLiteral(const wstring& str, int x, int y, int color) { if (str.empty()) return; diff --git a/Minecraft.Client/Font.h b/Minecraft.Client/Font.h index a5d117ca0..4a4f55ec9 100644 --- a/Minecraft.Client/Font.h +++ b/Minecraft.Client/Font.h @@ -53,6 +53,7 @@ private: public: void drawShadow(const wstring& str, int x, int y, int color); void drawShadowLiteral(const wstring& str, int x, int y, int color); // draw without interpreting § codes + void drawShadowLiteralCustom(const wstring& str, int x, int y, int color, int shadowColor); // custom shadow color void drawShadowWordWrap(const wstring &str, int x, int y, int w, int color, int h); // 4J Added h param void draw(const wstring &str, int x, int y, int color); /** diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index ad390a5aa..3649b5185 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -972,6 +972,28 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) glDisable(GL_ALPHA_TEST); #if defined(_WINDOWS64) + int uiSetting = app.GetGameSettings(iPad, eGameSetting_UISize); + + float scaleFactor = 1.0f; + float textScale = 0.6f; + int backgroundtop = 13; + + if (uiSetting == 0) + { + textScale = textScale * 1.5; + int backgroundtop = 10; + } + else if (uiSetting == 1) + { + textScale = textScale * 1; + int backgroundtop = 13; + } + else if (uiSetting == 2) + { + textScale = textScale * 0.75; + int backgroundtop = 16; + } + glPushMatrix(); glTranslatef(0.0f, static_cast(screenHeight - iSafezoneYHalf - iTooltipsYOffset - 16 - 3 + 22) - 24.0f, 0.0f); @@ -1007,8 +1029,8 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) glPushMatrix(); glTranslatef((float)(iSafezoneXHalf+4), (float)(y), 0); - glScalef(0.6f, 0.6f, 1.0f); - font->drawShadowLiteral(msg, 0, 0, 0xffffff + (alpha << 24)); + glScalef(textScale, textScale, scaleFactor); + font->drawShadowLiteralCustom(msg, 0, 0, 0xffffff + (alpha << 24), 0x000000 + (alpha << 24)); glPopMatrix(); } } From 4322cc49c76f2e7aaebf0c9cd4815383f236654e Mon Sep 17 00:00:00 2001 From: KKNecmi Date: Sat, 7 Mar 2026 08:24:00 +0300 Subject: [PATCH 09/17] added public wrap for drawliteral for changing text shadow size, added yadjust for positioing the typechatbar --- Minecraft.Client/ChatScreen.cpp | 75 ++++++++++++++++++++++++++++++--- Minecraft.Client/Font.cpp | 5 +++ Minecraft.Client/Font.h | 1 + Minecraft.Client/Gui.cpp | 8 +++- 4 files changed, 80 insertions(+), 9 deletions(-) diff --git a/Minecraft.Client/ChatScreen.cpp b/Minecraft.Client/ChatScreen.cpp index 543cab76c..f19a243d6 100644 --- a/Minecraft.Client/ChatScreen.cpp +++ b/Minecraft.Client/ChatScreen.cpp @@ -140,19 +140,80 @@ void ChatScreen::keyPressed(wchar_t ch, int eventKey) void ChatScreen::render(int xm, int ym, float a) { - fill(2, height - 14, width - 2, height - 2, 0x80000000); + int iPad = minecraft->player->GetXboxPad(); + int uiSetting = app.GetGameSettings(iPad, eGameSetting_UISize); + + float textScale = 0.6f; + int barTopOffset = 14; + int barBottomOffset = 2; + int textYOffset = 12; + int yAdjust = 0; + + if (uiSetting == 0) + { + textScale = textScale * 1.5f; + barTopOffset = 10; + barBottomOffset = 0; + textYOffset = 8; + yAdjust = 50; + } + else if (uiSetting == 1) + { + textScale = textScale * 1.0f; + barTopOffset = 14; + barBottomOffset = 2; + textYOffset = 12; + yAdjust = 0; + } + else if (uiSetting == 2) + { + textScale = textScale * 0.75f; + barTopOffset = 18; + barBottomOffset = 4; + textYOffset = 16; + yAdjust = -50; + } + + int barY = height - barTopOffset + yAdjust; + int barBottom = height - barBottomOffset + yAdjust; + int textY = height - textYOffset + yAdjust; + + fill(2, barY, width - 2, barBottom, 0x80000000); + const wstring prefix = L"> "; int x = 4; - drawString(font, prefix, x, height - 12, 0xe0e0e0); + + drawString(font, prefix, x, textY, 0xe0e0e0); + x += font->width(prefix); wstring beforeCursor = message.substr(0, cursorIndex); wstring afterCursor = message.substr(cursorIndex); - drawStringLiteral(font, beforeCursor, x, height - 12, 0xe0e0e0); - x += font->widthLiteral(beforeCursor); + + glPushMatrix(); + glTranslatef((float)x, (float)textY, 0); + glScalef(textScale, textScale, 1.0f); + font->drawShadowLiteralCustom(beforeCursor, 0, 0, 0xe0e0e0, 0x000000); + glPopMatrix(); + + x += (int)(font->widthLiteral(beforeCursor) * textScale); + if (frame / 6 % 2 == 0) - drawString(font, L"_", x, height - 12, 0xe0e0e0); - x += font->width(L"_"); - drawStringLiteral(font, afterCursor, x, height - 12, 0xe0e0e0); + { + glPushMatrix(); + glTranslatef((float)x, (float)textY, 0); + glScalef(textScale, textScale, 1.0f); + font->drawShadowLiteralCustom(L"_", 0, 0, 0xe0e0e0, 0x000000); + glPopMatrix(); + } + + x += (int)(font->width(L"_") * textScale); + + glPushMatrix(); + glTranslatef((float)x, (float)textY, 0); + glScalef(textScale, textScale, 1.0f); + font->drawShadowLiteralCustom(afterCursor, 0, 0, 0xe0e0e0, 0x000000); + glPopMatrix(); + Screen::render(xm, ym, a); } diff --git a/Minecraft.Client/Font.cpp b/Minecraft.Client/Font.cpp index 294919b05..3f5b5237e 100644 --- a/Minecraft.Client/Font.cpp +++ b/Minecraft.Client/Font.cpp @@ -281,6 +281,11 @@ void Font::draw(const wstring& str, int x, int y, int color) draw(str, x, y, color, false); } +void Font::drawLiteralPublic(const wstring& str, int x, int y, int color) +{ + drawLiteral(str, x, y, color); +} + wstring Font::reorderBidi(const wstring &str) { // 4J Not implemented diff --git a/Minecraft.Client/Font.h b/Minecraft.Client/Font.h index 4a4f55ec9..d207c29a2 100644 --- a/Minecraft.Client/Font.h +++ b/Minecraft.Client/Font.h @@ -56,6 +56,7 @@ public: void drawShadowLiteralCustom(const wstring& str, int x, int y, int color, int shadowColor); // custom shadow color void drawShadowWordWrap(const wstring &str, int x, int y, int w, int color, int h); // 4J Added h param void draw(const wstring &str, int x, int y, int color); + void drawLiteralPublic(const wstring& str, int x, int y, int color); /** * Reorders the string according to bidirectional levels. A bit expensive at * the moment. diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index 3649b5185..f233ae49d 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -975,7 +975,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) int uiSetting = app.GetGameSettings(iPad, eGameSetting_UISize); float scaleFactor = 1.0f; - float textScale = 0.6f; + float textScale = 0.65f; int backgroundtop = 13; if (uiSetting == 0) @@ -1030,7 +1030,11 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) glPushMatrix(); glTranslatef((float)(iSafezoneXHalf+4), (float)(y), 0); glScalef(textScale, textScale, scaleFactor); - font->drawShadowLiteralCustom(msg, 0, 0, 0xffffff + (alpha << 24), 0x000000 + (alpha << 24)); + glPushMatrix(); + glScalef(1.0f, 1.0f, 1.0f); + font->drawLiteralPublic(msg, 2, 2, 0x000000 + (alpha / 2 << 24)); + glPopMatrix(); + font->drawLiteralPublic(msg, 0, 0, 0xffffff + (alpha << 24)); glPopMatrix(); } } From 02dd039e585fffee13de39d1b7841bc440765ed0 Mon Sep 17 00:00:00 2001 From: KKNecmi Date: Sat, 7 Mar 2026 10:06:20 +0300 Subject: [PATCH 10/17] removed unused added public wrap,edited yadjust & removed unused variables in set uiscale --- Minecraft.Client/ChatScreen.cpp | 19 +++++-------------- Minecraft.Client/Font.cpp | 9 ++------- Minecraft.Client/Font.h | 3 +-- Minecraft.Client/Gui.cpp | 6 +----- 4 files changed, 9 insertions(+), 28 deletions(-) diff --git a/Minecraft.Client/ChatScreen.cpp b/Minecraft.Client/ChatScreen.cpp index f19a243d6..2049aee08 100644 --- a/Minecraft.Client/ChatScreen.cpp +++ b/Minecraft.Client/ChatScreen.cpp @@ -152,26 +152,17 @@ void ChatScreen::render(int xm, int ym, float a) if (uiSetting == 0) { textScale = textScale * 1.5f; - barTopOffset = 10; - barBottomOffset = 0; - textYOffset = 8; - yAdjust = 50; + yAdjust = 70; } else if (uiSetting == 1) { textScale = textScale * 1.0f; - barTopOffset = 14; - barBottomOffset = 2; - textYOffset = 12; yAdjust = 0; } else if (uiSetting == 2) { textScale = textScale * 0.75f; - barTopOffset = 18; - barBottomOffset = 4; - textYOffset = 16; - yAdjust = -50; + yAdjust = -70; } int barY = height - barTopOffset + yAdjust; @@ -192,7 +183,7 @@ void ChatScreen::render(int xm, int ym, float a) glPushMatrix(); glTranslatef((float)x, (float)textY, 0); glScalef(textScale, textScale, 1.0f); - font->drawShadowLiteralCustom(beforeCursor, 0, 0, 0xe0e0e0, 0x000000); + font->drawShadowLiteralCustom(beforeCursor, 0, 0, 1, 1, 0xe0e0e0, 0x000000); glPopMatrix(); x += (int)(font->widthLiteral(beforeCursor) * textScale); @@ -202,7 +193,7 @@ void ChatScreen::render(int xm, int ym, float a) glPushMatrix(); glTranslatef((float)x, (float)textY, 0); glScalef(textScale, textScale, 1.0f); - font->drawShadowLiteralCustom(L"_", 0, 0, 0xe0e0e0, 0x000000); + font->drawShadowLiteralCustom(L"_", 0, 0, 1, 1, 0xe0e0e0, 0x000000); glPopMatrix(); } @@ -211,7 +202,7 @@ void ChatScreen::render(int xm, int ym, float a) glPushMatrix(); glTranslatef((float)x, (float)textY, 0); glScalef(textScale, textScale, 1.0f); - font->drawShadowLiteralCustom(afterCursor, 0, 0, 0xe0e0e0, 0x000000); + font->drawShadowLiteralCustom(afterCursor, 0, 0, 1, 1, 0xe0e0e0, 0x000000); glPopMatrix(); Screen::render(xm, ym, a); diff --git a/Minecraft.Client/Font.cpp b/Minecraft.Client/Font.cpp index 3f5b5237e..3f556c774 100644 --- a/Minecraft.Client/Font.cpp +++ b/Minecraft.Client/Font.cpp @@ -251,9 +251,9 @@ void Font::drawShadowLiteral(const wstring& str, int x, int y, int color) drawLiteral(str, x, y, color); } -void Font::drawShadowLiteralCustom(const wstring& str, int x, int y, int color, int shadowColor) +void Font::drawShadowLiteralCustom(const wstring& str, int x, int y, int xplus, int yplus, int color, int shadowColor) { - drawLiteral(str, x + 1, y + 1, shadowColor); + drawLiteral(str, x + xplus, y + yplus, shadowColor); drawLiteral(str, x, y, color); } @@ -281,11 +281,6 @@ void Font::draw(const wstring& str, int x, int y, int color) draw(str, x, y, color, false); } -void Font::drawLiteralPublic(const wstring& str, int x, int y, int color) -{ - drawLiteral(str, x, y, color); -} - wstring Font::reorderBidi(const wstring &str) { // 4J Not implemented diff --git a/Minecraft.Client/Font.h b/Minecraft.Client/Font.h index d207c29a2..54a4d6120 100644 --- a/Minecraft.Client/Font.h +++ b/Minecraft.Client/Font.h @@ -53,10 +53,9 @@ private: public: void drawShadow(const wstring& str, int x, int y, int color); void drawShadowLiteral(const wstring& str, int x, int y, int color); // draw without interpreting § codes - void drawShadowLiteralCustom(const wstring& str, int x, int y, int color, int shadowColor); // custom shadow color + void drawShadowLiteralCustom(const wstring& str, int x, int y, int xplus, int yplus, int color, int shadowColor); // custom shadow color void drawShadowWordWrap(const wstring &str, int x, int y, int w, int color, int h); // 4J Added h param void draw(const wstring &str, int x, int y, int color); - void drawLiteralPublic(const wstring& str, int x, int y, int color); /** * Reorders the string according to bidirectional levels. A bit expensive at * the moment. diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index f233ae49d..3de6c22ef 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -1030,11 +1030,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) glPushMatrix(); glTranslatef((float)(iSafezoneXHalf+4), (float)(y), 0); glScalef(textScale, textScale, scaleFactor); - glPushMatrix(); - glScalef(1.0f, 1.0f, 1.0f); - font->drawLiteralPublic(msg, 2, 2, 0x000000 + (alpha / 2 << 24)); - glPopMatrix(); - font->drawLiteralPublic(msg, 0, 0, 0xffffff + (alpha << 24)); + font->drawShadowLiteralCustom(msg, 0, 0, 2, 2, 0xffffff + (alpha << 24), 0x000000 + (alpha / 2 << 24)); glPopMatrix(); } } From 6472694cb4c9902b25c909d8100802fa627d75aa Mon Sep 17 00:00:00 2001 From: KKNecmi Date: Sat, 7 Mar 2026 14:00:19 +0300 Subject: [PATCH 11/17] added unused variables because they was important & tested tried and finded best offsets and y adjustments --- Minecraft.Client/ChatScreen.cpp | 21 +++++++++++++++++---- Minecraft.Client/Gui.cpp | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Minecraft.Client/ChatScreen.cpp b/Minecraft.Client/ChatScreen.cpp index 2049aee08..651be5e86 100644 --- a/Minecraft.Client/ChatScreen.cpp +++ b/Minecraft.Client/ChatScreen.cpp @@ -148,28 +148,41 @@ void ChatScreen::render(int xm, int ym, float a) int barBottomOffset = 2; int textYOffset = 12; int yAdjust = 0; + int widthsubtract = 2; if (uiSetting == 0) { - textScale = textScale * 1.5f; - yAdjust = 70; + textScale = textScale * 1.25f; + barTopOffset = 10; + barBottomOffset = 0; + textYOffset = 8; + yAdjust = 115; + widthsubtract = -210; } else if (uiSetting == 1) { textScale = textScale * 1.0f; + barTopOffset = 14; + barBottomOffset = 2; + textYOffset = 12; yAdjust = 0; + widthsubtract = 2; } else if (uiSetting == 2) { textScale = textScale * 0.75f; - yAdjust = -70; + barTopOffset = 18; + barBottomOffset = 6; + textYOffset = 16; + yAdjust = -58; + widthsubtract = 110; } int barY = height - barTopOffset + yAdjust; int barBottom = height - barBottomOffset + yAdjust; int textY = height - textYOffset + yAdjust; - fill(2, barY, width - 2, barBottom, 0x80000000); + fill(2, barY, width - widthsubtract, barBottom, 0x80000000); const wstring prefix = L"> "; int x = 4; diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index 3de6c22ef..dbad98569 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -1030,7 +1030,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) glPushMatrix(); glTranslatef((float)(iSafezoneXHalf+4), (float)(y), 0); glScalef(textScale, textScale, scaleFactor); - font->drawShadowLiteralCustom(msg, 0, 0, 2, 2, 0xffffff + (alpha << 24), 0x000000 + (alpha / 2 << 24)); + font->drawShadowLiteralCustom(msg, 0, 0, 1, 1, 0xffffff + (alpha << 24), 0x000000 + (alpha / 2 << 24)); glPopMatrix(); } } From 0c7931b30f5afa7f9abaf07ad82da07cf2aac846 Mon Sep 17 00:00:00 2001 From: KKNecmi Date: Sun, 8 Mar 2026 07:29:43 +0300 Subject: [PATCH 12/17] added float draw & edited some variables to look better on screen --- Minecraft.Client/ChatScreen.cpp | 4 ++-- Minecraft.Client/Font.cpp | 19 +++++++++++++++++++ Minecraft.Client/Font.h | 2 ++ Minecraft.Client/Gui.cpp | 11 +++++------ 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/Minecraft.Client/ChatScreen.cpp b/Minecraft.Client/ChatScreen.cpp index 651be5e86..668d8ae93 100644 --- a/Minecraft.Client/ChatScreen.cpp +++ b/Minecraft.Client/ChatScreen.cpp @@ -154,7 +154,7 @@ void ChatScreen::render(int xm, int ym, float a) { textScale = textScale * 1.25f; barTopOffset = 10; - barBottomOffset = 0; + barBottomOffset = -2; textYOffset = 8; yAdjust = 115; widthsubtract = -210; @@ -170,7 +170,7 @@ void ChatScreen::render(int xm, int ym, float a) } else if (uiSetting == 2) { - textScale = textScale * 0.75f; + textScale = textScale * 0.8f; barTopOffset = 18; barBottomOffset = 6; textYOffset = 16; diff --git a/Minecraft.Client/Font.cpp b/Minecraft.Client/Font.cpp index 3f556c774..f3853667b 100644 --- a/Minecraft.Client/Font.cpp +++ b/Minecraft.Client/Font.cpp @@ -257,6 +257,25 @@ void Font::drawShadowLiteralCustom(const wstring& str, int x, int y, int xplus, drawLiteral(str, x, y, color); } +void Font::drawShadowFloat(const wstring& str, float x, float y, float xplus, float yplus, int color, int shadowColor) +{ + drawLiteralFloat(str, x + xplus, y + yplus, shadowColor); + drawLiteralFloat(str, x, y, color); +} + +void Font::drawLiteralFloat(const wstring& str, float x, float y, int color) +{ + if (str.empty()) return; + if ((color & 0xFC000000) == 0) color |= 0xFF000000; + textures->bindTexture(m_textureLocation); + glColor4f((color >> 16 & 255) / 255.0F, (color >> 8 & 255) / 255.0F, (color & 255) / 255.0F, (color >> 24 & 255) / 255.0F); + xPos = static_cast(x); + yPos = static_cast(y); + wstring cleanStr = sanitize(str); + for (size_t i = 0; i < cleanStr.length(); ++i) + renderCharacter(cleanStr.at(i)); +} + void Font::drawLiteral(const wstring& str, int x, int y, int color) { if (str.empty()) return; diff --git a/Minecraft.Client/Font.h b/Minecraft.Client/Font.h index 54a4d6120..83e7d340f 100644 --- a/Minecraft.Client/Font.h +++ b/Minecraft.Client/Font.h @@ -54,6 +54,8 @@ public: void drawShadow(const wstring& str, int x, int y, int color); void drawShadowLiteral(const wstring& str, int x, int y, int color); // draw without interpreting § codes void drawShadowLiteralCustom(const wstring& str, int x, int y, int xplus, int yplus, int color, int shadowColor); // custom shadow color + void drawShadowFloat(const wstring &str, float x, float y, float xplus, float yplus, int color, int shadowColor); // Test Float Drawing + void drawLiteralFloat(const wstring& str, float x, float y, int color); void drawShadowWordWrap(const wstring &str, int x, int y, int w, int color, int h); // 4J Added h param void draw(const wstring &str, int x, int y, int color); /** diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index dbad98569..0a23f6ba1 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -976,22 +976,20 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) float scaleFactor = 1.0f; float textScale = 0.65f; - int backgroundtop = 13; + int bgfirsty = 2; + int bgsecondy = 9; if (uiSetting == 0) { textScale = textScale * 1.5; - int backgroundtop = 10; } else if (uiSetting == 1) { textScale = textScale * 1; - int backgroundtop = 13; } else if (uiSetting == 2) { textScale = textScale * 0.75; - int backgroundtop = 16; } glPushMatrix(); @@ -1024,13 +1022,14 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) wstring msg = guiMessages[iPad][i].string; int bgColor = ((alpha / 2) << 24) | (0x404040); - this->fill(0, y - 3 - 1, screenWidth/fScaleFactorWidth, y + 10 - 1, bgColor); + this->fill(0, y - bgfirsty, screenWidth/fScaleFactorWidth, y + bgsecondy, bgColor); glEnable(GL_BLEND); glPushMatrix(); glTranslatef((float)(iSafezoneXHalf+4), (float)(y), 0); glScalef(textScale, textScale, scaleFactor); - font->drawShadowLiteralCustom(msg, 0, 0, 1, 1, 0xffffff + (alpha << 24), 0x000000 + (alpha / 2 << 24)); + font->drawShadowFloat(msg, 0, 0, 0.5, 0.5, 0xffffff + (alpha << 24), 0x000000 + (alpha / 2 << 24)); + //font->drawShadowLiteralCustom(msg, 0, 0, 1, 1, 0xffffff + (alpha << 24), 0x000000 + (alpha / 2 << 24)); glPopMatrix(); } } From ab35188a3e415bc78bee40b3b1e035806ea486bb Mon Sep 17 00:00:00 2001 From: KKNecmi Date: Mon, 9 Mar 2026 04:52:33 +0300 Subject: [PATCH 13/17] set bgfirst for uiscale --- Minecraft.Client/Gui.cpp | 1 + mychanges.patch | 256 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 257 insertions(+) create mode 100644 mychanges.patch diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index d042ece55..3d5bd7ef4 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -1104,6 +1104,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) if (uiSetting == 0) { textScale = textScale * 1.5; + bgfirsty = 5; } else if (uiSetting == 1) { diff --git a/mychanges.patch b/mychanges.patch new file mode 100644 index 000000000..69e11c1df --- /dev/null +++ b/mychanges.patch @@ -0,0 +1,256 @@ +diff --git a/Minecraft.Client/MultiPlayerLocalPlayer.cpp b/Minecraft.Client/MultiPlayerLocalPlayer.cpp +index 25bf06bf..1e8379bf 100644 +--- a/Minecraft.Client/MultiPlayerLocalPlayer.cpp ++++ b/Minecraft.Client/MultiPlayerLocalPlayer.cpp +@@ -12,6 +12,7 @@ + #include "..\Minecraft.World\net.minecraft.world.effect.h" + #include "..\Minecraft.World\LevelData.h" + #include "..\Minecraft.World\net.minecraft.world.entity.item.h" ++#include "..\Minecraft.World\EntityIO.h" + #include "Input.h" + #include "LevelRenderer.h" + +@@ -32,9 +33,151 @@ MultiplayerLocalPlayer::MultiplayerLocalPlayer(Minecraft *minecraft, Level *leve + lastSprinting = false; + positionReminder = 0; + ++ killAuraEnabled = false; ++ flightEnabled = false; ++ killauratimer = 0; ++ killauraDelay = 5; ++ nukerEnabled = false; ++ nukerEnabled2 = false; ++ ++ crashPacketSpamEnabled = false; ++ + this->connection = connection; + } + ++void MultiplayerLocalPlayer::crashPacketSpam() ++{ ++ if (!connection) return; ++ ++ static bool spamActive = false; ++ ++ if (!spamActive) ++ { ++ spamActive = true; ++ } ++ ++ if (spamActive) ++ { ++ for (int i = 0; i < 30; i++) ++ { ++ byteArray badData; ++ badData.length = 3048; ++ badData.data = new BYTE[3048]; ++ memset(badData.data, rand(), 3048); ++ ++ connection->send(shared_ptr( ++ new GameCommandPacket((EGameCommand)(rand() % 200), badData))); ++ } ++ } ++} ++ ++void MultiplayerLocalPlayer::doNuker() ++{ ++ if (!level || !nukerEnabled2) return; ++ ++ int px = Mth::floor(x); ++ int py = Mth::floor(y); ++ int pz = Mth::floor(z); ++ ++ for (int dx = -2; dx <= 2; dx++) ++ { ++ for (int dy = -1; dy <= 2; dy++) ++ { ++ for (int dz = -2; dz <= 2; dz++) ++ { ++ int bx = px + dx; ++ int by = py + dy; ++ int bz = pz + dz; ++ ++ int blockId = level->getTile(bx, by, bz); ++ ++ if (blockId != 0 && blockId) ++ { ++ minecraft->gameMode->startDestroyBlock(bx, by, bz, -1); ++ } ++ } ++ } ++ } ++} ++ ++void MultiplayerLocalPlayer::doNuker2() ++{ ++ if (!level || !nukerEnabled2) return; ++ ++ int px = Mth::floor(x); ++ int py = Mth::floor(y); ++ int pz = Mth::floor(z); ++ ++ for (int dx = -2; dx <= 2; dx++) ++ { ++ for (int dy = -1; dy <= 2; dy++) ++ { ++ for (int dz = -2; dz <= 2; dz++) ++ { ++ int bx = px + dx; ++ int by = py + dy; ++ int bz = pz + dz; ++ ++ int blockId = level->getTile(bx, by, bz); ++ ++ if (blockId == 0) ++ { ++ auto it = breakProgress.find({bx, by, bz}); ++ if (it != breakProgress.end()) ++ { ++ breakProgress.erase(it); ++ } ++ continue; ++ } ++ ++ if (breakProgress.find({bx, by, bz}) != breakProgress.end()) ++ { ++ continue; ++ } ++ ++ minecraft->gameMode->startDestroyBlock(bx, by, bz, -1); ++ breakProgress[{bx, by, bz}] = 1; ++ } ++ } ++ } ++} ++ ++void MultiplayerLocalPlayer::findAndAttackTarget() ++{ ++ if (!level || !killAuraEnabled) return; ++ ++ if (killauratimer > 0) ++ { ++ killauratimer--; ++ return; ++ } ++ ++ float range = 6.0f; ++ ++ for (size_t i = 0; i < level->entities.size(); i++) ++ { ++ shared_ptr entity = level->entities[i]; ++ ++ if (!entity || entity.get() == this) continue; ++ if (!entity->isAlive()) continue; ++ ++ double dx = entity->x - x; ++ double dy = entity->y - y; ++ double dz = entity->z - z; ++ float dist = sqrt(dx*dx + dy*dy + dz*dz); ++ ++ if (dist <= range) ++ { ++ Player::attack(entity); ++ swing(); ++ ++ killauratimer = killauraDelay; ++ ++ break; ++ } ++ } ++} ++ + bool MultiplayerLocalPlayer::hurt(DamageSource *source, float dmg) + { + return false; +@@ -63,6 +206,58 @@ void MultiplayerLocalPlayer::tick() + + LocalPlayer::tick(); + ++ if (GetAsyncKeyState('Y') & 1) ++ { ++ killAuraEnabled = !killAuraEnabled; ++ } ++ ++ if (GetAsyncKeyState('G') & 1) ++ { ++ flightEnabled = !flightEnabled; ++ if (flightEnabled) ++ { ++ abilities.mayfly = true; ++ abilities.flying = true; ++ } ++ else ++ { ++ abilities.mayfly = false; ++ abilities.flying = false; ++ } ++ } ++ ++ if (GetAsyncKeyState('P') & 1) ++ { ++ nukerEnabled = !nukerEnabled; ++ } ++ if (GetAsyncKeyState('O') & 1) ++ { ++ nukerEnabled2 = !nukerEnabled2; ++ } ++ ++ if (GetAsyncKeyState('U') & 1) ++ { ++ crashPacketSpamEnabled = !crashPacketSpamEnabled; ++ if (crashPacketSpamEnabled) ++ { ++ crashPacketSpam(); ++ } ++ } ++ ++ if (nukerEnabled) ++ { ++ doNuker(); ++ } ++ if (nukerEnabled2) ++ { ++ doNuker2(); ++ } ++ ++ if (killAuraEnabled) ++ { ++ findAndAttackTarget(); ++ } ++ + // 4J added for testing + #ifdef STRESS_TEST_MOVE + if(stressTestEnabled) +diff --git a/Minecraft.Client/MultiPlayerLocalPlayer.h b/Minecraft.Client/MultiPlayerLocalPlayer.h +index e660a96a..af495100 100644 +--- a/Minecraft.Client/MultiPlayerLocalPlayer.h ++++ b/Minecraft.Client/MultiPlayerLocalPlayer.h +@@ -17,11 +17,28 @@ public: + private: + bool flashOnSetHealth; + public: ++ void doNuker(); ++ void doNuker2(); ++ void findAndAttackTarget(); ++ void crashPacketSpam(); + MultiplayerLocalPlayer(Minecraft *minecraft, Level *level, User *user, ClientConnection *connection); + private: + double xLast, yLast1, yLast2, zLast; + float yRotLast, xRotLast; + public: ++ bool nukerEnabled; ++ bool nukerEnabled2; ++ std::map, int> breakProgress; ++ bool killAuraEnabled; ++ bool flightEnabled; ++ int killauratimer; ++ int killauraDelay; ++ bool isNukerEnabled() const { return nukerEnabled; } ++ bool isNukerEnabled2() const { return nukerEnabled; } ++ bool isKillAuraEnabled() const { return killAuraEnabled; } ++ bool isFlightEnabled() const { return flightEnabled; } ++ bool crashEntitySpamEnabled; ++ bool crashPacketSpamEnabled; + virtual bool hurt(DamageSource *source, float dmg); + virtual void heal(float heal); + virtual void tick(); From fc1f21b8dc8c9269870fbf51e5253569e43f3b28 Mon Sep 17 00:00:00 2001 From: KKNecmi Date: Wed, 11 Mar 2026 07:46:35 +0300 Subject: [PATCH 14/17] write every pixel set bgfirst and bgsecond todo fix --- Minecraft.Client/Gui.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index 3d5bd7ef4..e3e52854c 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -1103,16 +1103,21 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) if (uiSetting == 0) { - textScale = textScale * 1.5; - bgfirsty = 5; + textScale = textScale * 1.5; //20pixels wrong (correct is 21) + bgfirsty = 5; //15pixels correct + bgsecondy = 10; //10pixels wrong (correct is 14) } else if (uiSetting == 1) { - textScale = textScale * 1; + textScale = textScale * 1; //20 pixels wrong (correct is 21) + bgfirsty = 2; //9pixels wrong (correct is 15) + bgsecondy = 9; //20pixels wrong (correct is 14) } else if (uiSetting == 2) { - textScale = textScale * 0.75; + textScale = textScale * 0.75; //20 pixels wrong (correct is 21) + bgfirsty = 2; //12pixels wrong (correct is 15) + bgsecondy = 9; //34pixels wrong (correct is 14) } glPushMatrix(); From 57cb69bcd469b5f2dfff379b8141df23db432fd5 Mon Sep 17 00:00:00 2001 From: KKNecmi Date: Fri, 13 Mar 2026 07:22:05 +0300 Subject: [PATCH 15/17] test different numbers & test changing screen variables without guiscaling didnt worked test safezone later --- Minecraft.Client/Gui.cpp | 55 +++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index 3041ef768..77504eeb2 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -84,7 +84,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) guiScale=app.GetGameSettings(iPad,eGameSetting_UISizeSplitscreen) + 2; } - + app.DebugPrintf("STARTS HERE STARTS HERE STARTS HERE"); ScreenSizeCalculator ssc(minecraft->options, minecraft->width, minecraft->height, guiScale ); int screenWidth = ssc.getWidth(); int screenHeight = ssc.getHeight(); @@ -1104,30 +1104,39 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) float scaleFactor = 1.0f; float textScale = 0.65f; - int bgfirsty = 2; - int bgsecondy = 9; + int bgfirsty = 1; + int bgsecondy = 8; - if (uiSetting == 0) - { - textScale = textScale * 1.5; //20pixels wrong (correct is 21) - bgfirsty = 5; //15pixels correct - bgsecondy = 10; //10pixels wrong (correct is 14) - } - else if (uiSetting == 1) - { - textScale = textScale * 1; //20 pixels wrong (correct is 21) - bgfirsty = 2; //9pixels wrong (correct is 15) - bgsecondy = 9; //20pixels wrong (correct is 14) - } - else if (uiSetting == 2) - { - textScale = textScale * 0.75; //20 pixels wrong (correct is 21) - bgfirsty = 2; //12pixels wrong (correct is 15) - bgsecondy = 9; //34pixels wrong (correct is 14) - } + ScreenSizeCalculator sscchat(minecraft->options, minecraft->width, minecraft->height, 3 ); + int screenWidthchat = sscchat.getWidth(); + int screenHeightchat = sscchat.getHeight(); + + int iSafezoneXHalfChat = screenWidthchat/20; + int iSafezoneYHalfChat = screenHeightchat/20; + int iTooltipsYOffsetChat = 40; + float fScaleFactorWidthChat = 1.0f; + + //if (uiSetting == 0) + //{ + // textScale = textScale * 1.5; //20pixels wrong (correct is 21) + // bgfirsty = 5; //15pixels correct + // bgsecondy = 9; //15pixels wrong (correct is 14) + //} + //else if (uiSetting == 1) + //{ + // textScale = textScale * 1; //20 pixels wrong (correct is 21) + // bgfirsty = 2; //9pixels wrong (correct is 15) + // bgsecondy = 9; //20pixels wrong (correct is 14) + //} + //else if (uiSetting == 2) + //{ + // textScale = textScale * 0.75; //20 pixels wrong (correct is 21) + // bgfirsty = 2; //12pixels wrong (correct is 15) + // bgsecondy = 9; //34pixels wrong (correct is 14) + //} glPushMatrix(); - glTranslatef(0.0f, static_cast(screenHeight - iSafezoneYHalf - iTooltipsYOffset - 16 - 3 + 22) - 24.0f, 0.0f); + glTranslatef(0.0f, static_cast(screenHeightchat - iSafezoneYHalf - iTooltipsYOffset - 16 - 3 + 22) - 24.0f, 0.0f); if(bDisplayGui) { @@ -1156,7 +1165,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) wstring msg = guiMessages[iPad][i].string; int bgColor = ((alpha / 2) << 24) | (0x404040); - this->fill(0, y - bgfirsty, screenWidth/fScaleFactorWidth, y + bgsecondy, bgColor); + this->fill(0, y - bgfirsty, screenWidthchat/fScaleFactorWidth, y + bgsecondy, bgColor); glEnable(GL_BLEND); glPushMatrix(); From e0fcd8a9be4f17c639854a53d72ee82601056065 Mon Sep 17 00:00:00 2001 From: KKNecmi Date: Fri, 13 Mar 2026 07:37:19 +0300 Subject: [PATCH 16/17] change variables to chat versions --- Minecraft.Client/Gui.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index 77504eeb2..8150f1afc 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -1136,7 +1136,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) //} glPushMatrix(); - glTranslatef(0.0f, static_cast(screenHeightchat - iSafezoneYHalf - iTooltipsYOffset - 16 - 3 + 22) - 24.0f, 0.0f); + glTranslatef(0.0f, static_cast(screenHeightchat - iSafezoneYHalfChat - iTooltipsYOffsetChat - 16 - 3 + 22) - 24.0f, 0.0f); if(bDisplayGui) { @@ -1156,16 +1156,16 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) if (alpha > 0) { - int x = iSafezoneXHalf+2; + int x = iSafezoneXHalfChat+2; int y = -(static_cast(i)) * 13 - 19; if(bTwoPlayerSplitscreen) { - y+= iHeightOffset; + y+= iHeightOffset; } wstring msg = guiMessages[iPad][i].string; int bgColor = ((alpha / 2) << 24) | (0x404040); - this->fill(0, y - bgfirsty, screenWidthchat/fScaleFactorWidth, y + bgsecondy, bgColor); + this->fill(0, y - bgfirsty, screenWidthchat/fScaleFactorWidthChat, y + bgsecondy, bgColor); glEnable(GL_BLEND); glPushMatrix(); From dc7ec02b5400b0cfc826ee4ecf01f054ef529d35 Mon Sep 17 00:00:00 2001 From: KKNecmi Date: Fri, 13 Mar 2026 18:07:04 +0300 Subject: [PATCH 17/17] Fix pr merge conflict --- Minecraft.Client/Common/UI/UIScene_HUD.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/Minecraft.Client/Common/UI/UIScene_HUD.cpp b/Minecraft.Client/Common/UI/UIScene_HUD.cpp index 631f93319..24b3e827e 100644 --- a/Minecraft.Client/Common/UI/UIScene_HUD.cpp +++ b/Minecraft.Client/Common/UI/UIScene_HUD.cpp @@ -68,9 +68,13 @@ void UIScene_HUD::updateSafeZone() safeRight = getSafeZoneHalfWidth(); break; case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM: - safeBottom = getSafeZoneHalfHeight(); + // safeTop mirrors SPLIT_TOP so both players have the same vertical inset + // from their viewport's top edge (split divider), keeping GUI symmetrical. + // safeBottom is intentionally omitted: it would shift m_Hud.y upward in + // ActionScript, placing the hotbar too high relative to SPLIT_TOP. + safeTop = getSafeZoneHalfHeight(); safeLeft = getSafeZoneHalfWidth(); - safeRight = getSafeZoneHalfWidth(); + break; case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT: safeLeft = getSafeZoneHalfWidth(); @@ -718,6 +722,20 @@ void UIScene_HUD::render(S32 width, S32 height, C4JRender::eViewportType viewpor F32 scale; ComputeTileScale(tileWidth, tileHeight, m_movieWidth, m_movieHeight, needsYTile, scale, tileYStart); + // For vertical split, if the window is shorter than the SWF movie, + // scale the movie down to fit the full height instead of cropping. + // ComputeTileScale clamps scale >= 1.0 (needed for quadrant mode), + // but in vertical split the tile covers the full screen height and + // cropping the bottom pushes RepositionHud's ActionScript to shift + // elements down. Scaling down keeps visibleH == movieHeight in SWF + // space, so ActionScript sees the full height and applies no offset. + if(!needsYTile && m_movieHeight > 0) + { + F32 scaleH = (F32)tileHeight / (F32)m_movieHeight; + if(scaleH < scale) + scale = scaleH; + } + IggyPlayerSetDisplaySize( getMovie(), static_cast(m_movieWidth * scale), static_cast(m_movieHeight * scale) ); repositionHud(tileWidth, tileHeight, scale);