From 02dd039e585fffee13de39d1b7841bc440765ed0 Mon Sep 17 00:00:00 2001 From: KKNecmi Date: Sat, 7 Mar 2026 10:06:20 +0300 Subject: [PATCH] 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(); } }