diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index 3c4a0c2f..1a680f5b 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -557,12 +557,12 @@ bool CMinecraftApp::LoadCrafting2x2Menu(int iPad,shared_ptr player) if(app.GetLocalPlayerCount()>1) { initData->bSplitscreen=true; - success = ui.NavigateToScene(iPad,eUIScene_Crafting2x2Menu, initData); + success = ui.NavigateToScene(iPad,eUIScene_CraftingMenu, initData); } else { initData->bSplitscreen=false; - success = ui.NavigateToScene(iPad,eUIScene_Crafting2x2Menu, initData); + success = ui.NavigateToScene(iPad,eUIScene_CraftingMenu, initData); } return success; @@ -588,7 +588,7 @@ bool CMinecraftApp::LoadCrafting3x3Menu(int iPad,shared_ptr player, if (app.GetGameSettings(iPad, eGameSetting_ClassicCrafting)) success = ui.NavigateToScene(iPad, eUIScene_ClassicCraftingMenu, initData); else - success = ui.NavigateToScene(iPad, eUIScene_Crafting3x3Menu, initData); + success = ui.NavigateToScene(iPad, eUIScene_CraftingMenu, initData); return success; } diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Crafting2x2Menu1080.swf b/Minecraft.Client/Common/Media/MediaWindows64/Crafting2x2Menu1080.swf deleted file mode 100644 index e462de70..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/Crafting2x2Menu1080.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Crafting2x2Menu480.swf b/Minecraft.Client/Common/Media/MediaWindows64/Crafting2x2Menu480.swf deleted file mode 100644 index 0a6047d9..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/Crafting2x2Menu480.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Crafting2x2Menu720.swf b/Minecraft.Client/Common/Media/MediaWindows64/Crafting2x2Menu720.swf deleted file mode 100644 index 6a2a0aae..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/Crafting2x2Menu720.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Crafting2x2MenuSplit1080.swf b/Minecraft.Client/Common/Media/MediaWindows64/Crafting2x2MenuSplit1080.swf deleted file mode 100644 index 5e427387..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/Crafting2x2MenuSplit1080.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Crafting2x2MenuSplit720.swf b/Minecraft.Client/Common/Media/MediaWindows64/Crafting2x2MenuSplit720.swf deleted file mode 100644 index a50730af..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/Crafting2x2MenuSplit720.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Crafting2x2MenuVita.swf b/Minecraft.Client/Common/Media/MediaWindows64/Crafting2x2MenuVita.swf deleted file mode 100644 index 27a0b580..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/Crafting2x2MenuVita.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Crafting3x3Menu1080.swf b/Minecraft.Client/Common/Media/MediaWindows64/Crafting3x3Menu1080.swf deleted file mode 100644 index 4d4d4255..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/Crafting3x3Menu1080.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Crafting3x3Menu480.swf b/Minecraft.Client/Common/Media/MediaWindows64/Crafting3x3Menu480.swf deleted file mode 100644 index 00f03d75..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/Crafting3x3Menu480.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Crafting3x3Menu720.swf b/Minecraft.Client/Common/Media/MediaWindows64/Crafting3x3Menu720.swf deleted file mode 100644 index e7888d13..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/Crafting3x3Menu720.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Crafting3x3MenuSplit1080.swf b/Minecraft.Client/Common/Media/MediaWindows64/Crafting3x3MenuSplit1080.swf deleted file mode 100644 index 155db47e..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/Crafting3x3MenuSplit1080.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Crafting3x3MenuSplit720.swf b/Minecraft.Client/Common/Media/MediaWindows64/Crafting3x3MenuSplit720.swf deleted file mode 100644 index f2224ec8..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/Crafting3x3MenuSplit720.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Crafting3x3MenuVita.swf b/Minecraft.Client/Common/Media/MediaWindows64/Crafting3x3MenuVita.swf deleted file mode 100644 index 09a25f7e..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/Crafting3x3MenuVita.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/CraftingMenu480.swf b/Minecraft.Client/Common/Media/MediaWindows64/CraftingMenu480.swf new file mode 100644 index 00000000..fc67ab7c Binary files /dev/null and b/Minecraft.Client/Common/Media/MediaWindows64/CraftingMenu480.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/CraftingMenu720.swf b/Minecraft.Client/Common/Media/MediaWindows64/CraftingMenu720.swf index 8fe77af3..91a9e1dd 100644 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/CraftingMenu720.swf and b/Minecraft.Client/Common/Media/MediaWindows64/CraftingMenu720.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/CraftingMenuSplit720.swf b/Minecraft.Client/Common/Media/MediaWindows64/CraftingMenuSplit720.swf index 8c9b8964..2845b9cf 100644 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/CraftingMenuSplit720.swf and b/Minecraft.Client/Common/Media/MediaWindows64/CraftingMenuSplit720.swf differ diff --git a/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.cpp index ba638346..9f2d16dc 100644 --- a/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.cpp @@ -8,7 +8,7 @@ #include "UI.h" -Recipy::_eGroupType IUIScene_CraftingMenu::m_GroupTypeMapping4GridA[IUIScene_CraftingMenu::m_iMaxGroup2x2]= +Recipy::_eGroupType IUIScene_CraftingMenu::m_GroupTypeMapping4GridA[IUIScene_CraftingMenu::m_iMaxGroupH2x2]= { Recipy::eGroupType_Structure, Recipy::eGroupType_Tool, @@ -18,7 +18,7 @@ Recipy::_eGroupType IUIScene_CraftingMenu::m_GroupTypeMapping4GridA[IUIScene_Cra Recipy::eGroupType_Decoration, }; -Recipy::_eGroupType IUIScene_CraftingMenu::m_GroupTypeMapping9GridA[IUIScene_CraftingMenu::m_iMaxGroup3x3]= +Recipy::_eGroupType IUIScene_CraftingMenu::m_GroupTypeMapping9GridA[IUIScene_CraftingMenu::m_iMaxGroupH3x3]= { Recipy::eGroupType_Structure, Recipy::eGroupType_Tool, @@ -29,8 +29,18 @@ Recipy::_eGroupType IUIScene_CraftingMenu::m_GroupTypeMapping9GridA[IUIScene_Cra Recipy::eGroupType_Decoration, }; +Recipy::_eGroupType IUIScene_CraftingMenu::m_GroupTypeBannerMapping4GridA[m_iMaxBannerGroupH2x2] = +{ + Recipy::eGroupType_Banner_CustomLogic, +}; -LPCWSTR IUIScene_CraftingMenu::m_GroupIconNameA[m_iMaxGroup3x3]= +Recipy::_eGroupType IUIScene_CraftingMenu::m_GroupTypeBannerMapping9GridA[m_iMaxBannerGroupH3x3] = +{ + Recipy::eGroupType_Banner_CustomLogic, +}; + + +LPCWSTR IUIScene_CraftingMenu::m_GroupIconNameA[m_iMaxGroupH3x3]= { L"Structures",//Recipy::eGroupType_Structure, L"Tools",//Recipy::eGroupType_Tool, @@ -41,7 +51,7 @@ LPCWSTR IUIScene_CraftingMenu::m_GroupIconNameA[m_iMaxGroup3x3]= L"Decoration",//Recipy::eGroupType_Decoration, }; -IUIScene_CraftingMenu::_eGroupTab IUIScene_CraftingMenu::m_GroupTabBkgMapping2x2A[m_iMaxGroup2x2]= +IUIScene_CraftingMenu::_eGroupTab IUIScene_CraftingMenu::m_GroupTabBkgMapping2x2A[m_iMaxGroupH2x2]= { eGroupTab_Left, eGroupTab_Middle, @@ -51,7 +61,7 @@ IUIScene_CraftingMenu::_eGroupTab IUIScene_CraftingMenu::m_GroupTabBkgMapping2x2 eGroupTab_Right, }; -IUIScene_CraftingMenu::_eGroupTab IUIScene_CraftingMenu::m_GroupTabBkgMapping3x3A[m_iMaxGroup3x3]= +IUIScene_CraftingMenu::_eGroupTab IUIScene_CraftingMenu::m_GroupTabBkgMapping3x3A[m_iMaxGroupH3x3]= { eGroupTab_Left, eGroupTab_Middle, @@ -109,7 +119,8 @@ IUIScene_CraftingMenu::IUIScene_CraftingMenu() } memset(CanBeMadeA,0,sizeof(CANBEMADE)*m_iMaxHSlotC); m_iRecipeC=0; - m_iGroupIndex=0; + m_iGroupHIndex = 0; + m_iGroupVIndex=0; for(int i=0;igetGroup()!=m_pGroupA[m_iGroupIndex]) + if(r->getGroup()!=m_pGroupA[m_iGroupVIndex][m_iGroupHIndex]) { itRecipe++; pRecipeIngredientsRequired[i].bCanMake[getPad()]=false; diff --git a/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.h b/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.h index a8761eab..2e6a0134 100644 --- a/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.h +++ b/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.h @@ -11,7 +11,8 @@ protected: #define DISPLAY_INVENTORY 0 #define DISPLAY_DESCRIPTION 1 #define DISPLAY_INGREDIENTS 2 -#define DISPLAY_MAX 3 +#define DISPLAY_PREVIEW 3 +#define DISPLAY_MAX 4 enum _eGroupTab { @@ -20,6 +21,13 @@ protected: eGroupTab_Right }; + enum eGroupVType { + eGroupVType_Workbench = 0, + eGroupVType_Banner = 1, + eGroupVType_Firework = 2, + eGroupVType_Dye = 3, + }; + static const int m_iMaxHSlotC = 40; static const int m_iMaxHCraftingSlotC = 40; static const int m_iMaxVSlotC = 99; @@ -27,11 +35,16 @@ protected: static const int m_iIngredients3x3SlotC = 9; static const int m_iIngredients2x2SlotC = 4; - static const int m_iMaxHSlot3x3C = 12; - static const int m_iMaxHSlot2x2C = 10; + static const int m_iMaxHSlot = 12; - static const int m_iMaxGroup3x3 = 7; - static const int m_iMaxGroup2x2 = 6; + static const int m_iMaxGroupH3x3 = 7; + static const int m_iMaxGroupH2x2 = 6; + + static const int m_iMaxGroupV2x2 = 4; + static const int m_iMaxGroupV3x3 = 4; + + static const int m_iMaxBannerGroupH3x3 = 6; + static const int m_iMaxBannerGroupH2x2 = 6; static int m_iBaseTypeMapA[Item::eBaseItemType_MAXTYPES]; @@ -50,18 +63,22 @@ protected: int m_iRecipeC; int m_iContainerType; // 2x2 or 3x3 shared_ptr m_pPlayer; - int m_iGroupIndex; + + int m_iGroupHIndex; + int m_iGroupVIndex; int iVSlotIndexA[3]; // index of the v slots currently displayed - static LPCWSTR m_GroupIconNameA[m_iMaxGroup3x3]; - static Recipy::_eGroupType m_GroupTypeMapping4GridA[m_iMaxGroup2x2]; - static Recipy::_eGroupType m_GroupTypeMapping9GridA[m_iMaxGroup3x3]; - Recipy::_eGroupType *m_pGroupA; + static LPCWSTR m_GroupIconNameA[m_iMaxGroupH3x3]; + static Recipy::_eGroupType m_GroupTypeMapping4GridA[m_iMaxGroupH2x2]; + static Recipy::_eGroupType m_GroupTypeMapping9GridA[m_iMaxGroupH3x3]; + static Recipy::_eGroupType m_GroupTypeBannerMapping4GridA[m_iMaxBannerGroupH2x2]; + static Recipy::_eGroupType m_GroupTypeBannerMapping9GridA[m_iMaxBannerGroupH3x3]; + Recipy::_eGroupType** m_pGroupA; static LPCWSTR m_GroupTabNameA[3]; - static _eGroupTab m_GroupTabBkgMapping2x2A[m_iMaxGroup2x2]; - static _eGroupTab m_GroupTabBkgMapping3x3A[m_iMaxGroup3x3]; + static _eGroupTab m_GroupTabBkgMapping2x2A[m_iMaxGroupH2x2]; + static _eGroupTab m_GroupTabBkgMapping3x3A[m_iMaxGroupH3x3]; _eGroupTab *m_pGroupTabA; int m_iCraftablesMaxHSlotC; int m_iIngredientsMaxSlotC; @@ -76,6 +93,9 @@ protected: public: IUIScene_CraftingMenu(); + ~IUIScene_CraftingMenu() { + delete[] m_pGroupA; + } protected: LPCWSTR GetGroupNameText(int iGroupType); @@ -89,7 +109,7 @@ protected: void HandleInventoryUpdated(); public: - Recipy::_eGroupType getCurrentGroup() { return m_pGroupA[m_iGroupIndex]; } + Recipy::_eGroupType getCurrentGroup() { return m_pGroupA[m_iGroupVIndex][m_iGroupHIndex]; } bool isItemSelected(int itemId); protected: @@ -107,7 +127,8 @@ protected: 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 showTabHighlight(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 setItemText(LPCWSTR text) = 0; diff --git a/Minecraft.Client/Common/UI/UIComponent_TutorialPopup.cpp b/Minecraft.Client/Common/UI/UIComponent_TutorialPopup.cpp index 826b2238..cef8e7cf 100644 --- a/Minecraft.Client/Common/UI/UIComponent_TutorialPopup.cpp +++ b/Minecraft.Client/Common/UI/UIComponent_TutorialPopup.cpp @@ -430,7 +430,7 @@ void UIComponent_TutorialPopup::UpdateInteractScenePosition(bool visible) // 4J-PB - check this players screen section to see if we should allow the animation bool bAllowAnim=false; - bool isCraftingScene = (m_interactScene->getSceneType() == eUIScene_Crafting2x2Menu) || (m_interactScene->getSceneType() == eUIScene_Crafting3x3Menu); + bool isCraftingScene = (m_interactScene->getSceneType() == eUIScene_CraftingMenu); bool isCreativeScene = (m_interactScene->getSceneType() == eUIScene_CreativeMenu); bool isTradingScene = (m_interactScene->getSceneType() == eUIScene_TradingMenu); switch(Minecraft::GetInstance()->localplayers[m_iPad]->m_iScreenSection) diff --git a/Minecraft.Client/Common/UI/UIController.cpp b/Minecraft.Client/Common/UI/UIController.cpp index 49e92464..e5355c6f 100644 --- a/Minecraft.Client/Common/UI/UIController.cpp +++ b/Minecraft.Client/Common/UI/UIController.cpp @@ -1274,6 +1274,10 @@ void UIController::tickInput() if (leftPressed) { + if (pScene->getSceneType() == eUIScene_CraftingMenu) { + dynamic_cast(pScene)->handleLeftMouseClick(sceneMouseX, sceneMouseY, sceneMouseX - panelOffsetX, sceneMouseY - panelOffsetY); + return; + } vector *controls = pScene->GetControls(); if (controls) { @@ -2218,8 +2222,7 @@ bool UIController::NavigateToScene(int iPad, EUIScene scene, void *initData, EUI switch(scene) { case eUIScene_PauseMenu: - case eUIScene_Crafting2x2Menu: - case eUIScene_Crafting3x3Menu: + case eUIScene_CraftingMenu: case eUIScene_FurnaceMenu: case eUIScene_ContainerMenu: case eUIScene_LargeContainerMenu: diff --git a/Minecraft.Client/Common/UI/UIEnums.h b/Minecraft.Client/Common/UI/UIEnums.h index bcf382c5..7de69ead 100644 --- a/Minecraft.Client/Common/UI/UIEnums.h +++ b/Minecraft.Client/Common/UI/UIEnums.h @@ -44,8 +44,7 @@ enum EUIScene eUIScene_MainMenu, eUIScene_FullscreenProgress, eUIScene_PauseMenu, - eUIScene_Crafting2x2Menu, - eUIScene_Crafting3x3Menu, + eUIScene_CraftingMenu, eUIScene_ClassicCraftingMenu, eUIScene_FurnaceMenu, eUIScene_ContainerMenu, diff --git a/Minecraft.Client/Common/UI/UILayer.cpp b/Minecraft.Client/Common/UI/UILayer.cpp index ac7a9da9..bee2ef7a 100644 --- a/Minecraft.Client/Common/UI/UILayer.cpp +++ b/Minecraft.Client/Common/UI/UILayer.cpp @@ -248,8 +248,7 @@ bool UILayer::NavigateToScene(int iPad, EUIScene scene, void *initData) case eUIScene_FurnaceMenu: newScene = new UIScene_FurnaceMenu(iPad, initData, this); break; - case eUIScene_Crafting2x2Menu: - case eUIScene_Crafting3x3Menu: + case eUIScene_CraftingMenu: newScene = new UIScene_CraftingMenu(iPad, initData, this); break; case eUIScene_ClassicCraftingMenu: @@ -752,8 +751,7 @@ bool UILayer::updateFocusState(bool allowedFocus /* = false */) case eUIScene_PauseMenu: m_bPauseMenuDisplayed = true; break; - case eUIScene_Crafting2x2Menu: - case eUIScene_Crafting3x3Menu: + case eUIScene_CraftingMenu: case eUIScene_FurnaceMenu: case eUIScene_ContainerMenu: case eUIScene_LargeContainerMenu: diff --git a/Minecraft.Client/Common/UI/UIScene_CraftingMenu.cpp b/Minecraft.Client/Common/UI/UIScene_CraftingMenu.cpp index 3e62d131..be34d9f2 100644 --- a/Minecraft.Client/Common/UI/UIScene_CraftingMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_CraftingMenu.cpp @@ -3,6 +3,8 @@ #include "../../Minecraft.h" #include "../../MultiPlayerLocalPlayer.h" #include "../../../Minecraft.World/net.minecraft.world.inventory.h" +#include "../../../Minecraft.World/DyePowderItem.h" +#include "../../../Minecraft.World/Tile.h" #include "UIScene_CraftingMenu.h" #ifdef _WINDOWS64 #include "../../Windows64/Iggy/gdraw/gdraw_d3d11.h" @@ -29,13 +31,15 @@ UIScene_CraftingMenu::UIScene_CraftingMenu(int iPad, void *_initData, UILayer *p // Setup all the Iggy references we need for this scene initialiseMovie(); - + for(unsigned int i = 0; i < 9; ++i) m_labelIngredientsDesc[i].init(L""); m_labelDescription.init(L""); m_labelGroupName.init(L""); + m_labelSpinnerTitle.init(L""); m_labelItemName.init(L""); + m_labelItemNameSmall.init(L""); m_labelInventory.init( app.GetString(IDS_INVENTORY) ); - m_labelIngredients.init( app.GetString(IDS_INGREDIENTS) ); + m_labelIngredients.init(app.GetString(IDS_INGREDIENTS)); if(m_iContainerType==RECIPE_TYPE_2x2) { @@ -55,6 +59,26 @@ UIScene_CraftingMenu::UIScene_CraftingMenu(int iPad, void *_initData, UILayer *p m_slotListInventory.addSlots(CRAFTING_INVENTORY_SLOT_START,CRAFTING_INVENTORY_SLOT_END - CRAFTING_INVENTORY_SLOT_START); m_slotListHotBar.addSlots(CRAFTING_HOTBAR_SLOT_START, CRAFTING_HOTBAR_SLOT_END - CRAFTING_HOTBAR_SLOT_START); + { + int maxGroupVLimit = ((m_iContainerType == RECIPE_TYPE_2x2) ? m_iMaxGroupV2x2 : m_iMaxGroupV3x3); + { + m_vGroupIconCache[0].item = make_shared(Tile::workBench, 1); + m_vGroupIconCache[0].show = (1 <= maxGroupVLimit); + } + { + m_vGroupIconCache[1].item = make_shared(Tile::standing_banner_Id, 1, 0); + m_vGroupIconCache[1].show = (2 <= maxGroupVLimit); + } + { + m_vGroupIconCache[2].item = make_shared(Item::fireworks_Id, 1, 0); + m_vGroupIconCache[2].show = (3 <= maxGroupVLimit); + } + { + m_vGroupIconCache[3].item = make_shared(Item::dye_Id, 1, DyePowderItem::CYAN); + m_vGroupIconCache[3].show = (4 <= maxGroupVLimit); + } + } + #if TO_BE_IMPLEMENTED // if we are in splitscreen, then we need to figure out if we want to move this scene if(m_bSplitscreen) @@ -66,53 +90,30 @@ UIScene_CraftingMenu::UIScene_CraftingMenu(int iPad, void *_initData, UILayer *p XuiElementSetShow(m_hPanel,TRUE); #endif + m_pGroupA = new Recipy::_eGroupType*[m_iMaxGroupV3x3]; + if(m_iContainerType==RECIPE_TYPE_3x3) { m_iIngredientsMaxSlotC = m_iIngredients3x3SlotC; - m_pGroupA=(Recipy::_eGroupType *)&m_GroupTypeMapping9GridA; m_pGroupTabA=(_eGroupTab *)&m_GroupTabBkgMapping3x3A; - m_iCraftablesMaxHSlotC=m_iMaxHSlot3x3C; + + m_pGroupA[eGroupVType::eGroupVType_Workbench] = (Recipy::_eGroupType*)&m_GroupTypeMapping9GridA; + m_pGroupA[eGroupVType::eGroupVType_Banner] = (Recipy::_eGroupType*)&m_GroupTypeBannerMapping9GridA; } else { m_iIngredientsMaxSlotC = m_iIngredients2x2SlotC; - m_pGroupA=(Recipy::_eGroupType *)&m_GroupTypeMapping4GridA; m_pGroupTabA=(_eGroupTab *)&m_GroupTabBkgMapping2x2A; - m_iCraftablesMaxHSlotC=m_iMaxHSlot2x2C; + + m_pGroupA[eGroupVType::eGroupVType_Workbench] = (Recipy::_eGroupType*)&m_GroupTypeMapping4GridA; + m_pGroupA[eGroupVType::eGroupVType_Banner] = (Recipy::_eGroupType*)&m_GroupTypeBannerMapping4GridA; } + m_iCraftablesMaxHSlotC = m_iMaxHSlot; -#if TO_BE_IMPLEMENTED - - - // display the first group tab - m_hTabGroupA[m_iGroupIndex].SetShow(TRUE); - - // store the slot 0 position - m_pHSlotsBrushImageControl[0]->GetPosition(&m_vSlot0Pos); - m_pHSlotsBrushImageControl[1]->GetPosition(&vec); - m_fSlotSize=vec.x-m_vSlot0Pos.x; - - // store the slot 0 highlight position - m_hHighlight.GetPosition(&m_vSlot0HighlightPos); - // Store the V slot position - m_hScrollBar2.GetPosition(&m_vSlot0V2ScrollPos); - m_hScrollBar3.GetPosition(&m_vSlot0V3ScrollPos); - - // get the position of the slot from the xui, and apply any offset needed - for(int i=0;iSetShow(FALSE); - } - - XuiElementSetShow(m_hGridInventory,FALSE); - - m_hScrollBar2.SetShow(FALSE); - m_hScrollBar3.SetShow(FALSE); - -#endif + initializeCraftingTabs(); app.SetRichPresenceContext(m_iPad,CONTEXT_GAME_STATE_CRAFTING); - setGroupText(GetGroupNameText(m_pGroupA[m_iGroupIndex])); + setGroupText(GetGroupNameText(m_pGroupA[m_iGroupVIndex][m_iGroupHIndex])); // Update the tutorial state Minecraft *pMinecraft = Minecraft::GetInstance(); @@ -140,7 +141,21 @@ UIScene_CraftingMenu::UIScene_CraftingMenu(int iPad, void *_initData, UILayer *p m_slotListIngredients[i].addSlot(CRAFTING_INGREDIENTS_DESCRIPTION_START + i); } m_slotListCraftingOutput.addSlot(CRAFTING_OUTPUT_SLOT_START); - m_slotListIngredientsLayout.addSlots(CRAFTING_INGREDIENTS_LAYOUT_START, m_iIngredientsMaxSlotC); + if (m_iContainerType == RECIPE_TYPE_3x3) { + m_slotListIngredientsLayout.addSlots(CRAFTING_INGREDIENTS_LAYOUT_START, m_iIngredientsMaxSlotC); + m_slotListIngredientsLayoutSmall.setVisible(false); + } else { + m_slotListIngredientsLayoutSmall.addSlots(CRAFTING_INGREDIENTS_LAYOUT_START, m_iIngredientsMaxSlotC); + m_slotListIngredientsLayout.setVisible(false); + } + + m_Slot2_1.addSlot(CRAFTING_SLOT_EXTRA_START + 0); + m_Slot2_2.addSlot(CRAFTING_SLOT_EXTRA_START + 1); + + m_Slot3_1.addSlot(CRAFTING_SLOT_EXTRA_START + 0); + m_Slot3_2.addSlot(CRAFTING_SLOT_EXTRA_START + 1); + m_Slot3_3.addSlot(CRAFTING_SLOT_EXTRA_START + 2); + // 3 Slot vertical scroll m_slotListCrafting3VSlots[0].addSlot(CRAFTING_V_SLOT_START + 0); @@ -184,6 +199,8 @@ UIScene_CraftingMenu::UIScene_CraftingMenu(int iPad, void *_initData, UILayer *p // 4J-PB - Must be after the CanBeMade list has been set up with CheckRecipesAvailable UpdateTooltips(); + UpdateCraftingPanels(); + #ifdef __PSVITA__ // initialise vita touch controls with ids for(unsigned int i = 0; i < ETouchInput_Count; ++i) @@ -225,14 +242,7 @@ void UIScene_CraftingMenu::handleDestroy() EUIScene UIScene_CraftingMenu::getSceneType() { - if(m_iContainerType==RECIPE_TYPE_3x3) - { - return eUIScene_Crafting3x3Menu; - } - else - { - return eUIScene_Crafting2x2Menu; - } + return eUIScene_CraftingMenu; } wstring UIScene_CraftingMenu::getMoviePath() @@ -240,25 +250,11 @@ wstring UIScene_CraftingMenu::getMoviePath() if(app.GetLocalPlayerCount() > 1) { m_bSplitscreen = true; - if(m_iContainerType==RECIPE_TYPE_3x3) - { - return L"Crafting3x3MenuSplit"; - } - else - { - return L"Crafting2x2MenuSplit"; - } + return L"CraftingMenuSplit"; } else { - if(m_iContainerType==RECIPE_TYPE_3x3) - { - return L"Crafting3x3Menu"; - } - else - { - return L"Crafting2x2Menu"; - } + return L"CraftingMenu"; } } @@ -269,203 +265,126 @@ UIControl* UIScene_CraftingMenu::GetMainPanel() } #endif -#ifdef __PSVITA__ -void UIScene_CraftingMenu::handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased) -{ - // perform action on release - if(bPressed) - { - if(iId == ETouchInput_CraftingHSlots) - { - m_iCraftingSlotTouchStartY = y; - } - } - else if(bRepeat) - { - if(iId == ETouchInput_CraftingHSlots) - { - if(y >= m_iCraftingSlotTouchStartY + m_TouchInput[ETouchInput_CraftingHSlots].getHeight()) // scroll list down - { - if(iVSlotIndexA[1]==(CanBeMadeA[m_iCurrentSlotHIndex].iCount-1)) - { - iVSlotIndexA[1]=0; - } - else - { - iVSlotIndexA[1]++; - } - ui.PlayUISFX(eSFX_Focus); - - UpdateVerticalSlots(); - UpdateHighlight(); - - m_iCraftingSlotTouchStartY = y; - } - else if(y <= m_iCraftingSlotTouchStartY - m_TouchInput[ETouchInput_CraftingHSlots].getHeight()) // scroll list up - { - if(iVSlotIndexA[1]==0) - { - iVSlotIndexA[1]=CanBeMadeA[m_iCurrentSlotHIndex].iCount-1; - } - else - { - iVSlotIndexA[1]--; - } - ui.PlayUISFX(eSFX_Focus); - - UpdateVerticalSlots(); - UpdateHighlight(); - - m_iCraftingSlotTouchStartY = y; - } - } - } - else if(bReleased) - { - if(iId >= ETouchInput_TouchPanel_0 && iId <= ETouchInput_TouchPanel_6) // Touch Change Group - { - m_iGroupIndex = iId; - // turn on the new group - showTabHighlight(m_iGroupIndex,true); - - m_iCurrentSlotHIndex=0; - m_iCurrentSlotVIndex=1; - CheckRecipesAvailable(); - // reset the vertical slots - iVSlotIndexA[0]=CanBeMadeA[m_iCurrentSlotHIndex].iCount-1; - iVSlotIndexA[1]=0; - iVSlotIndexA[2]=1; - ui.PlayUISFX(eSFX_Focus); - UpdateVerticalSlots(); - UpdateHighlight(); - setGroupText(GetGroupNameText(m_pGroupA[m_iGroupIndex])); - } - else if(iId == ETouchInput_CraftingHSlots) // Touch Change Slot - { - int iMaxHSlots = 0; - if(m_iContainerType==RECIPE_TYPE_3x3) - { - iMaxHSlots = m_iMaxHSlot3x3C; - } - else - { - iMaxHSlots = m_iMaxHSlot2x2C; - } - - int iNewSlot = (x - m_TouchInput[ETouchInput_CraftingHSlots].getXPos() - m_controlMainPanel.getXPos()) / m_TouchInput[ETouchInput_CraftingHSlots].getHeight(); - - int iOldHSlot=m_iCurrentSlotHIndex; - - m_iCurrentSlotHIndex = iNewSlot; - if(m_iCurrentSlotHIndex>=m_iCraftablesMaxHSlotC) m_iCurrentSlotHIndex=0; - m_iCurrentSlotVIndex=1; - // clear the indices - iVSlotIndexA[0]=CanBeMadeA[m_iCurrentSlotHIndex].iCount-1; - iVSlotIndexA[1]=0; - iVSlotIndexA[2]=1; - - UpdateVerticalSlots(); - UpdateHighlight(); - // re-enable the old hslot - if(CanBeMadeA[iOldHSlot].iCount>0) - { - setShowCraftHSlot(iOldHSlot,true); - } - ui.PlayUISFX(eSFX_Focus); - } - } -} - -void UIScene_CraftingMenu::handleTouchBoxRebuild() -{ - addTimer(GAME_CRAFTING_TOUCHUPDATE_TIMER_ID,GAME_CRAFTING_TOUCHUPDATE_TIMER_TIME); -} - -void UIScene_CraftingMenu::handleTimerComplete(int id) -{ - if(id == GAME_CRAFTING_TOUCHUPDATE_TIMER_ID) - { - // we cannot rebuild touch boxes in an iggy callback because it requires further iggy calls - GetMainPanel()->UpdateControl(); - ui.TouchBoxRebuild(this); - killTimer(GAME_CRAFTING_TOUCHUPDATE_TIMER_ID); - } -} -#endif - #ifdef _WINDOWS64 +void UIScene_CraftingMenu::handleLeftMouseClick(F32 x, F32 y, F32 sceneX, F32 sceneY) { + + { + int maxHorizontalTabs = (m_iContainerType == RECIPE_TYPE_3x3) ? m_iMaxGroupH3x3 : m_iMaxGroupH2x2; + + F32 groupRowX1 = m_GroupH1.getXPos(); + F32 groupRowX2 = m_GroupH2.getXPos(); + F32 groupRowWidth = m_GroupH1.getWidth(); + F32 groupRowSpacing = groupRowX2 - (groupRowX1 + groupRowWidth); + + F32 tabStep = groupRowWidth + groupRowSpacing; + F32 rowX = groupRowX1; + F32 rowY = m_GroupH1.getYPos(); + F32 rowHeight = m_GroupH1.getHeight(); + + if (sceneY >= rowY && sceneY < rowY + rowHeight && sceneX >= groupRowX1 && tabStep > 0.0f) { + F32 offsetX = sceneX - groupRowX1; + int tabIndex = static_cast(offsetX / tabStep); + + if (tabIndex >= 0 && tabIndex < maxHorizontalTabs && tabIndex != m_iGroupHIndex) { + F32 tabOffset = offsetX - tabIndex * tabStep; + + if (tabOffset < groupRowWidth) { + m_iGroupHIndex = tabIndex; + setHGroupHighlight(m_iGroupHIndex); + m_iCurrentSlotHIndex = 0; + m_iCurrentSlotVIndex = 1; + UpdateCraftingPanels(); + CheckRecipesAvailable(); + iVSlotIndexA[0] = CanBeMadeA[m_iCurrentSlotHIndex].iCount - 1; + iVSlotIndexA[1] = 0; + iVSlotIndexA[2] = 1; + ui.PlayUISFX(eSFX_Focus); + UpdateVerticalSlots(); + UpdateHighlight(); + setGroupText(GetGroupNameText(m_pGroupA[m_iGroupVIndex][m_iGroupHIndex])); + + return; + } + } + } + } + { + int maxVerticalTabs = (m_iContainerType == RECIPE_TYPE_3x3) ? m_iMaxGroupV3x3 : m_iMaxGroupV2x2; + + F32 groupRowY1 = m_GroupV1.getYPos(); + F32 groupRowY2 = m_GroupV2.getYPos(); + F32 groupRowHeight = m_GroupV1.getHeight(); + F32 groupRowSpacing = groupRowY2 - (groupRowY1 + groupRowHeight); + + F32 tabStep = groupRowHeight + groupRowSpacing; + F32 rowX = m_GroupV1.getXPos(); + F32 rowWidth = m_GroupV1.getWidth(); + + if (sceneY >= groupRowY1 && sceneX >= rowX && sceneX < rowX + rowWidth && tabStep > 0.0f) { + F32 offsetY = sceneY - groupRowY1; + int tabIndex = static_cast(offsetY / tabStep); + + if (tabIndex >= 0 && tabIndex < maxVerticalTabs && tabIndex != m_iGroupVIndex) { + F32 tabOffset = offsetY - tabIndex * tabStep; + + if (tabOffset < groupRowHeight) { + + m_iGroupHIndex = 0; + m_iGroupVIndex = tabIndex; + setVGroupHighlight(m_iGroupVIndex); + m_iCurrentSlotHIndex = 0; + m_iCurrentSlotVIndex = 1; + UpdateCraftingPanels(); + CheckRecipesAvailable(); + iVSlotIndexA[0] = CanBeMadeA[m_iCurrentSlotHIndex].iCount - 1; + iVSlotIndexA[1] = 0; + iVSlotIndexA[2] = 1; + ui.PlayUISFX(eSFX_Focus); + UpdateVerticalSlots(); + UpdateHighlight(); + setGroupText(GetGroupNameText(m_pGroupA[m_iGroupVIndex][m_iGroupHIndex])); + return; + } + } + } + } + + //if (m_iGroupVIndex == eGroupVType::eGroupVType_Workbench) { + if (m_hSlotBoundsValid && m_hSlotSpacing > 0) { + F32 rowWidth = m_hSlotSpacing * m_iCraftablesMaxHSlotC; + if (x >= m_hSlotX0 && x < m_hSlotX0 + rowWidth && y >= m_hSlotY0 && y < m_hSlotY1) { + int iNewSlot = (int)((x - m_hSlotX0) / m_hSlotSpacing); + if (iNewSlot >= 0 && iNewSlot < m_iCraftablesMaxHSlotC) { + // Only interact with populated slots + if (CanBeMadeA[iNewSlot].iCount != 0) { + if (iNewSlot == m_iCurrentSlotHIndex) + { + // Click on already-selected slot — craft the item + handleKeyDown(m_iPad, ACTION_MENU_A, false); + } else { + int iOldHSlot = m_iCurrentSlotHIndex; + m_iCurrentSlotHIndex = iNewSlot; + m_iCurrentSlotVIndex = 1; + iVSlotIndexA[0] = CanBeMadeA[m_iCurrentSlotHIndex].iCount - 1; + iVSlotIndexA[1] = 0; + iVSlotIndexA[2] = 1; + UpdateVerticalSlots(); + UpdateHighlight(); + if (CanBeMadeA[iOldHSlot].iCount > 0) { + setShowCraftHSlot(iOldHSlot, true); + } + ui.PlayUISFX(eSFX_Focus); + } + } + } + } + } + //} + +} + bool UIScene_CraftingMenu::handleMouseClick(F32 x, F32 y) { - if (!m_hSlotBoundsValid || m_hSlotSpacing <= 0) - return false; - - // Tab click — tabs sit directly above the H slot row. We derive their - // bounds from the H slot positions cached in customDraw, since the Vita - // TouchPanel controls are full-screen overlays with unusable bounds. - int maxTabs = (m_iContainerType == RECIPE_TYPE_3x3) ? m_iMaxGroup3x3 : m_iMaxGroup2x2; - F32 slotHeight = m_hSlotY1 - m_hSlotY0; - F32 tabRowY0 = (m_hSlotY0 * 0.75f) - slotHeight * 1.55f; - F32 tabRowY1 = tabRowY0 + (slotHeight * 1.7f); - F32 tabRowWidth = m_hSlotSpacing * m_iCraftablesMaxHSlotC; - F32 tabWidth = tabRowWidth / maxTabs; - - if (tabWidth > 0 && x >= m_hSlotX0 && x < m_hSlotX0 + tabRowWidth && - y >= tabRowY0 && y < tabRowY1) - { - int iTab = (int)((x - m_hSlotX0) / tabWidth); - if (iTab >= 0 && iTab < maxTabs && iTab != m_iGroupIndex) - { - showTabHighlight(m_iGroupIndex, false); - m_iGroupIndex = iTab; - showTabHighlight(m_iGroupIndex, true); - m_iCurrentSlotHIndex = 0; - m_iCurrentSlotVIndex = 1; - CheckRecipesAvailable(); - iVSlotIndexA[0] = CanBeMadeA[m_iCurrentSlotHIndex].iCount - 1; - iVSlotIndexA[1] = 0; - iVSlotIndexA[2] = 1; - ui.PlayUISFX(eSFX_Focus); - UpdateVerticalSlots(); - UpdateHighlight(); - setGroupText(GetGroupNameText(m_pGroupA[m_iGroupIndex])); - } - return true; - } - - // H slot click — select or craft - F32 rowWidth = m_hSlotSpacing * m_iCraftablesMaxHSlotC; - if (x >= m_hSlotX0 && x < m_hSlotX0 + rowWidth && - y >= m_hSlotY0 && y < m_hSlotY1) - { - int iNewSlot = (int)((x - m_hSlotX0) / m_hSlotSpacing); - if (iNewSlot >= 0 && iNewSlot < m_iCraftablesMaxHSlotC) - { - // Only interact with populated slots - if (CanBeMadeA[iNewSlot].iCount == 0) - return true; - - if (iNewSlot == m_iCurrentSlotHIndex) - { - // Click on already-selected slot — craft the item - handleKeyDown(m_iPad, ACTION_MENU_A, false); - } - else - { - int iOldHSlot = m_iCurrentSlotHIndex; - m_iCurrentSlotHIndex = iNewSlot; - m_iCurrentSlotVIndex = 1; - iVSlotIndexA[0] = CanBeMadeA[m_iCurrentSlotHIndex].iCount - 1; - iVSlotIndexA[1] = 0; - iVSlotIndexA[2] = 1; - UpdateVerticalSlots(); - UpdateHighlight(); - if (CanBeMadeA[iOldHSlot].iCount > 0) - setShowCraftHSlot(iOldHSlot, true); - ui.PlayUISFX(eSFX_Focus); - } - return true; - } - } // Consume all mouse clicks so misses don't generate ACTION_MENU_A // and accidentally craft. Only blocks mouse-originated presses. return true; @@ -482,7 +401,20 @@ void UIScene_CraftingMenu::handleReload() m_slotListIngredients[i].addSlot(CRAFTING_INGREDIENTS_DESCRIPTION_START + i); } m_slotListCraftingOutput.addSlot(CRAFTING_OUTPUT_SLOT_START); - m_slotListIngredientsLayout.addSlots(CRAFTING_INGREDIENTS_LAYOUT_START, m_iIngredientsMaxSlotC); + if (m_iContainerType == RECIPE_TYPE_3x3) { + m_slotListIngredientsLayout.addSlots(CRAFTING_INGREDIENTS_LAYOUT_START, m_iIngredientsMaxSlotC); + m_slotListIngredientsLayoutSmall.setVisible(false); + } else { + m_slotListIngredientsLayoutSmall.addSlots(CRAFTING_INGREDIENTS_LAYOUT_START, m_iIngredientsMaxSlotC); + m_slotListIngredientsLayout.setVisible(false); + } + + m_Slot2_1.addSlot(CRAFTING_SLOT_EXTRA_START + 0); + m_Slot2_2.addSlot(CRAFTING_SLOT_EXTRA_START + 1); + + m_Slot3_1.addSlot(CRAFTING_SLOT_EXTRA_START + 0); + m_Slot3_2.addSlot(CRAFTING_SLOT_EXTRA_START + 1); + m_Slot3_3.addSlot(CRAFTING_SLOT_EXTRA_START + 2); // 3 Slot vertical scroll m_slotListCrafting3VSlots[0].addSlot(CRAFTING_V_SLOT_START + 0); @@ -499,6 +431,8 @@ void UIScene_CraftingMenu::handleReload() m_slotListCraftingHSlots.addSlots(CRAFTING_H_SLOT_START,m_iCraftablesMaxHSlotC); + initializeCraftingTabs(); + app.DebugPrintf(app.USER_SR,"Reloading MultiPanel\n"); int temp = m_iDisplayDescription; m_iDisplayDescription = m_iDisplayDescription==0?1:0; @@ -518,8 +452,9 @@ void UIScene_CraftingMenu::handleReload() UpdateHighlight(); app.DebugPrintf(app.USER_SR,"Reloading tabs\n"); - showTabHighlight(0,false); - showTabHighlight(m_iGroupIndex,true); + setHGroupHighlight(m_iGroupHIndex); + setVGroupHighlight(m_iGroupVIndex); + UpdateCraftingPanels(); } void UIScene_CraftingMenu::customDraw(IggyCustomDrawCallbackRegion *region) @@ -528,116 +463,168 @@ void UIScene_CraftingMenu::customDraw(IggyCustomDrawCallbackRegion *region) if(pMinecraft->localplayers[m_iPad] == nullptr || pMinecraft->localgameModes[m_iPad] == nullptr) return; shared_ptr item = nullptr; - int slotId = -1; float alpha = 1.0f; - bool decorations = true; bool inventoryItem = false; - swscanf(static_cast(region->name),L"slot_%d",&slotId); - if (slotId == -1) - { - app.DebugPrintf("This is not the control we are looking for\n"); - } - else if(slotId >= CRAFTING_INVENTORY_SLOT_START && slotId < CRAFTING_INVENTORY_SLOT_END) - { - int iIndex = slotId - CRAFTING_INVENTORY_SLOT_START; - iIndex += m_iMenuInventoryStart; - Slot *slot = m_menu->getSlot(iIndex); - item = slot->getItem(); - inventoryItem = true; - } - else if(slotId >= CRAFTING_HOTBAR_SLOT_START && slotId < CRAFTING_HOTBAR_SLOT_END) - { - int iIndex = slotId - CRAFTING_HOTBAR_SLOT_START; - iIndex += m_iMenuHotBarStart; - Slot *slot = m_menu->getSlot(iIndex); - item = slot->getItem(); - inventoryItem = true; - } - else if(slotId >= CRAFTING_V_SLOT_START && slotId < CRAFTING_V_SLOT_END ) - { - decorations = false; - int iIndex = slotId - CRAFTING_V_SLOT_START; - if(m_vSlotsInfo[iIndex].show) + bool decorations = true; + + int slotId = -1; + int iTabV = -1; + int iTabH = -1; + + if (swscanf(static_cast(region->name), L"slot_%d", &slotId) == 1) { + //if (m_iGroupVIndex != eGroupVType_Workbench) return; + + if (slotId == -1) { - item = m_vSlotsInfo[iIndex].item; - alpha = static_cast(m_vSlotsInfo[iIndex].alpha)/31.0f; + app.DebugPrintf("This is not the control we are looking for\n"); } - } - else if(slotId >= CRAFTING_H_SLOT_START && slotId < (CRAFTING_H_SLOT_START + m_iCraftablesMaxHSlotC) ) - { - decorations = false; - int iIndex = slotId - CRAFTING_H_SLOT_START; + else if(slotId >= CRAFTING_INVENTORY_SLOT_START && slotId < CRAFTING_INVENTORY_SLOT_END) + { + int iIndex = slotId - CRAFTING_INVENTORY_SLOT_START; + iIndex += m_iMenuInventoryStart; + Slot *slot = m_menu->getSlot(iIndex); + item = slot->getItem(); + inventoryItem = true; + } + else if(slotId >= CRAFTING_HOTBAR_SLOT_START && slotId < CRAFTING_HOTBAR_SLOT_END) + { + int iIndex = slotId - CRAFTING_HOTBAR_SLOT_START; + iIndex += m_iMenuHotBarStart; + Slot *slot = m_menu->getSlot(iIndex); + item = slot->getItem(); + inventoryItem = true; + } + else if(slotId >= CRAFTING_V_SLOT_START && slotId < CRAFTING_V_SLOT_END ) + { + decorations = false; + int iIndex = slotId - CRAFTING_V_SLOT_START; + if(m_vSlotsInfo[iIndex].show) + { + item = m_vSlotsInfo[iIndex].item; + alpha = static_cast(m_vSlotsInfo[iIndex].alpha)/31.0f; + } + } + else if(slotId >= CRAFTING_H_SLOT_START && slotId < (CRAFTING_H_SLOT_START + m_iCraftablesMaxHSlotC) ) + { + decorations = false; + int iIndex = slotId - CRAFTING_H_SLOT_START; + #ifdef _WINDOWS64 + // Cache H slot SWF-space positions from the custom draw transform matrix + if (iIndex == 0 || iIndex == 1) + { + F32 mat[16]; + gdraw_D3D11_CalculateCustomDraw_4J(region, mat); + // Matrix to SWF coords (same formula as setupCustomDrawMatrices) + F32 sw = (F32)getRenderWidth(); + F32 sh = (F32)getRenderHeight(); + F32 swfX = sw * (1.0f + mat[3]) / 2.0f; + F32 swfY = sh * (1.0f - mat[7]) / 2.0f; + if (iIndex == 0) + { + m_hSlotX0 = swfX; + m_hSlotY0 = swfY; + // Slot visual height from matrix scale and region height + F32 slotH = sh * (-mat[5]) / 2.0f * region->y1; + m_hSlotY1 = swfY + slotH; + } + else + { + m_hSlotSpacing = swfX - m_hSlotX0; + m_hSlotBoundsValid = (m_hSlotSpacing > 0); + } + } + #endif + if(m_hSlotsInfo[iIndex].show) + { + item = m_hSlotsInfo[iIndex].item; + alpha = static_cast(m_hSlotsInfo[iIndex].alpha)/31.0f; + } + } + else if(slotId >= CRAFTING_INGREDIENTS_LAYOUT_START && slotId < (CRAFTING_INGREDIENTS_LAYOUT_START + m_iIngredientsMaxSlotC) ) + { + int iIndex = slotId - CRAFTING_INGREDIENTS_LAYOUT_START; + if(m_ingredientsSlotsInfo[iIndex].show) + { + item = m_ingredientsSlotsInfo[iIndex].item; + alpha = static_cast(m_ingredientsSlotsInfo[iIndex].alpha)/31.0f; + } + } + else if (slotId >= CRAFTING_SLOT_EXTRA_START && slotId < CRAFTING_SLOT_EXTRA_END) { + int iIndex = (slotId - CRAFTING_SLOT_EXTRA_START); + if (iIndex == 0) { + if (m_hSlotsInfo[0].show) { + item = m_hSlotsInfo[0].item; + alpha = static_cast(m_hSlotsInfo[0].alpha) / 31.0f; + } else { + if (m_craftingOutputSlotInfo.show) + { + item = m_craftingOutputSlotInfo.item; + alpha = static_cast(m_craftingOutputSlotInfo.alpha) / 31.0f; + } + } + } + #ifdef _WINDOWS64 - // Cache H slot SWF-space positions from the custom draw transform matrix - if (iIndex == 0 || iIndex == 1) - { - F32 mat[16]; - gdraw_D3D11_CalculateCustomDraw_4J(region, mat); - // Matrix to SWF coords (same formula as setupCustomDrawMatrices) - F32 sw = (F32)getRenderWidth(); - F32 sh = (F32)getRenderHeight(); - F32 swfX = sw * (1.0f + mat[3]) / 2.0f; - F32 swfY = sh * (1.0f - mat[7]) / 2.0f; - if (iIndex == 0) + // Cache H slot SWF-space positions from the custom draw transform matrix + if (iIndex == 0 || iIndex == 1) { - m_hSlotX0 = swfX; - m_hSlotY0 = swfY; - // Slot visual height from matrix scale and region height - F32 slotH = sh * (-mat[5]) / 2.0f * region->y1; - m_hSlotY1 = swfY + slotH; + F32 mat[16]; + gdraw_D3D11_CalculateCustomDraw_4J(region, mat); + // Matrix to SWF coords (same formula as setupCustomDrawMatrices) + F32 sw = (F32)getRenderWidth(); + F32 sh = (F32)getRenderHeight(); + F32 swfX = sw * (1.0f + mat[3]) / 2.0f; + F32 swfY = sh * (1.0f - mat[7]) / 2.0f; + if (iIndex == 0) + { + m_hSlotX0 = swfX; + m_hSlotY0 = swfY; + // Slot visual height from matrix scale and region height + F32 slotH = sh * (-mat[5]) / 2.0f * region->y1; + m_hSlotY1 = swfY + slotH; + } + else + { + m_hSlotSpacing = swfX - m_hSlotX0; + m_hSlotBoundsValid = (m_hSlotSpacing > 0); + } } - else - { - m_hSlotSpacing = swfX - m_hSlotX0; - m_hSlotBoundsValid = (m_hSlotSpacing > 0); - } - } #endif - if(m_hSlotsInfo[iIndex].show) - { - item = m_hSlotsInfo[iIndex].item; - alpha = static_cast(m_hSlotsInfo[iIndex].alpha)/31.0f; } - } - else if(slotId >= CRAFTING_INGREDIENTS_LAYOUT_START && slotId < (CRAFTING_INGREDIENTS_LAYOUT_START + m_iIngredientsMaxSlotC) ) - { - int iIndex = slotId - CRAFTING_INGREDIENTS_LAYOUT_START; - if(m_ingredientsSlotsInfo[iIndex].show) + else if (slotId >= CRAFTING_INGREDIENTS_DESCRIPTION_START && slotId < (CRAFTING_INGREDIENTS_DESCRIPTION_START + 9)) { - item = m_ingredientsSlotsInfo[iIndex].item; - alpha = static_cast(m_ingredientsSlotsInfo[iIndex].alpha)/31.0f; + int iIndex = slotId - CRAFTING_INGREDIENTS_DESCRIPTION_START; + if(m_ingredientsInfo[iIndex].show) + { + item = m_ingredientsInfo[iIndex].item; + alpha = static_cast(m_ingredientsInfo[iIndex].alpha)/31.0f; + } } - } - else if(slotId >= CRAFTING_INGREDIENTS_DESCRIPTION_START && slotId < (CRAFTING_INGREDIENTS_DESCRIPTION_START + 9) ) - { - int iIndex = slotId - CRAFTING_INGREDIENTS_DESCRIPTION_START; - if(m_ingredientsInfo[iIndex].show) + else if(slotId == CRAFTING_OUTPUT_SLOT_START ) { - item = m_ingredientsInfo[iIndex].item; - alpha = static_cast(m_ingredientsInfo[iIndex].alpha)/31.0f; + if(m_craftingOutputSlotInfo.show) + { + item = m_craftingOutputSlotInfo.item; + alpha = static_cast(m_craftingOutputSlotInfo.alpha)/31.0f; + } } - } - else if(slotId == CRAFTING_OUTPUT_SLOT_START ) - { - if(m_craftingOutputSlotInfo.show) - { - item = m_craftingOutputSlotInfo.item; - alpha = static_cast(m_craftingOutputSlotInfo.alpha)/31.0f; + } else if (swscanf(static_cast(region->name), L"TabV_%d", &iTabV) == 1) { + SlotInfo& vGroupIconInfo = m_vGroupIconCache[iTabV - 1]; + if (vGroupIconInfo.show) { + item = vGroupIconInfo.item; + alpha = vGroupIconInfo.alpha; } + } else if (swscanf(static_cast(region->name), L"TabH_%d", &iTabH) == 1) { + } - if(item != nullptr) - { - if(!inventoryItem) - { - if( item->id == Item::clock_Id || item->id == Item::compass_Id ) - { + if(item != nullptr) { + if(!inventoryItem) { + if( item->id == Item::clock_Id || item->id == Item::compass_Id ) { // 4J Stu - For clocks and compasses we set the aux value to a special one that signals we should use a default texture // rather than the dynamic one for the player item->setAuxValue(0xFF); - } - else if( (item->getAuxValue() & 0xFF) == 0xFF) - { + } else if( (item->getAuxValue() & 0xFF) == 0xFF) { // 4J Stu - If the aux value is set to match any item->setAuxValue(0); } @@ -795,19 +782,24 @@ void UIScene_CraftingMenu::setShowCraftHSlot(int iIndex, bool show) m_hSlotsInfo[iIndex].show = show; } -void UIScene_CraftingMenu::showTabHighlight(int iIndex, bool show) +void UIScene_CraftingMenu::setHGroupHighlight(int iIndex) { - if(show) - { - IggyDataValue result; - IggyDataValue value[1]; + IggyDataValue result; + IggyDataValue value[2]; + + value[0].type = IGGY_DATATYPE_number; + value[0].number = iIndex; + value[1].type = IGGY_DATATYPE_number; + value[1].number = m_iGroupVIndex; - value[0].type = IGGY_DATATYPE_number; - value[0].number = iIndex; - IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ) , m_funcSetActiveTab , 1 , value ); - } + IggyResult out = IggyPlayerCallMethodRS(getMovie(), &result, IggyPlayerRootPath(getMovie()), m_funcSetActiveTab, 2, value); } +void UIScene_CraftingMenu::setVGroupHighlight(int iIndex) { + setHGroupHighlight(m_iGroupHIndex); +} + + void UIScene_CraftingMenu::setGroupText(LPCWSTR text) { m_labelGroupName.setLabel(text); @@ -820,7 +812,13 @@ void UIScene_CraftingMenu::setDescriptionText(LPCWSTR text) void UIScene_CraftingMenu::setItemText(LPCWSTR text) { - m_labelItemName.setLabel(text); + if (m_iContainerType == RECIPE_TYPE_2x2) { + m_labelItemNameSmall.setLabel(text); + m_labelItemName.setLabel(L""); + } else { + m_labelItemName.setLabel(text); + m_labelItemNameSmall.setLabel(L""); + } } void UIScene_CraftingMenu::UpdateMultiPanel() @@ -881,6 +879,18 @@ void UIScene_CraftingMenu::updateHighlightAndScrollPositions() } } +void UIScene_CraftingMenu::initializeCraftingTabs() { + IggyDataValue result; + IggyDataValue value[1]; + + value[0].type = IGGY_DATATYPE_number; + value[0].number = (m_iContainerType == RECIPE_TYPE_3x3) ? 1 : 0; + IggyResult out = IggyPlayerCallMethodRS(getMovie(), &result, IggyPlayerRootPath(getMovie()), m_funcInitCraftingMenu, 1, value); + + SetCraftingMenu(); + setHGroupHighlight(m_iGroupHIndex); +} + void UIScene_CraftingMenu::HandleMessage(EUIMessage message, void *data) { switch(message) @@ -900,3 +910,57 @@ void UIScene_CraftingMenu::updateVSlotPositions(int iSlots, int i) { // Not needed } + +void UIScene_CraftingMenu::ShowSuperCraftingSlots(int iIndex) { + IggyDataValue result; + IggyDataValue value[1]; + + value[0].type = IGGY_DATATYPE_number; + value[0].number = iIndex; + IggyResult out = IggyPlayerCallMethodRS(getMovie(), &result, IggyPlayerRootPath(getMovie()), m_funcShowSuperCraftingSlots, 1, value); +} + +void UIScene_CraftingMenu::SetCraftingMenu() { + IggyDataValue result; + IggyDataValue value[3]; + + int currentHGroups = (m_iContainerType == RECIPE_TYPE_3x3 ? m_iMaxGroupH3x3 : m_iMaxGroupH2x2); + if (m_iGroupVIndex == eGroupVType_Banner) { + currentHGroups = (m_iContainerType == RECIPE_TYPE_3x3 ? m_iMaxBannerGroupH3x3 : m_iMaxBannerGroupH2x2); + } + + value[0].type = IGGY_DATATYPE_number; + value[0].number = currentHGroups; + value[1].type = IGGY_DATATYPE_number; + value[1].number = (m_iContainerType == RECIPE_TYPE_3x3 ? m_iMaxGroupV3x3 : m_iMaxGroupV2x2); + value[2].type = IGGY_DATATYPE_boolean; + value[2].boolval = (m_iGroupVIndex == eGroupVType::eGroupVType_Banner); // false = static icons, true = iggy custom draw ("TabH_N" regions) + IggyResult out = IggyPlayerCallMethodRS(getMovie(), &result, IggyPlayerRootPath(getMovie()), m_funcSetCraftingMenu, 3, value); +} + + +void UIScene_CraftingMenu::UpdateCraftingPanels() { + if (m_iGroupVIndex == eGroupVType_Workbench) { + m_iDisplayDescription = DISPLAY_INVENTORY; + ShowSuperCraftingSlots(0); + } else if (m_iGroupVIndex == eGroupVType_Banner) { + + if (m_iGroupHIndex == 0) { + ShowSuperCraftingSlots(3); + m_iDisplayDescription = DISPLAY_INVENTORY; + } else { + ShowSuperCraftingSlots(0); + m_iDisplayDescription = DISPLAY_PREVIEW; + } + + if (m_iCurrentSlotHIndex == 0) { + m_labelSpinnerTitle.setLabel(L"Create Banner"); + } else if (m_iCurrentSlotHIndex == 1) { + m_labelSpinnerTitle.setLabel(L"Select Banner"); + } + } + + SetCraftingMenu(); + UpdateMultiPanel(); + updateHighlightAndScrollPositions(); +} \ No newline at end of file diff --git a/Minecraft.Client/Common/UI/UIScene_CraftingMenu.h b/Minecraft.Client/Common/UI/UIScene_CraftingMenu.h index 7dd112b5..e933c3b6 100644 --- a/Minecraft.Client/Common/UI/UIScene_CraftingMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_CraftingMenu.h @@ -21,7 +21,10 @@ #define CRAFTING_INGREDIENTS_LAYOUT_START CRAFTING_OUTPUT_SLOT_END #define CRAFTING_INGREDIENTS_LAYOUT_END (CRAFTING_INGREDIENTS_LAYOUT_START+9) -#define CRAFTING_V_SLOT_START CRAFTING_INGREDIENTS_LAYOUT_END +#define CRAFTING_SLOT_EXTRA_START CRAFTING_INGREDIENTS_LAYOUT_END +#define CRAFTING_SLOT_EXTRA_END (CRAFTING_SLOT_EXTRA_START+3) + +#define CRAFTING_V_SLOT_START CRAFTING_SLOT_EXTRA_END #define CRAFTING_V_SLOT_END (CRAFTING_V_SLOT_START+3) // H slots should go last in the count as it's dependent on which size of crafting panel we have @@ -50,6 +53,8 @@ private: SlotInfo m_craftingOutputSlotInfo; SlotInfo m_ingredientsInfo[9]; + SlotInfo m_vGroupIconCache[4]; + AbstractContainerMenu *m_menu; int m_iMenuInventoryStart; @@ -78,6 +83,12 @@ public: F32 m_hSlotX0, m_hSlotY0, m_hSlotY1; F32 m_hSlotSpacing; // x distance between slot 0 and slot 1 bool m_hSlotBoundsValid; + + //cached from swf at startup + UIControl m_GroupH1, m_GroupH2; + UIControl m_GroupV1, m_GroupV2; + + void handleLeftMouseClick(F32 x, F32 y, F32 sceneX, F32 sceneY); #endif protected: @@ -85,16 +96,20 @@ protected: UIControl m_control1Selector, m_control2Selector, m_control3Selector; UIControl_SlotList m_slotListCraftingHSlots; UIControl_SlotList m_slotListCrafting1VSlots, m_slotListCrafting2VSlots[2], m_slotListCrafting3VSlots[3]; - UIControl_SlotList m_slotListIngredientsLayout, m_slotListCraftingOutput; + UIControl_SlotList m_slotListIngredientsLayout, m_slotListIngredientsLayoutSmall, m_slotListCraftingOutput; UIControl_SlotList m_slotListIngredients[9]; + UIControl_SlotList m_Slot2_1, m_Slot2_2; + UIControl_SlotList m_Slot3_1, m_Slot3_2, m_Slot3_3; UIControl_SlotList m_slotListInventory, m_slotListHotBar; UIControl_Label m_labelIngredientsDesc[9]; UIControl_HTMLLabel m_labelDescription; - UIControl_Label m_labelGroupName, m_labelItemName, m_labelInventory, m_labelIngredients; + UIControl_Label m_labelGroupName, m_labelSpinnerTitle, m_labelItemName, m_labelItemNameSmall, m_labelInventory, m_labelIngredients; IggyName m_funcMoveSelector, m_funcSelectVerticalItem, m_funcSetActiveTab; IggyName m_funcShowPanelDisplay, m_funcShowIngredientSlot; + IggyName m_funcInitCraftingMenu, m_funcSetCraftingMenu, m_funcEnableTab, m_funcShowSuperCraftingSlots; + #ifdef __PSVITA__ enum ETouchInput { @@ -137,6 +152,7 @@ protected: UI_END_MAP_CHILD_ELEMENTS() UI_MAP_ELEMENT( m_slotListIngredientsLayout, "IngredientsLayout") + UI_MAP_ELEMENT( m_slotListIngredientsLayoutSmall, "IngredientsLayout_Small") UI_MAP_ELEMENT( m_slotListCraftingOutput, "CraftingOutput") UI_MAP_ELEMENT( m_slotListIngredients[0], "Ingredient1") @@ -159,6 +175,13 @@ protected: UI_MAP_ELEMENT( m_labelIngredientsDesc[7], "Ingredient8Desc") UI_MAP_ELEMENT( m_labelIngredientsDesc[8], "Ingredient9Desc") + UI_MAP_ELEMENT( m_Slot2_1, "Slot2_1") + UI_MAP_ELEMENT( m_Slot2_2, "Slot2_2") + + UI_MAP_ELEMENT( m_Slot3_1, "Slot3_1") + UI_MAP_ELEMENT( m_Slot3_2, "Slot3_2") + UI_MAP_ELEMENT( m_Slot3_3, "Slot3_3") + UI_MAP_ELEMENT( m_labelIngredients, "IngredientsLabel") UI_MAP_ELEMENT( m_labelDescription, "DescriptionText") @@ -166,8 +189,10 @@ protected: UI_MAP_ELEMENT( m_slotListInventory, "Inventory") UI_MAP_ELEMENT( m_slotListHotBar, "HotBar") + UI_MAP_ELEMENT( m_labelSpinnerTitle, "SpinnerTitle") UI_MAP_ELEMENT( m_labelGroupName, "GroupName") UI_MAP_ELEMENT( m_labelItemName, "ItemName") + UI_MAP_ELEMENT( m_labelItemNameSmall, "ItemNameSmall") UI_MAP_ELEMENT( m_labelInventory, "InventoryLabel") UI_MAP_NAME( m_funcMoveSelector, L"MoveSelector") @@ -176,6 +201,19 @@ protected: UI_MAP_NAME( m_funcShowPanelDisplay, L"showPanelDisplay") UI_MAP_NAME( m_funcShowIngredientSlot, L"ShowIngredient") + UI_MAP_NAME( m_funcInitCraftingMenu, L"InitCraftingMenu" ) + UI_MAP_NAME( m_funcSetCraftingMenu, L"SetCraftingMenu" ) + UI_MAP_NAME( m_funcEnableTab, L"EnableTab" ) + UI_MAP_NAME( m_funcShowSuperCraftingSlots, L"ShowSuperCraftingSlots" ) + +#ifdef _WINDOWS64 + UI_MAP_ELEMENT(m_GroupH1, "TabH_1") + UI_MAP_ELEMENT(m_GroupH2, "TabH_2") + + UI_MAP_ELEMENT(m_GroupV1, "TabV_1") + UI_MAP_ELEMENT(m_GroupV2, "TabV_2") +#endif + #ifdef __PSVITA__ UI_MAP_ELEMENT( m_TouchInput[ETouchInput_TouchPanel_0], "TouchPanel_0" ) UI_MAP_ELEMENT( m_TouchInput[ETouchInput_TouchPanel_1], "TouchPanel_1" ) @@ -211,7 +249,8 @@ protected: virtual void setIngredientDescriptionRedBox(int index, bool show); virtual void setIngredientDescriptionText(int index, LPCWSTR text); virtual void setShowCraftHSlot(int iIndex, bool show); - virtual void showTabHighlight(int iIndex, bool show); + virtual void setHGroupHighlight(int iIndex); + virtual void setVGroupHighlight(int iIndex); virtual void setGroupText(LPCWSTR text); virtual void setDescriptionText(LPCWSTR text); virtual void setItemText(LPCWSTR text); @@ -220,7 +259,13 @@ protected: virtual void updateHighlightAndScrollPositions(); virtual void updateVSlotPositions(int iSlots, int i); + virtual void initializeCraftingTabs(); + virtual void UpdateMultiPanel(); + virtual void UpdateCraftingPanels(); + + virtual void ShowSuperCraftingSlots(int iIndex); + virtual void SetCraftingMenu(); virtual void HandleMessage(EUIMessage message, void *data); void handleInventoryUpdated(LPVOID data); diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index 751b321f..51b58128 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -1544,7 +1544,7 @@ void Minecraft::run_middle() if(g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_CRAFTING) || g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_CRAFTING_ALT)) { - if ((ui.IsSceneInStack(i, eUIScene_Crafting2x2Menu) || ui.IsSceneInStack(i, eUIScene_Crafting3x3Menu) || ui.IsSceneInStack(i, eUIScene_CreativeMenu) || ui.IsSceneInStack(i, eUIScene_ClassicCraftingMenu) || isClosableByEitherKey) && !isEditing) + if ((ui.IsSceneInStack(i, eUIScene_CraftingMenu) || ui.IsSceneInStack(i, eUIScene_CreativeMenu) || ui.IsSceneInStack(i, eUIScene_ClassicCraftingMenu) || isClosableByEitherKey) && !isEditing) { ui.CloseUIScenes(i); } diff --git a/Minecraft.World/Item.h b/Minecraft.World/Item.h index 6b5e4bcd..d965084c 100644 --- a/Minecraft.World/Item.h +++ b/Minecraft.World/Item.h @@ -123,6 +123,7 @@ public: eBaseItemType_slab, eBaseItemType_halfslab, eBaseItemType_torch, + eBaseItemType_banner, eBaseItemType_bow, eBaseItemType_pockettool, eBaseItemType_utensil, diff --git a/Minecraft.World/Recipes.cpp b/Minecraft.World/Recipes.cpp index 80a34a08..cc838992 100644 --- a/Minecraft.World/Recipes.cpp +++ b/Minecraft.World/Recipes.cpp @@ -50,6 +50,19 @@ void Recipes::_compileRecipes() { recipies->push_back(new BannerPatternRecipe()); + //0-15, 16 colors + for (int i = 0; i < 16; i++) { + addShapedRecipy(new ItemInstance(Tile::standing_banner_Id, 1, i), // + L"sssczcig", + L"###", // + L"###", // + L" I ", // + + L'#', new ItemInstance(Tile::wool_Id, 1, i), + L'I', Item::stick, + L'B'); + } + addShapedRecipy(new ItemInstance(Tile::wood, 4, 0), // L"sczg", L"#", // @@ -1546,6 +1559,9 @@ ShapedRecipy *Recipes::addShapedRecipy(ItemInstance *result, ...) case L'F': group=ShapedRecipy::eGroupType_Food; break; + case L'B': + group=ShapedRecipy::eGroupType_Banner_CustomLogic; + break; case L'D': default: group=ShapedRecipy::eGroupType_Decoration; @@ -1642,6 +1658,9 @@ void Recipes::addShapelessRecipy(ItemInstance *result,... ) case L'F': group=Recipy::eGroupType_Food; break; + case L'B': + group=Recipy::eGroupType_Banner_CustomLogic; + break; case L'D': default: group=Recipy::eGroupType_Decoration; diff --git a/Minecraft.World/Recipy.h b/Minecraft.World/Recipy.h index b2ad0127..8cbd0d99 100644 --- a/Minecraft.World/Recipy.h +++ b/Minecraft.World/Recipy.h @@ -23,6 +23,7 @@ public: eGroupType_Mechanism, eGroupType_Transport, eGroupType_Decoration, + eGroupType_Banner_CustomLogic, eGroupType_Max } eGroupType; // to class the item produced by the recipe diff --git a/Minecraft.World/Tile.cpp b/Minecraft.World/Tile.cpp index a791ca81..937e5618 100644 --- a/Minecraft.World/Tile.cpp +++ b/Minecraft.World/Tile.cpp @@ -640,11 +640,11 @@ void Tile::staticCtor() Tile::double_plant = static_cast((new TallGrass2(175))->setDestroyTime(0.0f)->setSoundType(Tile::SOUND_GRASS)->setIconName(L"tallgrass2_tall_grass_upper")->setDescriptionId(IDS_DESC_DOUBLE_TALL_GRASS)->setUseDescriptionId(IDS_DESC_TALL_GRASS)->disableMipmap()->sendTileData(0xFF)); - Tile::standing_banner = static_cast((new BannerTile(176, true))->setDestroyTime(1.0f)->setSoundType(Tile::SOUND_WOOD)->setIconName(L"planks_oak")->setNotCollectStatistics()->sendTileData()->setUseDescriptionId(IDS_DESC_SIGN)); + Tile::standing_banner = static_cast((new BannerTile(176, true))->setBaseItemTypeAndMaterial(Item::eBaseItemType_banner, Item::eMaterial_cloth)->setDestroyTime(1.0f)->setSoundType(Tile::SOUND_WOOD)->setIconName(L"planks_oak")->setNotCollectStatistics()->sendTileData()->setUseDescriptionId(IDS_DESC_SIGN)); Tile::wall_banner = Tile::standing_banner; Tile::tiles[177] = Tile::standing_banner; - Item::items[standing_banner_Id] = (new BannerItem(standing_banner_Id - 256))->setIconName(L"sign")->setDescriptionId(IDS_TILE_BANNER)->setUseDescriptionId(IDS_DESC_SIGN); + Item::items[standing_banner_Id] = (new BannerItem(standing_banner_Id - 256))->setBaseItemTypeAndMaterial(Item::eBaseItemType_banner, Item::eMaterial_cloth)->setIconName(L"sign")->setDescriptionId(IDS_TILE_BANNER)->setUseDescriptionId(IDS_DESC_SIGN); // Special cases for certain items since they can have different icons Item::items[wool_Id] = ( new WoolTileItem(Tile::wool_Id- 256) )->setIconName(L"cloth")->setDescriptionId(IDS_TILE_CLOTH)->setUseDescriptionId(IDS_DESC_WOOL);