the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 88 lines 3.1 kB view raw
1#pragma once 2using namespace std; 3#include "..\Media\xuiscene_anvil.h" 4#include "XUI_Scene_AbstractContainer.h" 5#include "..\UI\IUIScene_AnvilMenu.h" 6#include "Common\XUI\XUI_Ctrl_4JEdit.h" 7 8#define ANVIL_UPDATE_TIMER_ID (10) 9#define ANVIL_UPDATE_TIMER_TIME (1000) // 1 second 10 11//-------------------------------------------------------------------------------------- 12// Scene implementation class. 13//-------------------------------------------------------------------------------------- 14class CXuiSceneAnvil : public CXuiSceneAbstractContainer, public IUIScene_AnvilMenu 15{ 16public: 17 18 // Define the class. The class name must match the ClassOverride property 19 // set for the scene in the UI Authoring tool. 20 XUI_IMPLEMENT_CLASS( CXuiSceneAnvil, L"CXuiSceneAnvil", XUI_CLASS_SCENE ) 21 22protected: 23 XUI_BEGIN_MSG_MAP() 24 XUI_ON_XM_INIT( OnInit ) 25 XUI_ON_XM_KEYDOWN( OnKeyDown ) 26 XUI_ON_XM_DESTROY( OnDestroy ) 27 XUI_ON_XM_TIMER( OnTimer ) // Poll stick input on a timer. 28 XUI_ON_XM_TRANSITION_START(OnTransitionStart) 29 XUI_ON_XM_NOTIFY_VALUE_CHANGED(OnNotifyValueChanged) 30 XUI_ON_XM_SPLITSCREENPLAYER_MESSAGE(OnCustomMessage_Splitscreenplayer) 31 32 XUI_END_MSG_MAP() 33 34 // Control mapping to objects 35 BEGIN_CONTROL_MAP() 36 MAP_CONTROL(IDC_Group, m_sceneGroup) 37 BEGIN_MAP_CHILD_CONTROLS( m_sceneGroup ) 38 // Common to all abstract container scenes 39 MAP_OVERRIDE(IDC_Inventory, m_inventoryControl) 40 MAP_OVERRIDE(IDC_UseRow, m_useRowControl) 41 MAP_OVERRIDE(IDC_Pointer, m_pointerControl) 42 MAP_CONTROL(IDC_InventoryText,m_InventoryText) 43 44 MAP_OVERRIDE(IDC_Ingredient, m_ingredient1Control) 45 MAP_OVERRIDE(IDC_Ingredient2, m_ingredient2Control) 46 MAP_OVERRIDE(IDC_Result, m_resultControl) 47 48 MAP_CONTROL(IDC_AnvilTextInput, m_editName) 49 50 MAP_CONTROL(IDC_AnvilText,m_anvilText) 51 MAP_CONTROL(IDC_LabelAffordable,m_affordableText) 52 MAP_CONTROL(IDC_LabelExpensive,m_expensiveText) 53 MAP_CONTROL(IDC_AnvilCross,m_cross) 54 END_MAP_CHILD_CONTROLS() 55 END_CONTROL_MAP() 56 57 HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); 58 HRESULT OnDestroy(); 59 HRESULT OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyValueChanged* pValueChangedData, BOOL& rfHandled); 60// HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); 61 62 virtual HRESULT handleCustomTimer( XUIMessageTimer *pTimer, BOOL& bHandled ); 63 64 virtual void InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex = 0); 65 66private: 67 CXuiCtrlSlotList *m_ingredient1Control; 68 CXuiCtrlSlotList *m_ingredient2Control; 69 CXuiCtrlSlotList *m_resultControl; 70 71 CXuiCtrl4JEdit m_editName; 72 73 CXuiControl m_anvilText; 74 CXuiControl m_affordableText; 75 CXuiControl m_expensiveText; 76 CXuiControl m_cross; 77 CXuiControl m_sceneGroup; 78 79 virtual CXuiControl* GetSectionControl( ESceneSection eSection ); 80 virtual CXuiCtrlSlotList* GetSectionSlotList( ESceneSection eSection ); 81 82protected: 83 virtual void handleEditNamePressed(); 84 virtual void setEditNameValue(const wstring &name); 85 virtual void setEditNameEditable(bool enabled); 86 virtual void setCostLabel(const wstring &label, bool canAfford); 87 virtual void showCross(bool show); 88};