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 "UIScene.h"
4
5class UIScene_QuadrantSignin : public UIScene
6{
7private:
8 enum EControllerStatus
9 {
10 eControllerStatus_ConnectController,
11 eControllerStatus_PressToJoin,
12 eControllerStatus_PlayerDetails,
13 eControllerStatus_PressToJoin_LoggedIn,
14 eControllerStatus_PressToJoin_NoController,
15 };
16
17 bool m_bIgnoreInput;
18 SignInInfo m_signInInfo;
19
20 EControllerStatus m_controllerStatus[4];
21 bool m_iconRequested[4];
22
23 int m_lastRequestedAvatar;
24
25 UIControl m_controlPanels[4];
26 UIControl_Label m_labelPressToJoin[4], m_labelDisplayName[4], m_labelAccountType[4], m_labelPlayerNumber[4], m_labelConnectController[4];
27 UIControl_BitmapIcon m_bitmapIcon[4];
28 IggyName m_funcJoinButtonPressed, m_funcSetControllerStatus, m_funcSetABSwap;
29 UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene)
30 UI_MAP_ELEMENT(m_controlPanels[0],"Controller1")
31 UI_BEGIN_MAP_CHILD_ELEMENTS(m_controlPanels[0])
32 UI_MAP_ELEMENT(m_labelPressToJoin[0], "PressLabel")
33
34 UI_MAP_ELEMENT(m_labelDisplayName[0], "GamerTag")
35 UI_MAP_ELEMENT(m_labelAccountType[0], "AccountType")
36 UI_MAP_ELEMENT(m_labelPlayerNumber[0], "PlayerNumber")
37 UI_MAP_ELEMENT(m_bitmapIcon[0], "PlayerPic")
38
39 UI_MAP_ELEMENT(m_labelConnectController[0], "ConnectControllerLabel")
40 UI_END_MAP_CHILD_ELEMENTS()
41
42 UI_MAP_ELEMENT(m_controlPanels[1],"Controller2")
43 UI_BEGIN_MAP_CHILD_ELEMENTS(m_controlPanels[1])
44 UI_MAP_ELEMENT(m_labelPressToJoin[1], "PressLabel")
45
46 UI_MAP_ELEMENT(m_labelDisplayName[1], "GamerTag")
47 UI_MAP_ELEMENT(m_labelAccountType[1], "AccountType")
48 UI_MAP_ELEMENT(m_labelPlayerNumber[1], "PlayerNumber")
49 UI_MAP_ELEMENT(m_bitmapIcon[1], "PlayerPic")
50
51 UI_MAP_ELEMENT(m_labelConnectController[1], "ConnectControllerLabel")
52 UI_END_MAP_CHILD_ELEMENTS()
53
54 UI_MAP_ELEMENT(m_controlPanels[2],"Controller3")
55 UI_BEGIN_MAP_CHILD_ELEMENTS(m_controlPanels[2])
56 UI_MAP_ELEMENT(m_labelPressToJoin[2], "PressLabel")
57
58 UI_MAP_ELEMENT(m_labelDisplayName[2], "GamerTag")
59 UI_MAP_ELEMENT(m_labelAccountType[2], "AccountType")
60 UI_MAP_ELEMENT(m_labelPlayerNumber[2], "PlayerNumber")
61 UI_MAP_ELEMENT(m_bitmapIcon[2], "PlayerPic")
62
63 UI_MAP_ELEMENT(m_labelConnectController[2], "ConnectControllerLabel")
64 UI_END_MAP_CHILD_ELEMENTS()
65
66 UI_MAP_ELEMENT(m_controlPanels[3],"Controller4")
67 UI_BEGIN_MAP_CHILD_ELEMENTS(m_controlPanels[3])
68 UI_MAP_ELEMENT(m_labelPressToJoin[3], "PressLabel")
69
70 UI_MAP_ELEMENT(m_labelDisplayName[3], "GamerTag")
71 UI_MAP_ELEMENT(m_labelAccountType[3], "AccountType")
72 UI_MAP_ELEMENT(m_labelPlayerNumber[3], "PlayerNumber")
73 UI_MAP_ELEMENT(m_bitmapIcon[3], "PlayerPic")
74
75 UI_MAP_ELEMENT(m_labelConnectController[3], "ConnectControllerLabel")
76 UI_END_MAP_CHILD_ELEMENTS()
77
78 UI_MAP_NAME(m_funcJoinButtonPressed, L"JoinButtonPressed")
79 UI_MAP_NAME(m_funcSetControllerStatus, L"SetControllerStatus")
80 UI_MAP_NAME(m_funcSetABSwap, L"SetABSwap")
81 UI_END_MAP_ELEMENTS_AND_NAMES()
82public:
83 UIScene_QuadrantSignin(int iPad, void *initData, UILayer *parentLayer);
84 ~UIScene_QuadrantSignin();
85
86 virtual EUIScene getSceneType() { return eUIScene_QuadrantSignin;}
87 virtual void updateTooltips();
88
89 virtual bool hasFocus(int iPad);
90 virtual bool hidesLowerScenes();
91
92 void tick();
93
94protected:
95 // TODO: This should be pure virtual in this class
96 virtual wstring getMoviePath();
97
98public:
99 // INPUT
100 virtual void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled);
101
102private:
103#ifdef _XBOX_ONE
104 static int SignInReturned(void *pParam,bool bContinue, int iPad, int iController);
105#else
106 static int SignInReturned(void *pParam,bool bContinue, int iPad);
107#endif
108 static int AvatarReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes);
109
110 void updateState();
111 void setControllerState(int iPad, EControllerStatus state);
112
113#ifdef _DURANGO
114 static void checkAllPrivilegesCallback(LPVOID lpParam, bool hasPrivileges, int iPad);
115#endif
116
117protected:
118 void _initQuadrants();
119
120 virtual void handleReload();
121};