refactor(jui): specify overrides, resourcelocations, and localization

This commit is contained in:
Sally Knight
2026-03-27 20:33:41 +03:00
committed by Tropical
parent c512bcb19c
commit 1a478c8a5b
40 changed files with 218 additions and 201 deletions

View File

@@ -2,6 +2,10 @@
#include "Button.h"
#include "../Textures/Textures.h"
#ifdef ENABLE_JAVA_GUIS
ResourceLocation GUI_GUI_LOCATION = ResourceLocation(TN_GUI_GUI);
#endif
Button::Button(int id, int x, int y, const std::wstring& msg) {
init(id, x, y, 200, 20, msg);
}
@@ -38,8 +42,9 @@ void Button::render(Minecraft* minecraft, int xm, int ym) {
Font* font = minecraft->font;
glBindTexture(GL_TEXTURE_2D, minecraft->textures->loadTexture(
TN_GUI_GUI)); // 4J was L"/gui/gui.png"
// glBindTexture(GL_TEXTURE_2D, minecraft->textures->loadTexture(
// TN_GUI_GUI)); // 4J was L"/gui/gui.png"
minecraft->textures->bindTexture(&GUI_GUI_LOCATION);
glColor4f(1, 1, 1, 1);
bool hovered = xm >= x && ym >= y && xm < x + w && ym < y + h;