mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-28 18:54:11 +00:00
fix: rebase issue with CreativeInventoryScreen
This commit is contained in:
parent
3653b7b465
commit
a856a7e54e
|
|
@ -2,9 +2,9 @@
|
|||
#include <cstddef>
|
||||
#include "GuiComponent.h"
|
||||
#include "GuiMessage.h"
|
||||
#include "../../../Minecraft.Client/Rendering/EntityRenderers/ItemRenderer.h"
|
||||
class Random;
|
||||
class Minecraft;
|
||||
class ItemRenderer;
|
||||
|
||||
class Gui : public GuiComponent {
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ CreativeInventoryScreen::ContainerCreative::ContainerCreative(
|
|||
}
|
||||
|
||||
// Add hotbar slots (9 slots at bottom)
|
||||
for (int k = 0; k < 9; k++) {
|
||||
for (int k = 0; k < 9; ++k) {
|
||||
addSlot(new Slot(inventoryplayer, k, 9 + k * 18, 112));
|
||||
}
|
||||
|
||||
|
|
@ -181,8 +181,8 @@ void CreativeInventoryScreen::ContainerCreative::scrollTo(float pos) {
|
|||
j = 0;
|
||||
}
|
||||
|
||||
for (int k = 0; k < ROWS; k++) {
|
||||
for (int l = 0; l < COLUMNS; l++) {
|
||||
for (int k = 0; k < ROWS; ++k) {
|
||||
for (int l = 0; l < COLUMNS; ++l) {
|
||||
int i1 = l + (k + j) * COLUMNS;
|
||||
|
||||
if (i1 >= 0 && i1 < (int)itemList.size()) {
|
||||
|
|
@ -484,7 +484,7 @@ void CreativeInventoryScreen::setCurrentCreativeTab(int tab) {
|
|||
IUIScene_CreativeMenu::specs[tab];
|
||||
|
||||
// Add items from static groups
|
||||
for (int i = 0; i < spec->m_staticGroupsCount; i++) {
|
||||
for (int i = 0; i < spec->m_staticGroupsCount; ++i) {
|
||||
int groupIdx = spec->m_staticGroupsA[i];
|
||||
if (groupIdx >= 0 &&
|
||||
groupIdx <
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@ private:
|
|||
static int selectedTabIndex;
|
||||
|
||||
// Array of item ids for the tab icons
|
||||
static int tabIconIds[IUIScene_CreativeMenu::eCreativeInventoryTab_COUNT];
|
||||
static const int
|
||||
tabIconIds[IUIScene_CreativeMenu::eCreativeInventoryTab_COUNT];
|
||||
|
||||
// Temporary inventory for creative mode items
|
||||
static std::shared_ptr<SimpleContainer> basicInventory;
|
||||
|
|
@ -60,23 +61,29 @@ public:
|
|||
};
|
||||
|
||||
public:
|
||||
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;
|
||||
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() override;
|
||||
virtual void renderBg(float a) override;
|
||||
virtual void renderLabels() override;
|
||||
virtual void renderBg(float a) override;
|
||||
virtual bool isMouseOverInternal(int tab, int mouseX, int mouseY, int xo,
|
||||
int yo, int w, int h);
|
||||
|
||||
private:
|
||||
void setCurrentCreativeTab(int tab);
|
||||
void selectTab(int tab);
|
||||
bool needsScrollBars();
|
||||
bool isMouseOverTab(int tab, int mouseX, int mouseY);
|
||||
void drawTab(int tab);
|
||||
};
|
||||
bool isMouseOverIcon(int tab, int mouseX, int mouseY);
|
||||
void renderTab(int tab);
|
||||
bool renderIconTooltip(int tab, int mouseX, int mouseY);
|
||||
};
|
||||
Loading…
Reference in a new issue