From b691c43c44ff180d10e7d4a9afc83b98551ff586 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 12:16:08 +0800 Subject: Initial commit --- Minecraft.Client/Common/XUI/XUI_Scene_Enchant.h | 78 +++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 Minecraft.Client/Common/XUI/XUI_Scene_Enchant.h (limited to 'Minecraft.Client/Common/XUI/XUI_Scene_Enchant.h') diff --git a/Minecraft.Client/Common/XUI/XUI_Scene_Enchant.h b/Minecraft.Client/Common/XUI/XUI_Scene_Enchant.h new file mode 100644 index 00000000..5cab04a4 --- /dev/null +++ b/Minecraft.Client/Common/XUI/XUI_Scene_Enchant.h @@ -0,0 +1,78 @@ +#pragma once +using namespace std; + +#include "..\Media\xuiscene_enchant.h" + +#include "..\..\BookModel.h" + +#include "XUI_Ctrl_SlotList.h" +#include "XUI_Ctrl_EnchantmentBook.h" +#include "XUI_Scene_AbstractContainer.h" +#include "..\UI\IUIScene_EnchantingMenu.h" +#include "XUI_CustomMessages.h" + +#include "XUI_Scene_Enchant.h" + +#include "..\..\..\Minecraft.World\AbstractContainerMenu.h" +#include "..\..\..\Minecraft.World\SimpleContainer.h" + +class Level; +class CXuiCtrlEnchantmentButton; +class EnchantmentMenu; + +//-------------------------------------------------------------------------------------- +// Scene implementation class. +//-------------------------------------------------------------------------------------- +class CXuiSceneEnchant : public CXuiSceneAbstractContainer, public IUIScene_EnchantingMenu +{ + friend class CXuiCtrlEnchantmentButtonText; +public: + // Define the class. The class name must match the ClassOverride property + // set for the scene in the UI Authoring tool. + XUI_IMPLEMENT_CLASS( CXuiSceneEnchant, L"CXuiSceneEnchant", XUI_CLASS_SCENE ) + +protected: + CXuiCtrlEnchantmentButton *m_enchant1; + CXuiCtrlEnchantmentButton *m_enchant2; + CXuiCtrlEnchantmentButton *m_enchant3; + CXuiControl m_sceneGroup; + CXuiCtrlSlotList* m_ingredientControl; + CXuiControl m_EnchantText; + + XUI_BEGIN_MSG_MAP() + XUI_ON_XM_INIT( OnInit ) + XUI_ON_XM_KEYDOWN( OnKeyDown ) + XUI_ON_XM_DESTROY( OnDestroy ) + XUI_ON_XM_TIMER( OnTimer ) // Poll stick input on a timer. + XUI_ON_XM_SPLITSCREENPLAYER_MESSAGE(OnCustomMessage_Splitscreenplayer) + XUI_ON_XM_TRANSITION_START(OnTransitionStart) + XUI_END_MSG_MAP() + + // Control mapping to objects + BEGIN_CONTROL_MAP() + MAP_CONTROL(IDC_Group, m_sceneGroup) + BEGIN_MAP_CHILD_CONTROLS( m_sceneGroup ) + // Common to all abstract container scenes + MAP_OVERRIDE(IDC_Inventory, m_inventoryControl) + MAP_OVERRIDE(IDC_UseRow, m_useRowControl) + MAP_OVERRIDE(IDC_Pointer, m_pointerControl) + MAP_CONTROL(IDC_InventoryText,m_InventoryText) + + MAP_OVERRIDE(IDC_Ingredient, m_ingredientControl) + MAP_OVERRIDE(IDC_EnchantButton1, m_enchant1) + MAP_OVERRIDE(IDC_EnchantButton2, m_enchant2) + MAP_OVERRIDE(IDC_EnchantButton3, m_enchant3) + MAP_CONTROL(IDC_EnchantText,m_EnchantText) + END_MAP_CHILD_CONTROLS() + END_CONTROL_MAP() + + HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); + HRESULT OnDestroy(); + + virtual void InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex = 0); + +private: + + virtual CXuiControl* GetSectionControl( ESceneSection eSection ); + virtual CXuiCtrlSlotList* GetSectionSlotList( ESceneSection eSection ); +}; \ No newline at end of file -- cgit v1.2.3