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/XUI/XUI_Ctrl_MinecraftSlot.h | |
| parent | def8cb415354ac390b7e89052a50605285f1aca9 (diff) | |
Initial commit
Diffstat (limited to 'Minecraft.Client/Common/XUI/XUI_Ctrl_MinecraftSlot.h')
| -rw-r--r-- | Minecraft.Client/Common/XUI/XUI_Ctrl_MinecraftSlot.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/Minecraft.Client/Common/XUI/XUI_Ctrl_MinecraftSlot.h b/Minecraft.Client/Common/XUI/XUI_Ctrl_MinecraftSlot.h new file mode 100644 index 00000000..5dafec53 --- /dev/null +++ b/Minecraft.Client/Common/XUI/XUI_Ctrl_MinecraftSlot.h @@ -0,0 +1,59 @@ +#pragma once + +#include <string> +#include <XuiApp.h> + +using namespace std; + +class TileRenderer; +class ItemRenderer; + +//----------------------------------------------------------------------------- +// CXuiCtrlMinecraftSlot class +//----------------------------------------------------------------------------- +class CXuiCtrlMinecraftSlot : public CXuiControlImpl +{ +public: + XUI_IMPLEMENT_CLASS(CXuiCtrlMinecraftSlot, L"CXuiCtrlMinecraftSlot", XUI_CLASS_LABEL) + + VOID SetPassThroughDataAssociation(unsigned int iID, unsigned int iData); + CXuiCtrlMinecraftSlot(); + virtual ~CXuiCtrlMinecraftSlot(); + + void renderGuiItem(Font *font, Textures *textures,ItemInstance *item, int x, int y); + void RenderItem(); + void SetIcon(int iPad, int iId,int iAuxVal, int iCount, int iScale, unsigned int uiAlpha,bool bDecorations,BOOL bShow, bool isFoil); + void SetIcon(int iPad, shared_ptr<ItemInstance> item, int iScale, unsigned int uiAlpha,bool bDecorations, BOOL bShow=TRUE); + +protected: + + XUI_BEGIN_MSG_MAP() + XUI_ON_XM_INIT(OnInit) + XUI_ON_XM_GET_SOURCE_IMAGE(OnGetSourceImage) + XUI_ON_XM_RENDER(OnRender) + XUI_END_MSG_MAP() + + HRESULT OnGetSourceImage(XUIMessageGetSourceImage* pData, BOOL& rfHandled); + HRESULT OnInit(XUIMessageInit* pInitData, BOOL& rfHandled); + HRESULT OnRender(XUIMessageRender *pRenderData, BOOL &rfHandled); + +private: + shared_ptr<ItemInstance> m_item; + BOOL m_bDirty; + INT m_iPassThroughDataAssociation; + INT m_iPassThroughIdAssociation; + float m_fScale,m_fAlpha; + int m_iPad; + int m_iID; + int m_iCount; + int m_iAuxVal; + bool m_bDecorations; + bool m_isFoil; + int m_popTime; + + bool m_bScreenWidthSetup; + float m_fScreenWidth,m_fScreenHeight; + ItemRenderer *m_pItemRenderer; + + static LPCWSTR xzpIcons[15]; +};
\ No newline at end of file |
