From b691c43c44ff180d10e7d4a9afc83b98551ff586 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 12:16:08 +0800 Subject: Initial commit --- Minecraft.Client/ContainerScreen.cpp | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Minecraft.Client/ContainerScreen.cpp (limited to 'Minecraft.Client/ContainerScreen.cpp') diff --git a/Minecraft.Client/ContainerScreen.cpp b/Minecraft.Client/ContainerScreen.cpp new file mode 100644 index 00000000..17b45406 --- /dev/null +++ b/Minecraft.Client/ContainerScreen.cpp @@ -0,0 +1,40 @@ +#include "stdafx.h" +#include "ContainerScreen.h" +#include "Textures.h" +#include "..\Minecraft.World\net.minecraft.world.inventory.h" + +ContainerScreen::ContainerScreen(shared_ptr inventory, shared_ptr container) : AbstractContainerScreen(new ContainerMenu(inventory, container)) +{ + this->inventory = inventory; + this->container = container; + this->passEvents = false; + + int defaultHeight = 222; + int noRowHeight = defaultHeight - 6 * 18; + containerRows = container->getContainerSize() / 9; + + imageHeight = noRowHeight + containerRows * 18; + +} + +void ContainerScreen::renderLabels() +{ +#if 0 + font->draw(container->getName(), 8, 2 + 2 + 2, 0x404040); + font->draw(inventory->getName(), 8, imageHeight - 96 + 2, 0x404040); +#endif +} + +void ContainerScreen::renderBg(float a) +{ + // 4J Unused +#if 0 + int tex = minecraft->textures->loadTexture(L"/gui/container.png"); + glColor4f(1, 1, 1, 1); + minecraft->textures->bind(tex); + int xo = (width - imageWidth) / 2; + int yo = (height - imageHeight) / 2; + this->blit(xo, yo, 0, 0, imageWidth, containerRows * 18 + 17); + this->blit(xo, yo + containerRows * 18 + 17, 0, 222 - 96, imageWidth, 96); +#endif +} \ No newline at end of file -- cgit v1.2.3