the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2
3#include "../media\xuiscene_DLCOffers.h"
4#include "../media\xuiscene_DLCMain.h"
5
6
7#include "XUI_CustomMessages.h"
8#include "XUI_Ctrl_4JList.h"
9#include "XUI_Ctrl_4JIcon.h"
10//#include "XUI_Ctrl_DLCPrice.h"
11
12class CXuiCtrl4JList;
13class CScene_DLCOffers;
14class CXuiCtrlDLCPrice;
15
16class CScene_DLCMain : public CXuiSceneImpl
17{
18 // Xui Elements
19 CXuiList xList;
20 CXuiCtrl4JList *list;
21 CXuiControl m_Timer;
22
23 // Misc
24 int iPad, iOfferC;
25
26 XUI_BEGIN_MSG_MAP()
27 XUI_ON_XM_INIT( OnInit )
28 XUI_ON_XM_DESTROY(OnDestroy)
29 XUI_ON_XM_KEYDOWN( OnKeyDown )
30 XUI_ON_XM_NOTIFY_PRESS_EX(OnNotifyPressEx)
31 XUI_ON_XM_NAV_RETURN(OnNavReturn)
32 XUI_ON_XM_TIMER( OnTimer )
33 XUI_END_MSG_MAP()
34
35 BEGIN_CONTROL_MAP()
36 MAP_CONTROL(IDC_XuiOffersList, xList)
37 MAP_CONTROL(IDC_Timer, m_Timer)
38 END_CONTROL_MAP()
39
40 HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled );
41 HRESULT OnDestroy();
42 HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled);
43 HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled);
44 HRESULT OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled);
45 HRESULT OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled );
46
47public:
48 XUI_IMPLEMENT_CLASS( CScene_DLCMain, L"CScene_DLCMain", XUI_CLASS_SCENE )
49
50private:
51 bool m_bAllDLCContentRetrieved;
52 bool m_bIgnoreInput;
53};
54
55class CScene_DLCOffers : public CXuiSceneImpl
56{
57protected:
58 //static const wstring DEFAULT_BANNER;
59
60 // Control and Element wrapper objects.
61 CXuiList m_List;
62 CXuiCtrl4JList *m_pOffersList;
63 CXuiImageElement m_Banner;
64 CXuiCtrl4JIcon m_TMSImage;
65 CXuiHtmlControl m_SellText;
66 CXuiControl m_PriceTag;
67 CXuiControl m_Timer;
68 HXUIBRUSH m_hXuiBrush;
69
70 // Message map. Here we tie messages to message handlers.
71 XUI_BEGIN_MSG_MAP()
72 XUI_ON_XM_INIT( OnInit )
73 XUI_ON_XM_NOTIFY_SELCHANGED( OnNotifySelChanged )
74 XUI_ON_XM_NOTIFY_PRESS_EX(OnNotifyPressEx)
75 XUI_ON_XM_KEYDOWN(OnKeyDown)
76 XUI_ON_XM_DESTROY(OnDestroy)
77 XUI_ON_XM_NAV_RETURN(OnNavReturn)
78 XUI_ON_XM_TIMER( OnTimer )
79 XUI_ON_XM_DLCINSTALLED_MESSAGE(OnCustomMessage_DLCInstalled)
80 XUI_ON_XM_GET_SOURCE_IMAGE( OnGetSourceDataImage )
81 XUI_END_MSG_MAP()
82
83 // Control mapping to objects
84 BEGIN_CONTROL_MAP()
85 MAP_CONTROL(IDC_XuiOffersList, m_List)
86 MAP_CONTROL(IDC_XuiHTMLSellText, m_SellText)
87 MAP_CONTROL(IDC_XuiDLCPriceTag, m_PriceTag)
88 MAP_CONTROL(IDC_XuiDLCBanner, m_TMSImage)
89 MAP_CONTROL(IDC_Timer, m_Timer)
90 END_CONTROL_MAP()
91
92 HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled );
93 HRESULT OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, BOOL& bHandled );
94 HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled);
95 HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled);
96 HRESULT OnDestroy();
97 HRESULT OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled);
98 HRESULT OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled );
99 HRESULT OnCustomMessage_DLCInstalled();
100 HRESULT OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,BOOL& bHandled);
101
102 HRESULT GetDLCInfo( int iOfferC, bool bUpdateOnly=false );
103
104 //static int EthernetDisconnectReturned(void *pParam,int iPad,const C4JStorage::EMessageResult);
105 static int TMSReadCallback(void *pParam,int iPad,bool bResult);
106
107 //void UpdateTooltips(XMARKETPLACE_CONTENTOFFER_INFO& xOffer);
108 void UpdateTooltips(XMARKETPLACE_CURRENCY_CONTENTOFFER_INFO& xOffer);
109public:
110
111 // Define the class. The class name must match the ClassOverride property
112 // set for the scene in the UI Authoring tool.
113 XUI_IMPLEMENT_CLASS( CScene_DLCOffers, L"CScene_DLCOffers", XUI_CLASS_SCENE )
114
115 typedef struct _DLCOffer
116 {
117 int iOfferC;
118 }
119 DLCOffer;
120
121private:
122
123 //vector<int> offerIndexes;
124 CScene_DLCMain *pMain;
125 bool m_bIgnorePress;
126 int m_iPad;
127 int m_iOfferC;
128 int m_iType;
129 bool m_bIsSD;
130 bool m_bAllDLCContentRetrieved;
131 bool m_bDLCRequiredIsRetrieved;
132 bool m_bIsFemale; // to only show the correct gender type offers for avatars
133 DLC_INFO *m_pNoImageFor_DLC;
134 bool bNoDLCToDisplay; // to display a default "No DLC available at this time"
135
136};