4jcraft/Minecraft.Client/UI/Screens/EnchantmentScreen.h
2026-03-29 15:50:37 -05:00

50 lines
1.2 KiB
C++

#pragma once
#include "AbstractContainerScreen.h"
#include "../../../Minecraft.World/Containers/EnchantmentMenu.h"
class EnchantmentScreen : public AbstractContainerScreen {
public:
EnchantmentScreen(std::shared_ptr<Inventory> inventory, Level* level, int x,
int y, int z);
virtual ~EnchantmentScreen();
void init();
void removed();
void tick();
void mouseClicked(int mouseX, int mouseY, int buttonNum);
void renderLabels();
void renderBg(float a);
void render(int xm, int ym, float a);
private:
std::shared_ptr<Inventory> inventory;
EnchantmentMenu* enchantMenu;
float xMouse, yMouse;
Random random;
// 4jcraft: brought over from UIControl_EnchantmentBook
int bookTick;
float flip, oFlip, flipT, flipA;
float open, oOpen;
std::shared_ptr<ItemInstance> last;
// 4jcraft: brought over from UIControl_EnchantmentButton
class EnchantmentNames {
public:
static EnchantmentNames instance;
private:
Random random;
std::vector<std::wstring> words;
EnchantmentNames();
public:
std::wstring getRandomName();
};
std::wstring enchantNames[3];
int lastCosts[3];
};