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_base.h"
4#include "XUI_Ctrl_SlotItem.h"
5#include "XUI_CustomMessages.h"
6#include "..\UI\UIEnums.h"
7#include "..\..\..\Minecraft.World\SoundTypes.h"
8
9#define BUTTON_TOOLTIP_A 0
10#define BUTTON_TOOLTIP_B 1
11#define BUTTON_TOOLTIP_X 2
12#define BUTTON_TOOLTIP_Y 3
13#define BUTTON_TOOLTIP_LT 4
14#define BUTTON_TOOLTIP_RT 5
15#define BUTTON_TOOLTIP_LB 6
16#define BUTTON_TOOLTIP_RB 7
17#define BUTTON_TOOLTIP_LS 8
18#define BUTTONS_TOOLTIP_MAX 9
19
20#define SFX_BACK 0
21#define SFX_CRAFT 1
22#define SFX_CRAFTFAIL 2
23#define SFX_FOCUS 3
24#define SFX_PRESS 4
25#define SFX_SCROLL 5
26#define SFX_MAX 6
27
28
29// This should be our target screen height and width
30#define XUI_BASE_SCENE_WIDTH 1280.0f
31#define XUI_BASE_SCENE_HEIGHT 720.0f
32
33#define XUI_BASE_SCENE_WIDTH_HALF 640.0f
34#define XUI_BASE_SCENE_HEIGHT_HALF 360.0f
35#define XUI_BASE_SCENE_WIDTH_QUARTER 320.0f
36#define XUI_BASE_SCENE_HEIGHT_QUARTER 180.0f
37#define SAFEZONE_HALF_HEIGHT 36.0f
38#define SAFEZONE_HALF_WIDTH 64.0f
39
40// How much we scale each base for splitscreen (should be 0.5f)
41#define XUI_BASE_SPLITSCREEN_SCALE 1.0f//0.5f // 4J-PB - TODO - move scenes instead
42
43// We make the tooltips bigger as they are unreadable when scaled by the above
44#define XUI_BASE_SPLIT_TOOLTIPS_SCALE 1.0f//1.5f
45
46// The percentage of starting size that the tooltips grow by
47#define XUI_BASE_SPLIT_TOOLTIPS_DIFF (XUI_BASE_SPLIT_TOOLTIPS_SCALE - 1.0f)
48
49class CXuiSceneBase : public CXuiSceneImpl
50{
51public:
52 enum EBaseScenePosition
53 {
54 e_BaseScene_NotSet,
55
56 // 1 player
57 e_BaseScene_Fullscreen,
58
59 // 2 Player split-screen
60 e_BaseScene_Top,
61 e_BaseScene_Bottom,
62 e_BaseScene_Left,
63 e_BaseScene_Right,
64
65 // 3/4 Player split-screen
66 e_BaseScene_Top_Left,
67 e_BaseScene_Top_Right,
68 e_BaseScene_Bottom_Left,
69 e_BaseScene_Bottom_Right,
70 };
71
72protected:
73 static const int m_iTooltipSpacingGap=10;
74 static const int m_iTooltipSpacingGapSmall=5;
75 D3DXVECTOR3 m_vPosTextInTooltip[BUTTONS_TOOLTIP_MAX];
76 D3DXVECTOR3 m_vPosTextInTooltipSmall[BUTTONS_TOOLTIP_MAX];
77 D3DXVECTOR3 vLogoPosA[XUSER_MAX_COUNT];
78
79 // We have a group of these per player
80 CXuiScene m_BasePlayerScene[XUSER_MAX_COUNT];
81 // Control and Element wrapper objects.
82 CXuiControl m_TooltipGroup[XUSER_MAX_COUNT];
83 CXuiControl m_Buttons[XUSER_MAX_COUNT][BUTTONS_TOOLTIP_MAX];
84 CXuiControl m_TooltipGroupSmall[XUSER_MAX_COUNT];
85 CXuiControl m_ButtonsSmall[XUSER_MAX_COUNT][BUTTONS_TOOLTIP_MAX];
86 CXuiControl m_bottomLeftAnchorPoint[XUSER_MAX_COUNT];
87 CXuiControl m_topLeftAnchorPoint[XUSER_MAX_COUNT];
88 CXuiControl m_SavingIcon;
89 CXuiControl m_Background[XUSER_MAX_COUNT];
90 CXuiControl m_DarkOverlay[XUSER_MAX_COUNT];
91 CXuiControl m_Logo[XUSER_MAX_COUNT];
92 CXuiControl m_CrouchIcon[XUSER_MAX_COUNT];
93 CXuiControl m_PressStart;
94 CXuiControl m_TrialTimer;
95 CXuiControl m_SafeArea;
96 CXuiControl m_BossHealthGroup[XUSER_MAX_COUNT];
97 CXuiControl m_BossHealthText[XUSER_MAX_COUNT];
98 CXuiProgressBar *m_pBossHealthProgress;
99 CXuiProgressBar m_BossHealthProgress1[XUSER_MAX_COUNT];
100 CXuiProgressBar m_BossHealthProgress2[XUSER_MAX_COUNT];
101 CXuiProgressBar m_BossHealthProgress3[XUSER_MAX_COUNT];
102 CXuiProgressBar m_BossHealthProgress1_small[XUSER_MAX_COUNT];
103 CXuiProgressBar m_BossHealthProgress2_small[XUSER_MAX_COUNT];
104 CXuiProgressBar m_BossHealthProgress3_small[XUSER_MAX_COUNT];
105 int m_ticksWithNoBoss;
106 CXuiSound m_SFXA[SFX_MAX];
107 HXUIOBJ m_hEmptyQuadrantLogo;
108 HXUIOBJ m_hGamerTagA[XUSER_MAX_COUNT];
109 CXuiControl m_selectedItemA[XUSER_MAX_COUNT];
110 CXuiControl m_selectedItemSmallA[XUSER_MAX_COUNT];
111
112 BOOL m_visible[XUSER_MAX_COUNT][BUTTONS_TOOLTIP_MAX];
113 BOOL m_bossHealthVisible[XUSER_MAX_COUNT];
114 int m_iWrongTexturePackTickC;
115
116 // Message map. Here we tie messages to message handlers.
117 XUI_BEGIN_MSG_MAP()
118 XUI_ON_XM_INIT( OnInit )
119 XUI_ON_XM_TIMER( OnTimer )
120 XUI_ON_XM_SKIN_CHANGED( OnSkinChanged )
121// XUI_ON_XM_DLCINSTALLED_MESSAGE(OnCustomMessage_DLCInstalled)
122// XUI_ON_XM_DLCLOADED_MESSAGE(OnCustomMessage_DLCMountingComplete)
123 XUI_END_MSG_MAP()
124
125 // Control mapping to objects
126 BEGIN_CONTROL_MAP()
127 MAP_CONTROL(IDC_XuiPressStartMessage, m_PressStart)
128 MAP_CONTROL(IDC_XuiTrialTimer, m_TrialTimer)
129 MAP_CONTROL(IDC_XuiSavingIcon, m_SavingIcon)
130 MAP_CONTROL(IDC_SafeArea, m_SafeArea)
131 MAP_CONTROL(IDC_XuiSoundXACTBack, m_SFXA[SFX_BACK])
132 MAP_CONTROL(IDC_XuiSoundXACTCraft,m_SFXA[SFX_CRAFT])
133 MAP_CONTROL(IDC_XuiSoundXACTCraftFail,m_SFXA[SFX_CRAFTFAIL])
134 MAP_CONTROL(IDC_XuiSoundXACTPress,m_SFXA[SFX_PRESS])
135 MAP_CONTROL(IDC_XuiSoundXACTFocus,m_SFXA[SFX_FOCUS])
136 MAP_CONTROL(IDC_XuiSoundXACTScroll,m_SFXA[SFX_SCROLL])
137
138 //MAP_CONTROL(IDC_BossHealth, m_BossHealthGroup)
139 //BEGIN_MAP_CHILD_CONTROLS(m_BossHealthGroup)
140 // MAP_CONTROL(IDC_TitleText, m_BossHealthText)
141 // MAP_CONTROL(IDC_ProgressBar, m_BossHealthProgress)
142 //END_MAP_CHILD_CONTROLS()
143
144 MAP_CONTROL(IDC_BasePlayer0, m_BasePlayerScene[0])
145 BEGIN_MAP_CHILD_CONTROLS(m_BasePlayerScene[0])
146 MAP_CONTROL(IDC_BottomLeftAnchorPoint, m_bottomLeftAnchorPoint[0])
147 MAP_CONTROL(IDC_TopLeftAnchorPoint, m_topLeftAnchorPoint[0])
148 MAP_CONTROL(IDC_Tooltips, m_TooltipGroup[0])
149 BEGIN_MAP_CHILD_CONTROLS(m_TooltipGroup[0])
150 MAP_CONTROL(IDC_AButton, m_Buttons[0][BUTTON_TOOLTIP_A])
151 MAP_CONTROL(IDC_BButton, m_Buttons[0][BUTTON_TOOLTIP_B])
152 MAP_CONTROL(IDC_XButton, m_Buttons[0][BUTTON_TOOLTIP_X])
153 MAP_CONTROL(IDC_YButton, m_Buttons[0][BUTTON_TOOLTIP_Y])
154 MAP_CONTROL(IDC_LTrigger, m_Buttons[0][BUTTON_TOOLTIP_LT])
155 MAP_CONTROL(IDC_RTrigger, m_Buttons[0][BUTTON_TOOLTIP_RT])
156 MAP_CONTROL(IDC_RBButton, m_Buttons[0][BUTTON_TOOLTIP_RB])
157 MAP_CONTROL(IDC_LBButton, m_Buttons[0][BUTTON_TOOLTIP_LB])
158 MAP_CONTROL(IDC_LStick, m_Buttons[0][BUTTON_TOOLTIP_LS])
159 END_MAP_CHILD_CONTROLS()
160 MAP_CONTROL(IDC_TooltipsSmall, m_TooltipGroupSmall[0])
161 BEGIN_MAP_CHILD_CONTROLS(m_TooltipGroupSmall[0])
162 MAP_CONTROL(IDC_AButton, m_ButtonsSmall[0][BUTTON_TOOLTIP_A])
163 MAP_CONTROL(IDC_BButton, m_ButtonsSmall[0][BUTTON_TOOLTIP_B])
164 MAP_CONTROL(IDC_XButton, m_ButtonsSmall[0][BUTTON_TOOLTIP_X])
165 MAP_CONTROL(IDC_YButton, m_ButtonsSmall[0][BUTTON_TOOLTIP_Y])
166 MAP_CONTROL(IDC_LTrigger, m_ButtonsSmall[0][BUTTON_TOOLTIP_LT])
167 MAP_CONTROL(IDC_RTrigger, m_ButtonsSmall[0][BUTTON_TOOLTIP_RT])
168 MAP_CONTROL(IDC_RBButton, m_ButtonsSmall[0][BUTTON_TOOLTIP_RB])
169 MAP_CONTROL(IDC_LBButton, m_ButtonsSmall[0][BUTTON_TOOLTIP_LB])
170 MAP_CONTROL(IDC_LStick, m_ButtonsSmall[0][BUTTON_TOOLTIP_LS])
171 END_MAP_CHILD_CONTROLS()
172 MAP_CONTROL(IDC_Background, m_Background[0])
173 MAP_CONTROL(IDC_XuiDarkOverlay, m_DarkOverlay[0])
174 MAP_CONTROL(IDC_Logo, m_Logo[0])
175 MAP_CONTROL(IDC_SelectedItem, m_selectedItemA[0])
176 MAP_CONTROL(IDC_SelectedItemSmall, m_selectedItemSmallA[0])
177 MAP_CONTROL(IDC_BossHealth, m_BossHealthGroup[0])
178 BEGIN_MAP_CHILD_CONTROLS(m_BossHealthGroup[0])
179 MAP_CONTROL(IDC_TitleText, m_BossHealthText[0])
180 MAP_CONTROL(IDC_ProgressBar1, m_BossHealthProgress1[0])
181 MAP_CONTROL(IDC_ProgressBar2, m_BossHealthProgress2[0])
182 MAP_CONTROL(IDC_ProgressBar3, m_BossHealthProgress3[0])
183 MAP_CONTROL(IDC_ProgressBar1_small, m_BossHealthProgress1_small[0])
184 MAP_CONTROL(IDC_ProgressBar2_small, m_BossHealthProgress2_small[0])
185 MAP_CONTROL(IDC_ProgressBar3_small, m_BossHealthProgress3_small[0])
186 END_MAP_CHILD_CONTROLS()
187 END_MAP_CHILD_CONTROLS()
188
189 MAP_CONTROL(IDC_BasePlayer1, m_BasePlayerScene[1])
190 BEGIN_MAP_CHILD_CONTROLS(m_BasePlayerScene[1])
191 MAP_CONTROL(IDC_BottomLeftAnchorPoint, m_bottomLeftAnchorPoint[1])
192 MAP_CONTROL(IDC_TopLeftAnchorPoint, m_topLeftAnchorPoint[1])
193 MAP_CONTROL(IDC_Tooltips, m_TooltipGroup[1])
194 BEGIN_MAP_CHILD_CONTROLS(m_TooltipGroup[1])
195 MAP_CONTROL(IDC_AButton, m_Buttons[1][BUTTON_TOOLTIP_A])
196 MAP_CONTROL(IDC_BButton, m_Buttons[1][BUTTON_TOOLTIP_B])
197 MAP_CONTROL(IDC_XButton, m_Buttons[1][BUTTON_TOOLTIP_X])
198 MAP_CONTROL(IDC_YButton, m_Buttons[1][BUTTON_TOOLTIP_Y])
199 MAP_CONTROL(IDC_LTrigger, m_Buttons[1][BUTTON_TOOLTIP_LT])
200 MAP_CONTROL(IDC_RTrigger, m_Buttons[1][BUTTON_TOOLTIP_RT])
201 MAP_CONTROL(IDC_RBButton, m_Buttons[1][BUTTON_TOOLTIP_RB])
202 MAP_CONTROL(IDC_LBButton, m_Buttons[1][BUTTON_TOOLTIP_LB])
203 MAP_CONTROL(IDC_LStick, m_Buttons[1][BUTTON_TOOLTIP_LS])
204 END_MAP_CHILD_CONTROLS()
205 MAP_CONTROL(IDC_TooltipsSmall, m_TooltipGroupSmall[1])
206 BEGIN_MAP_CHILD_CONTROLS(m_TooltipGroupSmall[1])
207 MAP_CONTROL(IDC_AButton, m_ButtonsSmall[1][BUTTON_TOOLTIP_A])
208 MAP_CONTROL(IDC_BButton, m_ButtonsSmall[1][BUTTON_TOOLTIP_B])
209 MAP_CONTROL(IDC_XButton, m_ButtonsSmall[1][BUTTON_TOOLTIP_X])
210 MAP_CONTROL(IDC_YButton, m_ButtonsSmall[1][BUTTON_TOOLTIP_Y])
211 MAP_CONTROL(IDC_LTrigger, m_ButtonsSmall[1][BUTTON_TOOLTIP_LT])
212 MAP_CONTROL(IDC_RTrigger, m_ButtonsSmall[1][BUTTON_TOOLTIP_RT])
213 MAP_CONTROL(IDC_RBButton, m_ButtonsSmall[1][BUTTON_TOOLTIP_RB])
214 MAP_CONTROL(IDC_LBButton, m_ButtonsSmall[1][BUTTON_TOOLTIP_LB])
215 MAP_CONTROL(IDC_LStick, m_ButtonsSmall[1][BUTTON_TOOLTIP_LS])
216 END_MAP_CHILD_CONTROLS()
217 MAP_CONTROL(IDC_Background, m_Background[1])
218 MAP_CONTROL(IDC_XuiDarkOverlay, m_DarkOverlay[1])
219 MAP_CONTROL(IDC_Logo, m_Logo[1])
220 MAP_CONTROL(IDC_SelectedItem, m_selectedItemA[1])
221 MAP_CONTROL(IDC_SelectedItemSmall, m_selectedItemSmallA[1])
222 MAP_CONTROL(IDC_BossHealth, m_BossHealthGroup[1])
223 BEGIN_MAP_CHILD_CONTROLS(m_BossHealthGroup[1])
224 MAP_CONTROL(IDC_TitleText, m_BossHealthText[1])
225 MAP_CONTROL(IDC_ProgressBar1, m_BossHealthProgress1[1])
226 MAP_CONTROL(IDC_ProgressBar2, m_BossHealthProgress2[1])
227 MAP_CONTROL(IDC_ProgressBar3, m_BossHealthProgress3[1])
228 MAP_CONTROL(IDC_ProgressBar1_small, m_BossHealthProgress1_small[1])
229 MAP_CONTROL(IDC_ProgressBar2_small, m_BossHealthProgress2_small[1])
230 MAP_CONTROL(IDC_ProgressBar3_small, m_BossHealthProgress3_small[1])
231 END_MAP_CHILD_CONTROLS()
232 END_MAP_CHILD_CONTROLS()
233
234 MAP_CONTROL(IDC_BasePlayer2, m_BasePlayerScene[2])
235 BEGIN_MAP_CHILD_CONTROLS(m_BasePlayerScene[2])
236 MAP_CONTROL(IDC_BottomLeftAnchorPoint, m_bottomLeftAnchorPoint[2])
237 MAP_CONTROL(IDC_TopLeftAnchorPoint, m_topLeftAnchorPoint[2])
238 MAP_CONTROL(IDC_Tooltips, m_TooltipGroup[2])
239 BEGIN_MAP_CHILD_CONTROLS(m_TooltipGroup[2])
240 MAP_CONTROL(IDC_AButton, m_Buttons[2][BUTTON_TOOLTIP_A])
241 MAP_CONTROL(IDC_BButton, m_Buttons[2][BUTTON_TOOLTIP_B])
242 MAP_CONTROL(IDC_XButton, m_Buttons[2][BUTTON_TOOLTIP_X])
243 MAP_CONTROL(IDC_YButton, m_Buttons[2][BUTTON_TOOLTIP_Y])
244 MAP_CONTROL(IDC_LTrigger, m_Buttons[2][BUTTON_TOOLTIP_LT])
245 MAP_CONTROL(IDC_RTrigger, m_Buttons[2][BUTTON_TOOLTIP_RT])
246 MAP_CONTROL(IDC_RBButton, m_Buttons[2][BUTTON_TOOLTIP_RB])
247 MAP_CONTROL(IDC_LBButton, m_Buttons[2][BUTTON_TOOLTIP_LB])
248 MAP_CONTROL(IDC_LStick, m_Buttons[2][BUTTON_TOOLTIP_LS])
249 END_MAP_CHILD_CONTROLS()
250 MAP_CONTROL(IDC_TooltipsSmall, m_TooltipGroupSmall[2])
251 BEGIN_MAP_CHILD_CONTROLS(m_TooltipGroupSmall[2])
252 MAP_CONTROL(IDC_AButton, m_ButtonsSmall[2][BUTTON_TOOLTIP_A])
253 MAP_CONTROL(IDC_BButton, m_ButtonsSmall[2][BUTTON_TOOLTIP_B])
254 MAP_CONTROL(IDC_XButton, m_ButtonsSmall[2][BUTTON_TOOLTIP_X])
255 MAP_CONTROL(IDC_YButton, m_ButtonsSmall[2][BUTTON_TOOLTIP_Y])
256 MAP_CONTROL(IDC_LTrigger, m_ButtonsSmall[2][BUTTON_TOOLTIP_LT])
257 MAP_CONTROL(IDC_RTrigger, m_ButtonsSmall[2][BUTTON_TOOLTIP_RT])
258 MAP_CONTROL(IDC_RBButton, m_ButtonsSmall[2][BUTTON_TOOLTIP_RB])
259 MAP_CONTROL(IDC_LBButton, m_ButtonsSmall[2][BUTTON_TOOLTIP_LB])
260 MAP_CONTROL(IDC_LStick, m_ButtonsSmall[2][BUTTON_TOOLTIP_LS])
261 END_MAP_CHILD_CONTROLS()
262 MAP_CONTROL(IDC_Background, m_Background[2])
263 MAP_CONTROL(IDC_XuiDarkOverlay, m_DarkOverlay[2])
264 MAP_CONTROL(IDC_Logo, m_Logo[2])
265 MAP_CONTROL(IDC_SelectedItem, m_selectedItemA[2])
266 MAP_CONTROL(IDC_SelectedItemSmall, m_selectedItemSmallA[2])
267 MAP_CONTROL(IDC_BossHealth, m_BossHealthGroup[2])
268 BEGIN_MAP_CHILD_CONTROLS(m_BossHealthGroup[2])
269 MAP_CONTROL(IDC_TitleText, m_BossHealthText[2])
270 MAP_CONTROL(IDC_ProgressBar1, m_BossHealthProgress1[2])
271 MAP_CONTROL(IDC_ProgressBar2, m_BossHealthProgress2[2])
272 MAP_CONTROL(IDC_ProgressBar3, m_BossHealthProgress3[2])
273 MAP_CONTROL(IDC_ProgressBar1_small, m_BossHealthProgress1_small[2])
274 MAP_CONTROL(IDC_ProgressBar2_small, m_BossHealthProgress2_small[2])
275 MAP_CONTROL(IDC_ProgressBar3_small, m_BossHealthProgress3_small[2])
276 END_MAP_CHILD_CONTROLS()
277 END_MAP_CHILD_CONTROLS()
278
279 MAP_CONTROL(IDC_BasePlayer3, m_BasePlayerScene[3])
280 BEGIN_MAP_CHILD_CONTROLS(m_BasePlayerScene[3])
281 MAP_CONTROL(IDC_BottomLeftAnchorPoint, m_bottomLeftAnchorPoint[3])
282 MAP_CONTROL(IDC_TopLeftAnchorPoint, m_topLeftAnchorPoint[3])
283 MAP_CONTROL(IDC_Tooltips, m_TooltipGroup[3])
284 BEGIN_MAP_CHILD_CONTROLS(m_TooltipGroup[3])
285 MAP_CONTROL(IDC_AButton, m_Buttons[3][BUTTON_TOOLTIP_A])
286 MAP_CONTROL(IDC_BButton, m_Buttons[3][BUTTON_TOOLTIP_B])
287 MAP_CONTROL(IDC_XButton, m_Buttons[3][BUTTON_TOOLTIP_X])
288 MAP_CONTROL(IDC_YButton, m_Buttons[3][BUTTON_TOOLTIP_Y])
289 MAP_CONTROL(IDC_LTrigger, m_Buttons[3][BUTTON_TOOLTIP_LT])
290 MAP_CONTROL(IDC_RTrigger, m_Buttons[3][BUTTON_TOOLTIP_RT])
291 MAP_CONTROL(IDC_RBButton, m_Buttons[3][BUTTON_TOOLTIP_RB])
292 MAP_CONTROL(IDC_LBButton, m_Buttons[3][BUTTON_TOOLTIP_LB])
293 MAP_CONTROL(IDC_LStick, m_Buttons[3][BUTTON_TOOLTIP_LS])
294 END_MAP_CHILD_CONTROLS()
295 MAP_CONTROL(IDC_TooltipsSmall, m_TooltipGroupSmall[3])
296 BEGIN_MAP_CHILD_CONTROLS(m_TooltipGroupSmall[3])
297 MAP_CONTROL(IDC_AButton, m_ButtonsSmall[3][BUTTON_TOOLTIP_A])
298 MAP_CONTROL(IDC_BButton, m_ButtonsSmall[3][BUTTON_TOOLTIP_B])
299 MAP_CONTROL(IDC_XButton, m_ButtonsSmall[3][BUTTON_TOOLTIP_X])
300 MAP_CONTROL(IDC_YButton, m_ButtonsSmall[3][BUTTON_TOOLTIP_Y])
301 MAP_CONTROL(IDC_LTrigger, m_ButtonsSmall[3][BUTTON_TOOLTIP_LT])
302 MAP_CONTROL(IDC_RTrigger, m_ButtonsSmall[3][BUTTON_TOOLTIP_RT])
303 MAP_CONTROL(IDC_RBButton, m_ButtonsSmall[3][BUTTON_TOOLTIP_RB])
304 MAP_CONTROL(IDC_LBButton, m_ButtonsSmall[3][BUTTON_TOOLTIP_LB])
305 MAP_CONTROL(IDC_LStick, m_Buttons[3][BUTTON_TOOLTIP_LS])
306 END_MAP_CHILD_CONTROLS()
307 MAP_CONTROL(IDC_Background, m_Background[3])
308 MAP_CONTROL(IDC_XuiDarkOverlay, m_DarkOverlay[3])
309 MAP_CONTROL(IDC_Logo, m_Logo[3])
310 MAP_CONTROL(IDC_SelectedItem, m_selectedItemA[3])
311 MAP_CONTROL(IDC_SelectedItemSmall, m_selectedItemSmallA[3])
312 MAP_CONTROL(IDC_BossHealth, m_BossHealthGroup[3])
313 BEGIN_MAP_CHILD_CONTROLS(m_BossHealthGroup[3])
314 MAP_CONTROL(IDC_TitleText, m_BossHealthText[3])
315 MAP_CONTROL(IDC_ProgressBar1, m_BossHealthProgress1[3])
316 MAP_CONTROL(IDC_ProgressBar2, m_BossHealthProgress2[3])
317 MAP_CONTROL(IDC_ProgressBar3, m_BossHealthProgress3[3])
318 MAP_CONTROL(IDC_ProgressBar1_small, m_BossHealthProgress1_small[3])
319 MAP_CONTROL(IDC_ProgressBar2_small, m_BossHealthProgress2_small[3])
320 MAP_CONTROL(IDC_ProgressBar3_small, m_BossHealthProgress3_small[3])
321 END_MAP_CHILD_CONTROLS()
322 END_MAP_CHILD_CONTROLS()
323
324 END_CONTROL_MAP()
325
326 HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled );
327 HRESULT OnTimer(XUIMessageTimer *pData,BOOL& rfHandled);
328 HRESULT OnSkinChanged(BOOL& bHandled);
329// HRESULT OnCustomMessage_DLCInstalled();
330// HRESULT OnCustomMessage_DLCMountingComplete();
331
332public:
333 // Define the class. The class name must match the ClassOverride property
334 // set for the scene in the UI Authoring tool.
335 XUI_IMPLEMENT_CLASS( CXuiSceneBase, L"CXuiSceneBase", XUI_CLASS_SCENE )
336
337private:
338 void _TickAllBaseScenes();
339 HRESULT _SetTooltipText( unsigned int iPad, unsigned int tooltip, int iTextID );
340 HRESULT _SetEnableTooltips( unsigned int iPad, BOOL bVal );
341 HRESULT _ShowTooltip( unsigned int iPad, unsigned int tooltip, bool show );
342 HRESULT _SetTooltipsEnabled( unsigned int iPad, bool bA = true, bool bB = true, bool bX = true, bool bY = true, bool bLT = true, bool bRT = true, bool bLB=true, bool bRB = true, bool bLS = true);
343 HRESULT _RefreshTooltips( unsigned int iPad);
344 HRESULT _EnableTooltip( unsigned int iPad, unsigned int tooltip, bool enable );
345 HRESULT _ShowSavingMessage( unsigned int iPad, C4JStorage::ESavingMessage eVal );
346 HRESULT _ShowBackground( unsigned int iPad, BOOL bShow );
347 HRESULT _ShowDarkOverlay( unsigned int iPad, BOOL bShow );
348 HRESULT _ShowLogo( unsigned int iPad, BOOL bShow );
349 HRESULT _ShowPressStart(unsigned int iPad);
350 HRESULT _UpdateAutosaveCountdownTimer(unsigned int uiSeconds);
351 HRESULT _ShowAutosaveCountdownTimer(BOOL bVal);
352 HRESULT _UpdateTrialTimer(unsigned int iPad);
353 HRESULT _ShowTrialTimer(BOOL bVal);
354 void _ReduceTrialTimerValue();
355 HRESULT _HidePressStart();
356 HRESULT _ShowSafeArea( BOOL bShow );
357 HRESULT _ShowOtherPlayersBaseScene(int iPad, bool show);
358 bool _PressStartPlaying(unsigned int iPad);
359 HRESULT _SetPlayerBaseScenePosition( unsigned int iPad, EBaseScenePosition position );
360 void _UpdateSelectedItemPos( unsigned int iPad);
361 EBaseScenePosition _GetPlayerBasePosition(int iPad);
362 HRESULT _AnimateKeyPress(DWORD userIndex, DWORD dwKeyCode);
363 HXUIOBJ _GetPlayerBaseScene(int iPad) {return m_BasePlayerScene[iPad].m_hObj;}
364 HRESULT _PlayUISFX(ESoundEffect eSound);
365 void _SetEmptyQuadrantLogo(int iPad,EBaseScenePosition ePos);
366 HRESULT _DisplayGamertag( unsigned int iPad, BOOL bDisplay );
367 void _SetSelectedItem( unsigned int iPad, const wstring& name);
368 void _HideAllGameUIElements();
369 bool _GetBaseSceneSafeZone( unsigned int iPad, D3DXVECTOR2 &origin, float &width, float &height);
370
371 void ReLayout( unsigned int iPad );
372
373private:
374 static CXuiSceneBase *Instance;
375 int m_iCurrentTooltipTextID[XUSER_MAX_COUNT][BUTTONS_TOOLTIP_MAX];
376 HXUIOBJ hTooltipText[XUSER_MAX_COUNT][BUTTONS_TOOLTIP_MAX];
377 HXUIOBJ hTooltipTextSmall[XUSER_MAX_COUNT][BUTTONS_TOOLTIP_MAX];
378 EBaseScenePosition m_playerBaseScenePosition[XUSER_MAX_COUNT];
379 bool m_bCrouching[XUSER_MAX_COUNT];
380 int m_iQuadrantsMask;
381 unsigned int m_uiSelectedItemOpacityCountDown[XUSER_MAX_COUNT];
382
383public:
384 static DWORD m_dwTrialTimerLimitSecs;
385
386public:
387 static CXuiSceneBase *GetInstance() { return Instance; }
388 static void TickAllBaseScenes();
389 static HRESULT SetTooltipText( unsigned int iPad, unsigned int tooltip, int iTextID );
390 static HRESULT SetEnableTooltips( unsigned int iPad, BOOL bVal );
391 static HRESULT ShowTooltip( unsigned int iPad, unsigned int tooltip, bool show );
392 static HRESULT SetTooltips( unsigned int iPad, int iA, int iB=-1, int iX=-1, int iY=-1 , int iLT=-1, int iRT=-1, int iLB=-1, int iRB=-1, int iLS=-1, bool forceUpdate = false);
393 static HRESULT RefreshTooltips( unsigned int iPad);
394 static HRESULT EnableTooltip( unsigned int iPad, unsigned int tooltip, bool enable );
395 static HRESULT SetTooltipsEnabled( unsigned int iPad, bool bA = true, bool bB = true, bool bX = true, bool bY = true, bool bLT = true, bool bRT = true, bool bLB = true, bool bRB=true, bool bLS=true);
396 static HRESULT AnimateKeyPress(DWORD userIndex, DWORD dwKeyCode);
397 static HRESULT ShowSavingMessage( unsigned int iPad, C4JStorage::ESavingMessage eVal);
398 static HRESULT ShowBackground( unsigned int iPad, BOOL bShow );
399 static HRESULT ShowDarkOverlay( unsigned int iPad, BOOL bShow );
400 static HRESULT ShowLogo( unsigned int iPad, BOOL bShow );
401 static HRESULT UpdateAutosaveCountdownTimer(unsigned int uiSeconds);
402 static HRESULT ShowAutosaveCountdownTimer(BOOL bVal);
403 static HRESULT UpdateTrialTimer(unsigned int iPad);
404 static HRESULT ShowTrialTimer(BOOL bVal);
405 static void ReduceTrialTimerValue();
406 static HRESULT HidePressStart();
407 static HRESULT ShowSafeArea( BOOL bShow );
408 static HRESULT ShowOtherPlayersBaseScene(int iPad, bool show);
409
410 static HRESULT ShowPressStart(unsigned int iPad);
411 static bool PressStartPlaying(unsigned int iPad);
412 static HRESULT SetPlayerBaseScenePosition( unsigned int iPad, EBaseScenePosition position );
413 static HRESULT SetPlayerBasePositions(EBaseScenePosition pad0, EBaseScenePosition pad1, EBaseScenePosition pad2, EBaseScenePosition pad3);
414 static HRESULT UpdatePlayerBasePositions();
415 static EBaseScenePosition GetPlayerBasePosition(int iPad);
416 static void UpdateSelectedItemPos(int iPad);
417
418
419 static HXUIOBJ GetPlayerBaseScene(int iPad);
420 static HRESULT PlayUISFX(ESoundEffect eSound);
421 static void SetEmptyQuadrantLogo(int iSection);
422 static HRESULT DisplayGamertag( unsigned int iPad, BOOL bDisplay );
423 static void SetSelectedItem( unsigned int iPad, const wstring &name);
424 static void HideAllGameUIElements();
425
426 // Returns details on the fully transformed (ie screen space) base scene position, adjusted for safe zones
427 static bool GetBaseSceneSafeZone( unsigned int iPad, D3DXVECTOR2 &origin, float &width, float &height);
428
429#ifndef _XBOX
430 static void CreateBaseSceneInstance();
431#endif
432};