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

@@ -6,23 +6,27 @@
#include "../../../Minecraft.World/Headers/net.minecraft.world.inventory.h"
#include "../../../Minecraft.World/Blocks/TileEntities/FurnaceTileEntity.h"
#ifdef ENABLE_JAVA_GUIS
ResourceLocation GUI_FURNACE_LOCATION = ResourceLocation(TN_GUI_FURNACE);
#endif
FurnaceScreen::FurnaceScreen(std::shared_ptr<Inventory> inventory,
std::shared_ptr<FurnaceTileEntity> furnace)
: AbstractContainerScreen(new FurnaceMenu(inventory, furnace)) {
this->inventory = inventory;
this->furnace = furnace;
}
void FurnaceScreen::renderLabels() {
font->draw(L"Furnace", 16 + 4 + 40, 2 + 2 + 2, 0x404040);
font->draw(L"Inventory", 8, imageHeight - 96 + 2, 0x404040);
font->draw(furnace->getName(), 16 + 4 + 40, 2 + 2 + 2, 0x404040);
font->draw(inventory->getName(), 8, imageHeight - 96 + 2, 0x404040);
}
void FurnaceScreen::renderBg(float a) {
// 4J Unused
#ifdef ENABLE_JAVA_GUIS
int tex = minecraft->textures->loadTexture(TN_GUI_FURNACE);
glColor4f(1, 1, 1, 1);
minecraft->textures->bind(tex);
minecraft->textures->bindTexture(&GUI_FURNACE_LOCATION);
int xo = (width - imageWidth) / 2;
int yo = (height - imageHeight) / 2;
this->blit(xo, yo, 0, 0, imageWidth, imageHeight);