From 72c14ccbfd0e7608a65c9c5f5bacefb3b4f18a0e Mon Sep 17 00:00:00 2001 From: Xenovyy Date: Thu, 19 Mar 2026 18:33:48 -0400 Subject: [PATCH] Added Dark Highlight on f3 menu for better visibility f3 menu now has dark highlight over text (simmilar to java) that makes it significantly easier to read text on white background. --- Minecraft.Client/Gui.cpp | 14 +++++++------- Minecraft.Client/GuiComponent.cpp | 6 ++++-- Minecraft.Client/GuiComponent.h | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index f0d44319a1..9a5150f641 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -1175,13 +1175,13 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) } #endif - int yPos = debugTop; - for (const auto &line : lines) - { - drawString(font, line, debugLeft, yPos, 0xffffff); - yPos += 10; - } - + int yPos = debugTop; + for (const auto& line : lines) + { + fill(debugLeft - 1, yPos - 1, debugLeft + font->width(line) + 1, yPos + 8 + 1, 0x80303030, true); + drawString(font, line, debugLeft, yPos, 0xffffff); + yPos += 10; + } glMatrixMode(GL_MODELVIEW); glPopMatrix(); glMatrixMode(GL_PROJECTION); diff --git a/Minecraft.Client/GuiComponent.cpp b/Minecraft.Client/GuiComponent.cpp index c6b5f518b6..4cfb5e9cd5 100644 --- a/Minecraft.Client/GuiComponent.cpp +++ b/Minecraft.Client/GuiComponent.cpp @@ -24,7 +24,7 @@ void GuiComponent::vLine(int x, int y0, int y1, int col) fill(x, y0 + 1, x + 1, y1, col); } -void GuiComponent::fill(int x0, int y0, int x1, int y1, int col) +void GuiComponent::fill(int x0, int y0, int x1, int y1, int col, bool blend) { if (x0 < x1) { @@ -54,7 +54,9 @@ void GuiComponent::fill(int x0, int y0, int x1, int y1, int col) t->vertex(static_cast(x0), static_cast(y0), static_cast(0)); t->end(); glEnable(GL_TEXTURE_2D); - glDisable(GL_BLEND); + if (blend == false) { + glDisable(GL_BLEND); + } } void GuiComponent::fillGradient(int x0, int y0, int x1, int y1, int col1, int col2) diff --git a/Minecraft.Client/GuiComponent.h b/Minecraft.Client/GuiComponent.h index 4149666484..6e21f92b60 100644 --- a/Minecraft.Client/GuiComponent.h +++ b/Minecraft.Client/GuiComponent.h @@ -9,7 +9,7 @@ class GuiComponent protected: void hLine(int x0, int x1, int y, int col); void vLine(int x, int y0, int y1, int col); - void fill(int x0, int y0, int x1, int y1, int col); + void fill(int x0, int y0, int x1, int y1, int col, bool blend = false); void fillGradient(int x0, int y0, int x1, int y1, int col1, int col2); public: GuiComponent(); // 4J added