aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Common/UI/UIScene_QuadrantSignin.h
blob: 691bb1990ed061d613cb8a04b90f9d6017de8fb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#pragma once

#include "UIScene.h"

class UIScene_QuadrantSignin : public UIScene
{
private:
	enum EControllerStatus
	{
		eControllerStatus_ConnectController,
		eControllerStatus_PressToJoin,
		eControllerStatus_PlayerDetails,
		eControllerStatus_PressToJoin_LoggedIn,
		eControllerStatus_PressToJoin_NoController,
	};

	bool m_bIgnoreInput;
	SignInInfo m_signInInfo;

	EControllerStatus m_controllerStatus[4];
	bool m_iconRequested[4];

	int m_lastRequestedAvatar;

	UIControl m_controlPanels[4];
	UIControl_Label m_labelPressToJoin[4], m_labelDisplayName[4], m_labelAccountType[4], m_labelPlayerNumber[4], m_labelConnectController[4];
	UIControl_BitmapIcon m_bitmapIcon[4];
	IggyName m_funcJoinButtonPressed, m_funcSetControllerStatus, m_funcSetABSwap;
	UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene)
		UI_MAP_ELEMENT(m_controlPanels[0],"Controller1")
		UI_BEGIN_MAP_CHILD_ELEMENTS(m_controlPanels[0])
			UI_MAP_ELEMENT(m_labelPressToJoin[0], "PressLabel")
			
			UI_MAP_ELEMENT(m_labelDisplayName[0], "GamerTag")
			UI_MAP_ELEMENT(m_labelAccountType[0], "AccountType")
			UI_MAP_ELEMENT(m_labelPlayerNumber[0], "PlayerNumber")
			UI_MAP_ELEMENT(m_bitmapIcon[0], "PlayerPic")

			UI_MAP_ELEMENT(m_labelConnectController[0], "ConnectControllerLabel")
		UI_END_MAP_CHILD_ELEMENTS()

		UI_MAP_ELEMENT(m_controlPanels[1],"Controller2")
		UI_BEGIN_MAP_CHILD_ELEMENTS(m_controlPanels[1])
			UI_MAP_ELEMENT(m_labelPressToJoin[1], "PressLabel")
			
			UI_MAP_ELEMENT(m_labelDisplayName[1], "GamerTag")
			UI_MAP_ELEMENT(m_labelAccountType[1], "AccountType")
			UI_MAP_ELEMENT(m_labelPlayerNumber[1], "PlayerNumber")
			UI_MAP_ELEMENT(m_bitmapIcon[1], "PlayerPic")

			UI_MAP_ELEMENT(m_labelConnectController[1], "ConnectControllerLabel")
		UI_END_MAP_CHILD_ELEMENTS()

		UI_MAP_ELEMENT(m_controlPanels[2],"Controller3")
		UI_BEGIN_MAP_CHILD_ELEMENTS(m_controlPanels[2])
			UI_MAP_ELEMENT(m_labelPressToJoin[2], "PressLabel")
			
			UI_MAP_ELEMENT(m_labelDisplayName[2], "GamerTag")
			UI_MAP_ELEMENT(m_labelAccountType[2], "AccountType")
			UI_MAP_ELEMENT(m_labelPlayerNumber[2], "PlayerNumber")
			UI_MAP_ELEMENT(m_bitmapIcon[2], "PlayerPic")

			UI_MAP_ELEMENT(m_labelConnectController[2], "ConnectControllerLabel")
		UI_END_MAP_CHILD_ELEMENTS()

		UI_MAP_ELEMENT(m_controlPanels[3],"Controller4")
		UI_BEGIN_MAP_CHILD_ELEMENTS(m_controlPanels[3])
			UI_MAP_ELEMENT(m_labelPressToJoin[3], "PressLabel")
			
			UI_MAP_ELEMENT(m_labelDisplayName[3], "GamerTag")
			UI_MAP_ELEMENT(m_labelAccountType[3], "AccountType")
			UI_MAP_ELEMENT(m_labelPlayerNumber[3], "PlayerNumber")
			UI_MAP_ELEMENT(m_bitmapIcon[3], "PlayerPic")

			UI_MAP_ELEMENT(m_labelConnectController[3], "ConnectControllerLabel")
		UI_END_MAP_CHILD_ELEMENTS()

		UI_MAP_NAME(m_funcJoinButtonPressed, L"JoinButtonPressed")
		UI_MAP_NAME(m_funcSetControllerStatus, L"SetControllerStatus")
		UI_MAP_NAME(m_funcSetABSwap, L"SetABSwap")
	UI_END_MAP_ELEMENTS_AND_NAMES()
public:
	UIScene_QuadrantSignin(int iPad, void *initData, UILayer *parentLayer);
	~UIScene_QuadrantSignin();

	virtual EUIScene getSceneType() { return eUIScene_QuadrantSignin;}
	virtual void updateTooltips();

	virtual bool hasFocus(int iPad);
	virtual bool hidesLowerScenes();

	void tick();

protected:
	// TODO: This should be pure virtual in this class
	virtual wstring getMoviePath();

public:
	// INPUT
	virtual void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled);

private:
#ifdef _XBOX_ONE
	static int SignInReturned(void *pParam,bool bContinue, int iPad, int iController);
#else
	static int SignInReturned(void *pParam,bool bContinue, int iPad);
#endif
	static int AvatarReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes);

	void updateState();
	void setControllerState(int iPad, EControllerStatus state);

#ifdef _DURANGO
	static void checkAllPrivilegesCallback(LPVOID lpParam, bool hasPrivileges, int iPad);
#endif

protected:
	void _initQuadrants();

	virtual void handleReload();
};