mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-24 10:13:36 +00:00
37 lines
1.3 KiB
C++
37 lines
1.3 KiB
C++
#include "../../Platform/stdafx.h"
|
|
#include "ContainerScreen.h"
|
|
#include "../../Textures/Textures.h"
|
|
#include "../../../Minecraft.World/Headers/net.minecraft.world.inventory.h"
|
|
|
|
ContainerScreen::ContainerScreen(std::shared_ptr<Container> inventory,
|
|
std::shared_ptr<Container> 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) {
|
|
#ifdef ENABLE_JAVA_GUIS
|
|
int tex = minecraft->textures->loadTexture(TN_GUI_CONTAINER);
|
|
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
|
|
} |