mirror of
https://git.neolegacy.dev/neoStudiosLCE/neoLegacy.git
synced 2026-11-25 00:11:05 +01:00
Patch Notes: Blocks + Colored shulker boxes + Concrete powder + Concrete + Glazed terracotta Items + Shulker shell + Iron nugget UI Changes + Added Custom Controls to Keyboard & Mouse, as well as Controller + Added Custom SuperFlat + Added Edit Server Menu + Added Firework Crafting Feature Changes + Host Options + Added Pick Block + Added off-hand slot for maps and arrows. Bug Fixes & changes + TU47: Banner hitbox wrong (and inventory model fixed) + TU47/48: Ice not melting properly + TU48: Dead bushes not dropping sticks + TU48: Guardians and polar bears not dropping cooked fish when on fire + TU48: Bonus chest missing saplings and seeds + TU48: Frosted ice obtainable + TU48: Hoppers not collecting items + TU48: Wither skeletons spawning in 2-high gaps + TU48: End crystals exploding with “TNT Explodes” off + TU48: Tamed ocelots staying hostile + TU48: Signs not placing on tall grass + TU51: Skeleton hitbox wrong + TU53: Fall damage in shallow water + TU53: Squids not spawning in man-made pools + Elytra has been improved to be more accurate to the source material + Removed Spectral Arrow from crafting + Fixed several broken item descriptions + You can no longer cook Pufferfish or Clownfish + Fixed scaling issue with paperdoll and chat + Iron and gold armor can now be smelted into nuggets. + More items can now be used as fuel in a furnace. + Using a firework rocket while gliding with elytra will now give the player a boost. + Changed the color of dyes, wool, carpets, and banners. + Reordered all colored blocks and items in the Creative inventory. Banners now have the same order of colors as all other colored blocks and items. + Fishing rods can now hook on entities without causing knockback or pseudo-damage. + Fixed banner crafting + Fixed Map colors for certain blocks + Fixed Path block height + Fixed String block issues + Fixed Item frame culling. + Fixed Tutorial world NBT/Block State issues + Fixed World Slider + Fixed Enderman AI + Fixed Player animation bug + HUD Flash text changes + Generation accuracy changes + Many other small accuracy changes and fixes
260 lines
8.7 KiB
C++
260 lines
8.7 KiB
C++
#pragma once
|
|
#include "../../../Minecraft.World/Recipy.h"
|
|
#include "../../../Minecraft.World/Item.h"
|
|
#include "../../../Minecraft.World/BannerPatternRecipe.h"
|
|
|
|
class LocalPlayer;
|
|
class CraftingContainer;
|
|
|
|
class IUIScene_CraftingMenu
|
|
{
|
|
public:
|
|
typedef struct _PreviewBannerData { char id = 0; char color = 0; _PreviewBannerData(char _id, char _color) : id(_id), color(_color) {} } PreviewBannerData;
|
|
protected:
|
|
#define DISPLAY_INVENTORY 0
|
|
#define DISPLAY_DESCRIPTION 1
|
|
#define DISPLAY_INGREDIENTS 2
|
|
#define DISPLAY_PREVIEW 3
|
|
#define DISPLAY_MAX 4
|
|
|
|
enum _eGroupTab
|
|
{
|
|
eGroupTab_Left,
|
|
eGroupTab_Middle,
|
|
eGroupTab_Right
|
|
};
|
|
|
|
enum eGroupVType {
|
|
eGroupVType_Workbench = 0,
|
|
eGroupVType_Banner = 1,
|
|
eGroupVType_Firework = 2,
|
|
};
|
|
|
|
static const int m_iMaxHSlotC = 40;
|
|
static const int m_iMaxHCraftingSlotC = 40;
|
|
static const int m_iMaxVSlotC = 99;
|
|
static const int m_iMaxDisplayedVSlotC = 3;
|
|
static const int m_iIngredients3x3SlotC = 9;
|
|
static const int m_iIngredients2x2SlotC = 4;
|
|
|
|
static const int m_iMaxHSlot = 12;
|
|
|
|
static const int m_iMaxGroupH3x3 = 7;
|
|
static const int m_iMaxGroupH2x2 = 6;
|
|
|
|
static const int m_iMaxGroupV = 3;
|
|
|
|
static const int m_iMaxSpecialRecipeIngredients = 9;
|
|
static const int m_iMaxSpecialColumnRecipes = 32;
|
|
static const int m_iMaxBannerPatterns = 6;
|
|
|
|
static int m_iBaseTypeMapA[Item::eBaseItemType_MAXTYPES];
|
|
|
|
typedef struct
|
|
{
|
|
int iCount;
|
|
int iItemBaseType;
|
|
int iRecipeA[m_iMaxVSlotC];
|
|
}
|
|
CANBEMADE;
|
|
|
|
CANBEMADE CanBeMadeA[m_iMaxHSlotC];
|
|
|
|
struct SpecialRecipe
|
|
{
|
|
int group;
|
|
int key;
|
|
int patternIndex;
|
|
int dye;
|
|
int recipeIndex;
|
|
bool needs3x3;
|
|
unsigned int grid[9];
|
|
int ingC;
|
|
int ingId[m_iMaxSpecialRecipeIngredients];
|
|
int ingAux[m_iMaxSpecialRecipeIngredients];
|
|
int ingCount[m_iMaxSpecialRecipeIngredients];
|
|
bool available;
|
|
unsigned short missingMask;
|
|
shared_ptr<ItemInstance> result;
|
|
};
|
|
|
|
struct SpecialColumn
|
|
{
|
|
int key;
|
|
int count;
|
|
int recipes[m_iMaxSpecialColumnRecipes];
|
|
};
|
|
|
|
int m_iCurrentSlotHIndex;
|
|
int m_iCurrentSlotVIndex;
|
|
int m_iRecipeC;
|
|
int m_iContainerType;
|
|
shared_ptr<LocalPlayer> m_pPlayer;
|
|
|
|
int m_iGroupHIndex;
|
|
int m_iGroupVIndex;
|
|
|
|
int iVSlotIndexA[3];
|
|
int iHSlotState[7];
|
|
|
|
static LPCWSTR m_GroupIconNameA[m_iMaxGroupH3x3];
|
|
static Recipy::_eGroupType m_GroupTypeMapping4GridA[m_iMaxGroupH2x2];
|
|
static Recipy::_eGroupType m_GroupTypeMapping9GridA[m_iMaxGroupH3x3];
|
|
Recipy::_eGroupType* m_pGroupA;
|
|
|
|
static LPCWSTR m_GroupTabNameA[3];
|
|
static _eGroupTab m_GroupTabBkgMapping2x2A[m_iMaxGroupH2x2];
|
|
static _eGroupTab m_GroupTabBkgMapping3x3A[m_iMaxGroupH3x3];
|
|
_eGroupTab *m_pGroupTabA;
|
|
int m_iCraftablesMaxHSlotC;
|
|
int m_iIngredientsMaxSlotC;
|
|
int m_iDisplayDescription;
|
|
int m_iIngredientsC;
|
|
bool m_bIgnoreKeyPresses;
|
|
bool m_bSplitscreen;
|
|
|
|
eTutorial_State m_previousTutorialState;
|
|
|
|
vector<SpecialRecipe> m_specialRecipes;
|
|
SpecialColumn m_specialColumns[m_iMaxHSlot];
|
|
int m_iSpecialColumnC;
|
|
int m_iSpecialHSlotC;
|
|
int m_iSpecialGroupC;
|
|
|
|
vector<int> m_baseItemSlots;
|
|
vector<pair<int, bool> > m_duplicateItemSlots;
|
|
shared_ptr<ItemInstance> m_baseRecipeItem;
|
|
shared_ptr<ItemInstance> m_accumulatedItem;
|
|
vector<int> m_stackedRecipes;
|
|
int m_iBaseCreateRecipe;
|
|
int m_iBaseCopySlot;
|
|
bool m_bBaseFromInventory;
|
|
|
|
vector<pair<shared_ptr<ItemInstance>, bool> > m_customRecipes[3];
|
|
vector<shared_ptr<ItemInstance> > m_recipeIngredients;
|
|
shared_ptr<ItemInstance> m_customGridItems[9];
|
|
vector<int> m_customIngredientSlots;
|
|
int m_customRecipeSlots[3];
|
|
bool m_customRecipeValid;
|
|
bool m_hasGunpowder;
|
|
int m_iSpecialIngredientCount;
|
|
shared_ptr<CraftingContainer> m_craftingContainer;
|
|
|
|
bool handleKeyDown(int iPad, int iAction, bool bRepeat);
|
|
|
|
public:
|
|
IUIScene_CraftingMenu();
|
|
~IUIScene_CraftingMenu() {}
|
|
|
|
protected:
|
|
LPCWSTR GetGroupNameText(int iGroupType);
|
|
|
|
void CheckRecipesAvailable();
|
|
void UpdateHighlight();
|
|
void UpdateVerticalSlots();
|
|
void DisplayIngredients();
|
|
void UpdateTooltips();
|
|
void UpdateDescriptionText(bool);
|
|
void HandleInventoryUpdated();
|
|
|
|
bool isSpecialTab() const { return m_iGroupVIndex != eGroupVType_Workbench; }
|
|
bool isSpinnerGroup() const;
|
|
bool isInventoryItem() const;
|
|
bool isDuplicateItem() const;
|
|
bool isCustomRecipe() const { return m_iGroupVIndex == eGroupVType_Firework; }
|
|
bool isCraftAnything() const;
|
|
int getMaxVGroups() const { return m_iMaxGroupV; }
|
|
int getNumSpinnerSlots() const;
|
|
int getSpecialGroupCount() const;
|
|
int getSpecialVSlotCount() const;
|
|
int getSpecialSelection() const;
|
|
const wchar_t* getSpecialGroupName(int group) const;
|
|
const wchar_t* getSpinnerTitle() const;
|
|
|
|
void Special_EnterTab();
|
|
void Special_EnterGroup();
|
|
void Special_BuildRecipes();
|
|
void Special_BuildBannerRecipes();
|
|
void Special_BuildFireworkRecipes();
|
|
void Special_RefreshBaseItemSlots(shared_ptr<ItemInstance> keepSelected);
|
|
void Special_CheckRecipesAvailable();
|
|
void Special_UpdateHorizontalSlots();
|
|
void Special_UpdateVerticalSlots();
|
|
void Special_UpdateHighlight();
|
|
void Special_DisplayIngredients();
|
|
void Special_DisplayCustomRecipeIngredients();
|
|
void Special_UpdateTooltips();
|
|
void Special_UpdateDescriptionText();
|
|
bool Special_HandleKeyDown(int iPad, int iAction, bool bRepeat);
|
|
void Special_ResetVerticalSlots();
|
|
void Special_ChangeGroup(int direction);
|
|
void Special_ScrollHorizontal(int direction);
|
|
void Special_ScrollVertical(int direction);
|
|
void Special_Craft();
|
|
bool Special_AddStackedRecipe();
|
|
void Special_RemoveStackedRecipe();
|
|
void Special_ClearBase();
|
|
void Special_UpdateAccumulatedItem();
|
|
bool Special_CanAddMoreStacks() const;
|
|
int Special_GetBannerPatternCount(shared_ptr<ItemInstance> banner) const;
|
|
int Special_GetSelectedRecipe() const;
|
|
int Special_GetUsedCount(int id, int aux) const;
|
|
int Special_GetInventoryCount(int id, int aux) const;
|
|
void Special_ComputeAvailability(SpecialRecipe& recipe) const;
|
|
shared_ptr<ItemInstance> Special_GetSpinnerItem(int spinner, int slot, bool& enabled) const;
|
|
shared_ptr<ItemInstance> Special_GetBaseItemSlot(int column, int slot, bool& enabled) const;
|
|
bool Special_IsValidCustomIngredient(int index, shared_ptr<ItemInstance> item) const;
|
|
bool Special_CanAddCustomIngredient(shared_ptr<ItemInstance> item) const;
|
|
void Special_AddCustomIngredient(shared_ptr<ItemInstance> item);
|
|
void Special_RemoveLastCustomIngredient();
|
|
void Special_ClearCustomIngredients();
|
|
int Special_GetCustomIngredientCount(shared_ptr<ItemInstance> item) const;
|
|
shared_ptr<ItemInstance> Special_GetFireworkResult();
|
|
void Special_UpdateTabs();
|
|
void Special_RemoveFromLocalInventory(int id, int aux, int count);
|
|
bool Special_RemoveMatchingFromLocalInventory(shared_ptr<ItemInstance> item);
|
|
void Special_GiveLocalItem(shared_ptr<ItemInstance> item);
|
|
|
|
public:
|
|
Recipy::_eGroupType getCurrentGroup() { return isSpecialTab() ? Recipy::eGroupType_Max : m_pGroupA[m_iGroupHIndex]; }
|
|
bool isItemSelected(int itemId);
|
|
|
|
protected:
|
|
virtual int getPad() = 0;
|
|
virtual void hideAllHSlots() = 0;
|
|
virtual void hideAllVSlots() = 0;
|
|
virtual void hideAllIngredientsSlots() = 0;
|
|
virtual void setCraftHSlotItem(int iPad, int iIndex, shared_ptr<ItemInstance> item, unsigned int uiAlpha) = 0;
|
|
virtual void setCraftVSlotItem(int iPad, int iIndex, shared_ptr<ItemInstance> item, unsigned int uiAlpha) = 0;
|
|
virtual void setCraftingOutputSlotItem(int iPad, shared_ptr<ItemInstance> item) = 0;
|
|
virtual void setCraftingOutputSlotRedBox(bool show) = 0;
|
|
virtual void setIngredientSlotItem(int iPad, int index, shared_ptr<ItemInstance> item) = 0;
|
|
virtual void setIngredientSlotRedBox(int index, bool show) = 0;
|
|
virtual void setIngredientDescriptionItem(int iPad, int index, shared_ptr<ItemInstance> item) = 0;
|
|
virtual void setIngredientDescriptionRedBox(int index, bool show) = 0;
|
|
virtual void setIngredientDescriptionText(int index, LPCWSTR text) = 0;
|
|
virtual void setShowCraftHSlot(int iIndex, bool show) = 0;
|
|
virtual void setHGroupHighlight(int iIndex) = 0;
|
|
virtual void setVGroupHighlight(int iIndex) = 0;
|
|
virtual void setGroupText(LPCWSTR text) = 0;
|
|
virtual void setDescriptionText(LPCWSTR text) = 0;
|
|
virtual void setDescriptionTextTop(LPCWSTR text) = 0;
|
|
virtual void setItemText(LPCWSTR text) = 0;
|
|
virtual void scrollDescriptionUp() = 0;
|
|
virtual void scrollDescriptionDown() = 0;
|
|
virtual void updateHighlightAndScrollPositions() = 0;
|
|
virtual void updateVSlotPositions(int iSlots, int i) = 0;
|
|
virtual void UpdateCraftingPanels() = 0;
|
|
virtual void UpdateMultiPanel() = 0;
|
|
|
|
virtual void setSpecialSlotItem(int iIndex, shared_ptr<ItemInstance> item, unsigned int uiAlpha) = 0;
|
|
virtual void clearSpecialSlots() = 0;
|
|
virtual void setPreviewSlotItem(shared_ptr<ItemInstance> item) = 0;
|
|
virtual void setSpinnerTitle(LPCWSTR text) = 0;
|
|
virtual void setHTabItem(int iIndex, shared_ptr<ItemInstance> item) = 0;
|
|
virtual void EnableTab(int iIndex, bool enabled) = 0;
|
|
virtual void ShowSuperCraftingSlots(int iIndex) = 0;
|
|
virtual void ShowDescriptionPanel(bool show) = 0;
|
|
virtual void SetCraftingMenu() = 0;
|
|
};
|