mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-08 21:57:13 +00:00
refactor(jui): specify overrides, resourcelocations, and localization
This commit is contained in:
parent
c512bcb19c
commit
1a478c8a5b
|
|
@ -2,6 +2,10 @@
|
|||
#include "Button.h"
|
||||
#include "../Textures/Textures.h"
|
||||
|
||||
#ifdef ENABLE_JAVA_GUIS
|
||||
ResourceLocation GUI_GUI_LOCATION = ResourceLocation(TN_GUI_GUI);
|
||||
#endif
|
||||
|
||||
Button::Button(int id, int x, int y, const std::wstring& msg) {
|
||||
init(id, x, y, 200, 20, msg);
|
||||
}
|
||||
|
|
@ -38,8 +42,9 @@ void Button::render(Minecraft* minecraft, int xm, int ym) {
|
|||
|
||||
Font* font = minecraft->font;
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, minecraft->textures->loadTexture(
|
||||
TN_GUI_GUI)); // 4J was L"/gui/gui.png"
|
||||
// glBindTexture(GL_TEXTURE_2D, minecraft->textures->loadTexture(
|
||||
// TN_GUI_GUI)); // 4J was L"/gui/gui.png"
|
||||
minecraft->textures->bindTexture(&GUI_GUI_LOCATION);
|
||||
glColor4f(1, 1, 1, 1);
|
||||
|
||||
bool hovered = xm >= x && ym >= y && xm < x + w && ym < y + h;
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ public:
|
|||
AbstractContainerMenu* menu;
|
||||
|
||||
AbstractContainerScreen(AbstractContainerMenu* menu);
|
||||
virtual void init();
|
||||
virtual void render(int xm, int ym, float a);
|
||||
virtual void init() override;
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
|
||||
protected:
|
||||
virtual void renderLabels();
|
||||
|
|
@ -33,13 +33,13 @@ private:
|
|||
virtual void renderSlot(Slot* slot);
|
||||
|
||||
protected:
|
||||
virtual void mouseClicked(int x, int y, int buttonNum);
|
||||
virtual void mouseReleased(int x, int y, int buttonNum);
|
||||
virtual void keyPressed(wchar_t eventCharacter, int eventKey);
|
||||
virtual void mouseClicked(int x, int y, int buttonNum) override;
|
||||
virtual void mouseReleased(int x, int y, int buttonNum) override;
|
||||
virtual void keyPressed(wchar_t eventCharacter, int eventKey) override;
|
||||
|
||||
public:
|
||||
virtual void removed();
|
||||
virtual void removed() override;
|
||||
virtual void slotsChanged(std::shared_ptr<Container> container);
|
||||
virtual bool isPauseScreen();
|
||||
virtual void tick();
|
||||
};
|
||||
virtual bool isPauseScreen() override;
|
||||
virtual void tick() override;
|
||||
};
|
||||
|
|
@ -43,20 +43,20 @@ public:
|
|||
using Screen::keyPressed;
|
||||
|
||||
AchievementScreen(StatsCounter* statsCounter);
|
||||
virtual void init();
|
||||
virtual void init() override;
|
||||
|
||||
protected:
|
||||
virtual void buttonClicked(Button* button);
|
||||
virtual void buttonClicked(Button* button) override;
|
||||
virtual void keyPressed(char eventCharacter, int eventKey);
|
||||
|
||||
public:
|
||||
virtual void render(int mouseX, int mouseY, float a);
|
||||
virtual void tick();
|
||||
virtual void render(int mouseX, int mouseY, float a) override;
|
||||
virtual void tick() override;
|
||||
|
||||
protected:
|
||||
virtual void renderLabels();
|
||||
virtual void renderBg(int xm, int ym, float a);
|
||||
|
||||
public:
|
||||
virtual bool isPauseScreen();
|
||||
virtual bool isPauseScreen() override;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,19 +10,19 @@ private:
|
|||
|
||||
public:
|
||||
ChatScreen(); // 4J added
|
||||
virtual void init();
|
||||
virtual void removed();
|
||||
virtual void tick();
|
||||
virtual void init() override;
|
||||
virtual void removed() override;
|
||||
virtual void tick() override;
|
||||
|
||||
private:
|
||||
static const std::wstring allowedChars;
|
||||
|
||||
protected:
|
||||
void keyPressed(wchar_t ch, int eventKey);
|
||||
void keyPressed(wchar_t ch, int eventKey) override;
|
||||
|
||||
public:
|
||||
void render(int xm, int ym, float a);
|
||||
void render(int xm, int ym, float a) override;
|
||||
|
||||
protected:
|
||||
void mouseClicked(int x, int y, int buttonNum);
|
||||
void mouseClicked(int x, int y, int buttonNum) override;
|
||||
};
|
||||
|
|
@ -16,11 +16,11 @@ public:
|
|||
ConfirmScreen(Screen* parent, const std::wstring& title1,
|
||||
const std::wstring& title2, const std::wstring& yesButton,
|
||||
const std::wstring& noButton, int id);
|
||||
virtual void init();
|
||||
virtual void init() override;
|
||||
|
||||
protected:
|
||||
virtual void buttonClicked(Button* button);
|
||||
virtual void buttonClicked(Button* button) override;
|
||||
|
||||
public:
|
||||
virtual void render(int xm, int ym, float a);
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
};
|
||||
|
|
@ -10,17 +10,17 @@ private:
|
|||
|
||||
public:
|
||||
ConnectScreen(Minecraft* minecraft, const std::wstring& ip, int port);
|
||||
virtual void tick();
|
||||
virtual void tick() override;
|
||||
|
||||
protected:
|
||||
virtual void keyPressed(char eventCharacter, int eventKey);
|
||||
|
||||
public:
|
||||
virtual void init();
|
||||
virtual void init() override;
|
||||
|
||||
protected:
|
||||
virtual void buttonClicked(Button* button);
|
||||
virtual void buttonClicked(Button* button) override;
|
||||
|
||||
public:
|
||||
virtual void render(int xm, int ym, float a);
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
};
|
||||
|
|
@ -14,6 +14,6 @@ public:
|
|||
std::shared_ptr<Container> container);
|
||||
|
||||
protected:
|
||||
virtual void renderLabels();
|
||||
virtual void renderBg(float a);
|
||||
virtual void renderLabels() override;
|
||||
virtual void renderBg(float a) override;
|
||||
};
|
||||
|
|
@ -25,12 +25,12 @@ private:
|
|||
int getLeftScreenPosition();
|
||||
|
||||
public:
|
||||
void init();
|
||||
void init() override;
|
||||
|
||||
protected:
|
||||
void buttonClicked(Button* button);
|
||||
void keyPressed(wchar_t eventCharacter, int eventKey);
|
||||
void buttonClicked(Button* button) override;
|
||||
void keyPressed(wchar_t eventCharacter, int eventKey) override;
|
||||
|
||||
public:
|
||||
void render(int xm, int ym, float a);
|
||||
void render(int xm, int ym, float a) override;
|
||||
};
|
||||
|
|
@ -2,11 +2,18 @@
|
|||
#include "CraftingScreen.h"
|
||||
#include "../../Textures/Textures.h"
|
||||
#include "../../Player/MultiPlayerLocalPlayer.h"
|
||||
#include "../../../Minecraft.World/Headers/net.minecraft.locale.h"
|
||||
#include "../../../Minecraft.World/Headers/net.minecraft.world.inventory.h"
|
||||
|
||||
#ifdef ENABLE_JAVA_GUIS
|
||||
ResourceLocation GUI_CRAFTING_LOCATION = ResourceLocation(TN_GUI_CRAFTING);
|
||||
#endif
|
||||
|
||||
CraftingScreen::CraftingScreen(std::shared_ptr<Inventory> inventory,
|
||||
Level* level, int x, int y, int z)
|
||||
: AbstractContainerScreen(new CraftingMenu(inventory, level, x, y, z)) {}
|
||||
: AbstractContainerScreen(new CraftingMenu(inventory, level, x, y, z)) {
|
||||
this->inventory = inventory;
|
||||
}
|
||||
|
||||
void CraftingScreen::removed() {
|
||||
AbstractContainerScreen::removed();
|
||||
|
|
@ -14,16 +21,15 @@ void CraftingScreen::removed() {
|
|||
}
|
||||
|
||||
void CraftingScreen::renderLabels() {
|
||||
font->draw(L"Crafting", 8 + 16 + 4, 2 + 2 + 2, 0x404040);
|
||||
font->draw(L"Inventory", 8, imageHeight - 96 + 2, 0x404040);
|
||||
font->draw(Language::getInstance()->getElement(L"container.crafting"), 8 + 16 + 4, 2 + 2 + 2, 0x404040);
|
||||
font->draw(inventory->getName(), 8, imageHeight - 96 + 2, 0x404040);
|
||||
}
|
||||
|
||||
void CraftingScreen::renderBg(float a) {
|
||||
// 4J Unused
|
||||
#ifdef ENABLE_JAVA_GUIS
|
||||
int tex = minecraft->textures->loadTexture(TN_GUI_CRAFTING);
|
||||
glColor4f(1, 1, 1, 1);
|
||||
minecraft->textures->bind(tex);
|
||||
minecraft->textures->bindTexture(&GUI_CRAFTING_LOCATION);
|
||||
int xo = (width - imageWidth) / 2;
|
||||
int yo = (height - imageHeight) / 2;
|
||||
this->blit(xo, yo, 0, 0, imageWidth, imageHeight);
|
||||
|
|
|
|||
|
|
@ -4,12 +4,15 @@ class Inventory;
|
|||
class Level;
|
||||
|
||||
class CraftingScreen : public AbstractContainerScreen {
|
||||
private:
|
||||
std::shared_ptr<Inventory> inventory;
|
||||
|
||||
public:
|
||||
CraftingScreen(std::shared_ptr<Inventory> inventory, Level* level, int x,
|
||||
int y, int z);
|
||||
virtual void removed();
|
||||
virtual void removed() override;
|
||||
|
||||
protected:
|
||||
virtual void renderLabels();
|
||||
virtual void renderBg(float a);
|
||||
virtual void renderLabels() override;
|
||||
virtual void renderBg(float a) override;
|
||||
};
|
||||
|
|
@ -31,8 +31,8 @@ private:
|
|||
|
||||
public:
|
||||
CreateWorldScreen(Screen* lastScreen);
|
||||
virtual void tick();
|
||||
virtual void init();
|
||||
virtual void tick() override;
|
||||
virtual void init() override;
|
||||
|
||||
private:
|
||||
void updateResultFolder();
|
||||
|
|
@ -41,16 +41,16 @@ private:
|
|||
public:
|
||||
static std::wstring findAvailableFolderName(LevelStorageSource* levelSource,
|
||||
const std::wstring& folder);
|
||||
virtual void removed();
|
||||
virtual void removed() override;
|
||||
|
||||
protected:
|
||||
virtual void buttonClicked(Button* button);
|
||||
virtual void keyPressed(wchar_t ch, int eventKey);
|
||||
virtual void mouseClicked(int x, int y, int buttonNum);
|
||||
virtual void buttonClicked(Button* button) override;
|
||||
virtual void keyPressed(wchar_t ch, int eventKey) override;
|
||||
virtual void mouseClicked(int x, int y, int buttonNum) override;
|
||||
|
||||
public:
|
||||
virtual void render(int xm, int ym, float a);
|
||||
virtual void tabPressed();
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
virtual void tabPressed() override;
|
||||
|
||||
private:
|
||||
int m_iGameModeId;
|
||||
|
|
|
|||
|
|
@ -60,21 +60,19 @@ public:
|
|||
};
|
||||
|
||||
public:
|
||||
CreativeInventoryScreen(std::shared_ptr<Player> player);
|
||||
virtual void removed();
|
||||
virtual void init();
|
||||
virtual void containerTick();
|
||||
virtual void tick();
|
||||
virtual void updateEvents();
|
||||
virtual void keyPressed(wchar_t eventCharacter, int eventKey);
|
||||
virtual void mouseClicked(int x, int y, int buttonNum);
|
||||
virtual void mouseReleased(int x, int y, int buttonNum);
|
||||
virtual void render(int xm, int ym, float a);
|
||||
|
||||
CreativeInventoryScreen(std::shared_ptr<Player> player);
|
||||
virtual void removed() override;
|
||||
virtual void init() override;
|
||||
virtual void containerTick();
|
||||
virtual void tick() override;
|
||||
virtual void updateEvents() override;
|
||||
virtual void keyPressed(wchar_t eventCharacter, int eventKey) override;
|
||||
virtual void mouseClicked(int x, int y, int buttonNum) override;
|
||||
virtual void mouseReleased(int x, int y, int buttonNum) override;
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
protected:
|
||||
virtual void renderLabels();
|
||||
virtual void renderBg(float a);
|
||||
|
||||
virtual void renderLabels() override;
|
||||
virtual void renderBg(float a) override;
|
||||
private:
|
||||
void setCurrentCreativeTab(int tab);
|
||||
void selectTab(int tab);
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
|
||||
class DeathScreen : public Screen {
|
||||
public:
|
||||
virtual void init();
|
||||
virtual void init() override;
|
||||
|
||||
protected:
|
||||
virtual void keyPressed(char eventCharacter, int eventKey);
|
||||
virtual void buttonClicked(Button* button);
|
||||
virtual void buttonClicked(Button* button) override;
|
||||
|
||||
public:
|
||||
virtual void render(int xm, int ym, float a);
|
||||
virtual bool isPauseScreen();
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
virtual bool isPauseScreen() override;
|
||||
};
|
||||
|
|
@ -8,7 +8,7 @@ private:
|
|||
public:
|
||||
DisconnectedScreen(const std::wstring& title, const std::wstring reason,
|
||||
void* reasonObjects, ...);
|
||||
virtual void tick();
|
||||
virtual void tick() override;
|
||||
|
||||
protected:
|
||||
using Screen::keyPressed;
|
||||
|
|
@ -16,11 +16,11 @@ protected:
|
|||
virtual void keyPressed(char eventCharacter, int eventKey);
|
||||
|
||||
public:
|
||||
virtual void init();
|
||||
virtual void init() override;
|
||||
|
||||
protected:
|
||||
virtual void buttonClicked(Button* button);
|
||||
virtual void buttonClicked(Button* button) override;
|
||||
|
||||
public:
|
||||
virtual void render(int xm, int ym, float a);
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,13 +9,13 @@ public:
|
|||
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);
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ private:
|
|||
|
||||
public:
|
||||
ErrorScreen(const std::wstring& title, const std::wstring& message);
|
||||
virtual void init();
|
||||
virtual void render(int xm, int ym, float a);
|
||||
virtual void init() override;
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
|
||||
protected:
|
||||
virtual void keyPressed(wchar_t eventCharacter, int eventKey);
|
||||
virtual void keyPressed(wchar_t eventCharacter, int eventKey) override;
|
||||
};
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ class Inventory;
|
|||
|
||||
class FurnaceScreen : public AbstractContainerScreen {
|
||||
private:
|
||||
std::shared_ptr<Inventory> inventory;
|
||||
std::shared_ptr<FurnaceTileEntity> furnace;
|
||||
|
||||
public:
|
||||
|
|
@ -13,6 +14,6 @@ public:
|
|||
std::shared_ptr<FurnaceTileEntity> furnace);
|
||||
|
||||
protected:
|
||||
virtual void renderLabels();
|
||||
virtual void renderBg(float a);
|
||||
virtual void renderLabels() override;
|
||||
virtual void renderBg(float a) override;
|
||||
};
|
||||
|
|
@ -12,8 +12,8 @@ public:
|
|||
std::shared_ptr<Container> hopper);
|
||||
|
||||
protected:
|
||||
virtual void renderLabels();
|
||||
virtual void renderBg(float a);
|
||||
virtual void renderLabels() override;
|
||||
virtual void renderBg(float a) override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<Inventory> inventory;
|
||||
|
|
|
|||
|
|
@ -7,17 +7,17 @@ private:
|
|||
static const int WAKE_UP_BUTTON = 1;
|
||||
|
||||
public:
|
||||
virtual void init();
|
||||
virtual void removed();
|
||||
virtual void init() override;
|
||||
virtual void removed() override;
|
||||
|
||||
protected:
|
||||
virtual void keyPressed(wchar_t ch, int eventKey);
|
||||
virtual void keyPressed(wchar_t ch, int eventKey) override;
|
||||
|
||||
public:
|
||||
virtual void render(int xm, int ym, float a);
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
|
||||
protected:
|
||||
virtual void buttonClicked(Button* button);
|
||||
virtual void buttonClicked(Button* button) override;
|
||||
|
||||
private:
|
||||
void sendWakeUp();
|
||||
|
|
|
|||
|
|
@ -6,18 +6,18 @@ class Button;
|
|||
class InventoryScreen : public AbstractContainerScreen {
|
||||
public:
|
||||
InventoryScreen(std::shared_ptr<Player> player);
|
||||
virtual void init();
|
||||
virtual void init() override;
|
||||
|
||||
protected:
|
||||
virtual void renderLabels();
|
||||
virtual void renderLabels() override;
|
||||
|
||||
private:
|
||||
float xMouse, yMouse;
|
||||
|
||||
public:
|
||||
virtual void render(int xm, int ym, float a);
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
|
||||
protected:
|
||||
virtual void renderBg(float a);
|
||||
virtual void buttonClicked(Button* button);
|
||||
virtual void renderBg(float a) override;
|
||||
virtual void buttonClicked(Button* button) override;
|
||||
};
|
||||
|
|
@ -10,20 +10,20 @@ private:
|
|||
|
||||
public:
|
||||
JoinMultiplayerScreen(Screen* lastScreen);
|
||||
virtual void tick();
|
||||
virtual void init();
|
||||
virtual void removed();
|
||||
virtual void tick() override;
|
||||
virtual void init() override;
|
||||
virtual void removed() override;
|
||||
|
||||
protected:
|
||||
virtual void buttonClicked(Button* button);
|
||||
virtual void buttonClicked(Button* button) override;
|
||||
|
||||
private:
|
||||
virtual int parseInt(const std::wstring& str, int def);
|
||||
|
||||
protected:
|
||||
virtual void keyPressed(wchar_t ch, int eventKey);
|
||||
virtual void mouseClicked(int x, int y, int buttonNum);
|
||||
virtual void keyPressed(wchar_t ch, int eventKey) override;
|
||||
virtual void mouseClicked(int x, int y, int buttonNum) override;
|
||||
|
||||
public:
|
||||
virtual void render(int xm, int ym, float a);
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
};
|
||||
|
|
@ -14,11 +14,11 @@ protected:
|
|||
virtual void keyPressed(char eventCharacter, int eventKey);
|
||||
|
||||
public:
|
||||
virtual void init();
|
||||
virtual void init() override;
|
||||
|
||||
protected:
|
||||
virtual void buttonClicked(Button* button);
|
||||
virtual void buttonClicked(Button* button) override;
|
||||
|
||||
public:
|
||||
virtual void render(int xm, int ym, float a);
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
};
|
||||
|
|
@ -15,9 +15,9 @@ private:
|
|||
|
||||
public:
|
||||
NameEntryScreen(Screen* lastScreen, const std::wstring& oldName, int slot);
|
||||
virtual void init();
|
||||
virtual void removed();
|
||||
virtual void tick();
|
||||
virtual void init() override;
|
||||
virtual void removed() override;
|
||||
virtual void tick() override;
|
||||
|
||||
protected:
|
||||
virtual void buttonClicked(Button button);
|
||||
|
|
@ -26,8 +26,8 @@ private:
|
|||
static const std::wstring allowedChars;
|
||||
|
||||
protected:
|
||||
virtual void keyPressed(wchar_t ch, int eventKey);
|
||||
virtual void keyPressed(wchar_t ch, int eventKey) override;
|
||||
|
||||
public:
|
||||
virtual void render(int xm, int ym, float a);
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
};
|
||||
|
|
@ -16,11 +16,11 @@ private:
|
|||
|
||||
public:
|
||||
OptionsScreen(Screen* lastScreen, Options* options);
|
||||
virtual void init();
|
||||
virtual void init() override;
|
||||
|
||||
protected:
|
||||
virtual void buttonClicked(Button* button);
|
||||
virtual void buttonClicked(Button* button) override;
|
||||
|
||||
public:
|
||||
virtual void render(int xm, int ym, float a);
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
};
|
||||
|
|
@ -8,15 +8,15 @@ private:
|
|||
|
||||
public:
|
||||
PauseScreen(); // 4J added
|
||||
virtual void init();
|
||||
virtual void init() override;
|
||||
static void exitWorld(Minecraft* minecraft, bool save);
|
||||
|
||||
protected:
|
||||
using Screen::buttonClicked;
|
||||
|
||||
virtual void buttonClicked(Button* button);
|
||||
virtual void buttonClicked(Button* button) override;
|
||||
|
||||
public:
|
||||
virtual void tick();
|
||||
virtual void render(int xm, int ym, float a);
|
||||
virtual void tick() override;
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,12 +16,12 @@ protected:
|
|||
virtual void keyPressed(char eventCharacter, int eventKey);
|
||||
|
||||
public:
|
||||
virtual void init();
|
||||
virtual void tick();
|
||||
virtual void init() override;
|
||||
virtual void tick() override;
|
||||
|
||||
protected:
|
||||
virtual void buttonClicked(Button* button);
|
||||
virtual void buttonClicked(Button* button) override;
|
||||
|
||||
public:
|
||||
virtual void render(int xm, int ym, float a);
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,15 +11,15 @@ private:
|
|||
|
||||
public:
|
||||
RenameWorldScreen(Screen* lastScreen, const std::wstring& levelId);
|
||||
virtual void tick();
|
||||
virtual void init();
|
||||
virtual void removed();
|
||||
virtual void tick() override;
|
||||
virtual void init() override;
|
||||
virtual void removed() override;
|
||||
|
||||
protected:
|
||||
virtual void buttonClicked(Button* button);
|
||||
virtual void keyPressed(wchar_t ch, int eventKey);
|
||||
virtual void mouseClicked(int x, int y, int buttonNum);
|
||||
virtual void buttonClicked(Button* button) override;
|
||||
virtual void keyPressed(wchar_t ch, int eventKey) override;
|
||||
virtual void mouseClicked(int x, int y, int buttonNum) override;
|
||||
|
||||
public:
|
||||
virtual void render(int xm, int ym, float a);
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
};
|
||||
|
|
@ -41,7 +41,7 @@ private:
|
|||
|
||||
public:
|
||||
SelectWorldScreen(Screen* lastScreen);
|
||||
virtual void init();
|
||||
virtual void init() override;
|
||||
|
||||
private:
|
||||
void loadLevelList();
|
||||
|
|
@ -54,12 +54,12 @@ public:
|
|||
virtual void postInit();
|
||||
|
||||
protected:
|
||||
virtual void buttonClicked(Button* button);
|
||||
virtual void buttonClicked(Button* button) override;
|
||||
|
||||
public:
|
||||
void worldSelected(int id);
|
||||
void confirmResult(bool result, int id);
|
||||
virtual void render(int xm, int ym, float a);
|
||||
void confirmResult(bool result, int id) override;
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
|
||||
class WorldSelectionList : public ScrolledSelectionList {
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -31,14 +31,14 @@ private:
|
|||
|
||||
public:
|
||||
StatsScreen(Screen* lastScreen, StatsCounter* stats);
|
||||
virtual void init();
|
||||
virtual void init() override;
|
||||
virtual void postInit();
|
||||
|
||||
protected:
|
||||
virtual void buttonClicked(Button* button);
|
||||
virtual void buttonClicked(Button* button) override;
|
||||
|
||||
public:
|
||||
virtual void render(int xm, int ym, float a);
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
|
||||
class GeneralStatisticsList : public ScrolledSelectionList {
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -13,19 +13,19 @@ private:
|
|||
|
||||
public:
|
||||
TextEditScreen(std::shared_ptr<SignTileEntity> sign);
|
||||
virtual void init();
|
||||
virtual void removed();
|
||||
virtual void tick();
|
||||
virtual void init() override;
|
||||
virtual void removed() override;
|
||||
virtual void tick() override;
|
||||
|
||||
protected:
|
||||
virtual void buttonClicked(Button* button);
|
||||
virtual void buttonClicked(Button* button) override;
|
||||
|
||||
private:
|
||||
static const std::wstring allowedChars;
|
||||
|
||||
protected:
|
||||
virtual void keyPressed(wchar_t ch, int eventKey);
|
||||
virtual void keyPressed(wchar_t ch, int eventKey) override;
|
||||
|
||||
public:
|
||||
virtual void render(int xm, int ym, float a);
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
};
|
||||
|
|
@ -33,17 +33,17 @@ private:
|
|||
|
||||
public:
|
||||
TitleScreen();
|
||||
virtual void tick();
|
||||
virtual void tick() override;
|
||||
|
||||
protected:
|
||||
virtual void keyPressed(wchar_t eventCharacter, int eventKey);
|
||||
virtual void keyPressed(wchar_t eventCharacter, int eventKey) override;
|
||||
|
||||
public:
|
||||
virtual void init();
|
||||
virtual void init() override;
|
||||
|
||||
protected:
|
||||
virtual void buttonClicked(Button* button);
|
||||
virtual void buttonClicked(Button* button) override;
|
||||
|
||||
public:
|
||||
virtual void render(int xm, int ym, float a);
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
};
|
||||
|
|
@ -14,11 +14,11 @@ private:
|
|||
|
||||
public:
|
||||
VideoSettingsScreen(Screen* lastScreen, Options* options);
|
||||
virtual void init();
|
||||
virtual void init() override;
|
||||
|
||||
protected:
|
||||
virtual void buttonClicked(Button* button);
|
||||
virtual void buttonClicked(Button* button) override;
|
||||
|
||||
public:
|
||||
virtual void render(int xm, int ym, float a);
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
};
|
||||
|
|
@ -16,10 +16,10 @@ public:
|
|||
const std::wstring& msg, float value);
|
||||
|
||||
protected:
|
||||
virtual int getYImage(bool hovered);
|
||||
virtual void renderBg(Minecraft* minecraft, int xm, int ym);
|
||||
virtual int getYImage(bool hovered) override;
|
||||
virtual void renderBg(Minecraft* minecraft, int xm, int ym) override;
|
||||
|
||||
public:
|
||||
virtual bool clicked(Minecraft* minecraft, int mx, int my);
|
||||
virtual void released(int mx, int my);
|
||||
virtual bool clicked(Minecraft* minecraft, int mx, int my) override;
|
||||
virtual void released(int mx, int my) override;
|
||||
};
|
||||
|
|
@ -11,6 +11,6 @@ private:
|
|||
|
||||
public:
|
||||
RepairContainer(AnvilMenu* menu, int name, bool customName, int size);
|
||||
void setChanged();
|
||||
bool canPlaceItem(int slot, std::shared_ptr<ItemInstance> item);
|
||||
void setChanged() override;
|
||||
bool canPlaceItem(int slot, std::shared_ptr<ItemInstance> item) override;
|
||||
};
|
||||
|
|
@ -14,9 +14,9 @@ public:
|
|||
std::shared_ptr<Container> container, int slot, int x,
|
||||
int y);
|
||||
|
||||
bool mayPlace(std::shared_ptr<ItemInstance> item);
|
||||
bool mayPickup(std::shared_ptr<Player> player);
|
||||
bool mayPlace(std::shared_ptr<ItemInstance> item) override;
|
||||
bool mayPickup(std::shared_ptr<Player> player) override;
|
||||
void onTake(std::shared_ptr<Player> player,
|
||||
std::shared_ptr<ItemInstance> carried);
|
||||
virtual bool mayCombine(std::shared_ptr<ItemInstance> item); // 4J Added
|
||||
std::shared_ptr<ItemInstance> carried) override;
|
||||
virtual bool mayCombine(std::shared_ptr<ItemInstance> item) override; // 4J Added
|
||||
};
|
||||
|
|
@ -10,19 +10,19 @@ public:
|
|||
// 4J Stu Added a ctor to init items
|
||||
ResultContainer();
|
||||
|
||||
virtual unsigned int getContainerSize();
|
||||
virtual std::shared_ptr<ItemInstance> getItem(unsigned int slot);
|
||||
virtual std::wstring getName();
|
||||
virtual std::wstring getCustomName();
|
||||
virtual bool hasCustomName();
|
||||
virtual unsigned int getContainerSize() override;
|
||||
virtual std::shared_ptr<ItemInstance> getItem(unsigned int slot) override;
|
||||
virtual std::wstring getName() override;
|
||||
virtual std::wstring getCustomName() override;
|
||||
virtual bool hasCustomName() override;
|
||||
virtual std::shared_ptr<ItemInstance> removeItem(unsigned int slot,
|
||||
int count);
|
||||
virtual std::shared_ptr<ItemInstance> removeItemNoUpdate(int slot);
|
||||
virtual void setItem(unsigned int slot, std::shared_ptr<ItemInstance> item);
|
||||
virtual int getMaxStackSize();
|
||||
virtual void setChanged();
|
||||
virtual bool stillValid(std::shared_ptr<Player> player);
|
||||
virtual void startOpen() {} // TODO Auto-generated method stub
|
||||
virtual void stopOpen() {} // TODO Auto-generated method stub
|
||||
virtual bool canPlaceItem(int slot, std::shared_ptr<ItemInstance> item);
|
||||
int count) override;
|
||||
virtual std::shared_ptr<ItemInstance> removeItemNoUpdate(int slot) override;
|
||||
virtual void setItem(unsigned int slot, std::shared_ptr<ItemInstance> item) override;
|
||||
virtual int getMaxStackSize() override;
|
||||
virtual void setChanged() override;
|
||||
virtual bool stillValid(std::shared_ptr<Player> player) override;
|
||||
virtual void startOpen() override {} // TODO Auto-generated method stub
|
||||
virtual void stopOpen() override {} // TODO Auto-generated method stub
|
||||
virtual bool canPlaceItem(int slot, std::shared_ptr<ItemInstance> item) override;
|
||||
};
|
||||
|
|
@ -14,15 +14,15 @@ public:
|
|||
std::shared_ptr<Container> container, int id, int x, int y);
|
||||
virtual ~ResultSlot() {}
|
||||
|
||||
virtual bool mayPlace(std::shared_ptr<ItemInstance> item);
|
||||
virtual std::shared_ptr<ItemInstance> remove(int c);
|
||||
virtual bool mayPlace(std::shared_ptr<ItemInstance> item) override;
|
||||
virtual std::shared_ptr<ItemInstance> remove(int c) override;
|
||||
|
||||
protected:
|
||||
virtual void onQuickCraft(std::shared_ptr<ItemInstance> picked, int count);
|
||||
virtual void checkTakeAchievements(std::shared_ptr<ItemInstance> carried);
|
||||
virtual void onQuickCraft(std::shared_ptr<ItemInstance> picked, int count) override;
|
||||
virtual void checkTakeAchievements(std::shared_ptr<ItemInstance> carried) override;
|
||||
|
||||
public:
|
||||
virtual void onTake(std::shared_ptr<Player> player,
|
||||
std::shared_ptr<ItemInstance> carried);
|
||||
virtual bool mayCombine(std::shared_ptr<ItemInstance> item); // 4J Added
|
||||
std::shared_ptr<ItemInstance> carried) override;
|
||||
virtual bool mayCombine(std::shared_ptr<ItemInstance> item) override; // 4J Added
|
||||
};
|
||||
|
|
@ -19,20 +19,20 @@ public:
|
|||
virtual void addListener(net_minecraft_world::ContainerListener* listener);
|
||||
virtual void removeListener(
|
||||
net_minecraft_world::ContainerListener* listener);
|
||||
virtual std::shared_ptr<ItemInstance> getItem(unsigned int slot);
|
||||
virtual std::shared_ptr<ItemInstance> getItem(unsigned int slot) override;
|
||||
virtual std::shared_ptr<ItemInstance> removeItem(unsigned int slot,
|
||||
int count);
|
||||
virtual std::shared_ptr<ItemInstance> removeItemNoUpdate(int slot);
|
||||
virtual void setItem(unsigned int slot, std::shared_ptr<ItemInstance> item);
|
||||
virtual unsigned int getContainerSize();
|
||||
virtual std::wstring getName();
|
||||
virtual std::wstring getCustomName();
|
||||
virtual bool hasCustomName();
|
||||
int count) override;
|
||||
virtual std::shared_ptr<ItemInstance> removeItemNoUpdate(int slot) override;
|
||||
virtual void setItem(unsigned int slot, std::shared_ptr<ItemInstance> item) override;
|
||||
virtual unsigned int getContainerSize() override;
|
||||
virtual std::wstring getName() override;
|
||||
virtual std::wstring getCustomName() override;
|
||||
virtual bool hasCustomName() override;
|
||||
virtual void setCustomName(const std::wstring& name);
|
||||
virtual int getMaxStackSize();
|
||||
virtual void setChanged();
|
||||
virtual bool stillValid(std::shared_ptr<Player> player);
|
||||
virtual void startOpen() {} // TODO Auto-generated method stub
|
||||
virtual void stopOpen() {} // TODO Auto-generated method stub
|
||||
virtual bool canPlaceItem(int slot, std::shared_ptr<ItemInstance> item);
|
||||
virtual int getMaxStackSize() override;
|
||||
virtual void setChanged() override;
|
||||
virtual bool stillValid(std::shared_ptr<Player> player) override;
|
||||
virtual void startOpen() override {} // TODO Auto-generated method stub
|
||||
virtual void stopOpen() override {} // TODO Auto-generated method stub
|
||||
virtual bool canPlaceItem(int slot, std::shared_ptr<ItemInstance> item) override;
|
||||
};
|
||||
|
|
@ -18,7 +18,7 @@ public:
|
|||
TrapMenu(std::shared_ptr<Container> inventory,
|
||||
std::shared_ptr<DispenserTileEntity> trap);
|
||||
|
||||
virtual bool stillValid(std::shared_ptr<Player> player);
|
||||
virtual bool stillValid(std::shared_ptr<Player> player) override;
|
||||
virtual std::shared_ptr<ItemInstance> quickMoveStack(
|
||||
std::shared_ptr<Player> player, int slotIndex);
|
||||
std::shared_ptr<Player> player, int slotIndex) override;
|
||||
};
|
||||
Loading…
Reference in a new issue