From ea65542c1b63d7ee37025837bf205e55ace0c863 Mon Sep 17 00:00:00 2001 From: Kevin <115616336+lag@users.noreply.github.com> Date: Fri, 6 Mar 2026 09:52:28 -0600 Subject: Add Chat / Pastes / Formatting (#682) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Initial fixes for ContainerSetSlotPacket and CraftItemPacket * Chat: paste, history, § formatting, 1-9 block when open (Windows64) Made-with: Cursor * static_cast refactor --- Minecraft.Client/Font.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Minecraft.Client/Font.h') diff --git a/Minecraft.Client/Font.h b/Minecraft.Client/Font.h index 18d9bf91..3d25880d 100644 --- a/Minecraft.Client/Font.h +++ b/Minecraft.Client/Font.h @@ -21,6 +21,12 @@ private: float xPos; float yPos; + // § format state (bold, italic, underline, strikethrough); set during draw(), reset by §r + bool m_bold; + bool m_italic; + bool m_underline; + bool m_strikethrough; + bool enforceUnicodeSheet; // use unicode sheet for ascii bool bidirectional; // use bidi to flip strings @@ -41,9 +47,11 @@ public: private: void renderCharacter(wchar_t c); // 4J added + void renderStyleLine(float x0, float y0, float x1, float y1); // solid line for underline/strikethrough 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 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); /** @@ -58,11 +66,13 @@ private: void draw(const wstring &str, bool dropShadow); void draw(const wstring& str, int x, int y, int color, bool dropShadow); + void drawLiteral(const wstring& str, int x, int y, int color); // no § parsing int MapCharacter(wchar_t c); // 4J added bool CharacterExists(wchar_t c); // 4J added public: int width(const wstring& str); + int widthLiteral(const wstring& str); // width without skipping § codes (for chat input) wstring sanitize(const wstring& str); void drawWordWrap(const wstring &string, int x, int y, int w, int col, int h); // 4J Added h param -- cgit v1.2.3