mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-29 01:23:36 +00:00
50 lines
1.3 KiB
C++
50 lines
1.3 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() override;
|
|
void removed() override;
|
|
void tick() override;
|
|
void mouseClicked(int mouseX, int mouseY, int buttonNum) override;
|
|
void renderLabels() override;
|
|
void renderBg(float a) override;
|
|
void render(int xm, int ym, float a) override;
|
|
|
|
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];
|
|
}; |