diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
| commit | b691c43c44ff180d10e7d4a9afc83b98551ff586 (patch) | |
| tree | 3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.Client/Common/UI/IUIScene_AnvilMenu.h | |
| parent | def8cb415354ac390b7e89052a50605285f1aca9 (diff) | |
Initial commit
Diffstat (limited to 'Minecraft.Client/Common/UI/IUIScene_AnvilMenu.h')
| -rw-r--r-- | Minecraft.Client/Common/UI/IUIScene_AnvilMenu.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Minecraft.Client/Common/UI/IUIScene_AnvilMenu.h b/Minecraft.Client/Common/UI/IUIScene_AnvilMenu.h new file mode 100644 index 00000000..6c4348f2 --- /dev/null +++ b/Minecraft.Client/Common/UI/IUIScene_AnvilMenu.h @@ -0,0 +1,45 @@ +#pragma once +#include "IUIScene_AbstractContainerMenu.h" +#include "..\..\..\Minecraft.World\net.minecraft.world.inventory.ContainerListener.h" + +// The 0-indexed slot in the inventory list that lines up with the result slot +#define ANVIL_SCENE_RESULT_SLOT_UP_OFFSET 5 +#define ANVIL_SCENE_RESULT_SLOT_DOWN_OFFSET 5 +#define ANVIL_SCENE_ITEM1_SLOT_UP_OFFSET 3 +#define ANVIL_SCENE_ITEM1_SLOT_DOWN_OFFSET 3 +#define ANVIL_SCENE_ITEM2_SLOT_UP_OFFSET 4 +#define ANVIL_SCENE_ITEM2_SLOT_DOWN_OFFSET 4 + +class Inventory; +class RepairMenu; + +class IUIScene_AnvilMenu : public virtual IUIScene_AbstractContainerMenu, public net_minecraft_world_inventory::ContainerListener +{ +protected: + shared_ptr<Inventory> m_inventory; + RepairMenu *m_repairMenu; + wstring m_itemName; + +protected: + IUIScene_AnvilMenu(); + + virtual ESceneSection GetSectionAndSlotInDirection( ESceneSection eSection, ETapState eTapDirection, int *piTargetX, int *piTargetY ); + int getSectionStartOffset(ESceneSection eSection); + virtual void handleOtherClicked(int iPad, ESceneSection eSection, int buttonNum, bool quickKey); + bool IsSectionSlotList( ESceneSection eSection ); + + void handleTick(); + + // Anvil only + virtual void handleEditNamePressed() = 0; + virtual void setEditNameValue(const wstring &name) = 0; + virtual void setEditNameEditable(bool enabled) = 0; + virtual void setCostLabel(const wstring &label, bool canAfford) = 0; + virtual void showCross(bool show) = 0; + void updateItemName(); + + // ContainerListenr + void refreshContainer(AbstractContainerMenu *container, vector<shared_ptr<ItemInstance> > *items); + void slotChanged(AbstractContainerMenu *container, int slotIndex, shared_ptr<ItemInstance> item); + void setContainerData(AbstractContainerMenu *container, int id, int value); +};
\ No newline at end of file |
