aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Common/XUI/XUI_TransferToXboxOne.h
blob: f08de59aea4d69ff5c62545ebad36f14f9b47927 (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
#pragma once
using namespace std;
//#include <vector>

#include "..\Media\xuiscene_TransferToXboxOne.h"


class CXuiCtrl4JList;

class CScene_TransferToXboxOne : public CXuiSceneImpl
{
protected:

	typedef struct
	{
		WCHAR wchSaveTitle[XCONTENT_MAX_DISPLAYNAME_LENGTH];
		unsigned int uiImageLength;
	}
	SLOTDATA;

	CXuiCtrl4JList *m_pSavesSlotList;
	CXuiList m_SavesSlotList;
	CXuiControl m_SavesSlotListTimer;

	XUI_BEGIN_MSG_MAP()
		XUI_ON_XM_INIT( OnInit )
		XUI_ON_XM_DESTROY(OnDestroy)
		XUI_ON_XM_KEYDOWN(OnKeyDown)
		XUI_ON_XM_NOTIFY_PRESS_EX(OnNotifyPressEx)
		XUI_ON_XM_NOTIFY_SELCHANGED(OnNotifySelChanged)
		XUI_ON_XM_NOTIFY_SET_FOCUS(OnNotifySetFocus)
		XUI_ON_XM_NOTIFY_KILL_FOCUS(OnNotifyKillFocus)
		XUI_ON_XM_TRANSITION_START(OnTransitionStart)
		XUI_ON_XM_FONTRENDERERCHANGE_MESSAGE(OnFontRendererChange)

	XUI_END_MSG_MAP()

		BEGIN_CONTROL_MAP()
			MAP_CONTROL(IDC_SavesSlotTimer, m_SavesSlotListTimer)
			MAP_CONTROL(IDC_SavesSlotsList, m_SavesSlotList)
		END_CONTROL_MAP()


		HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled );
		HRESULT OnDestroy();
		HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled);
		HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled);
		HRESULT OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled);
		HRESULT OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelChanged *pNotifySelChangedData, BOOL& bHandled);
		HRESULT OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled);
		HRESULT OnNotifyKillFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled);
		HRESULT OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled );
		HRESULT OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled );
		HRESULT OnFontRendererChange();

public:

	// Define the class. The class name must match the ClassOverride property
	// set for the scene in the UI Authoring tool.
	XUI_IMPLEMENT_CLASS( CScene_TransferToXboxOne, L"CScene_TransferToXboxOne", XUI_CLASS_SCENE )

	static int TMSPPSlotListReturned(LPVOID pParam,int iPad,int iUserData,C4JStorage::PTMSPP_FILEDATA pFileData, LPCSTR szFilename);
	static int TMSPPWriteReturned(LPVOID pParam,int iPad,int iUserData);
	static int TMSPPDeleteReturned(LPVOID pParam,int iPad,int iUserData);
	static int UploadSaveForXboxOneThreadProc( LPVOID lpParameter );
	static int LoadSaveDataReturned(void *pParam,bool bContinue);
private:	
	HRESULT BuildSlotFile(int iIndexBeingUpdated,PBYTE pbImageData,DWORD dwImageBytes);

	bool m_bIgnoreInput;
	bool m_bRetrievingSaveInfo;
	int m_iPad;
	int m_MaxSlotC;
	int m_iX; // tooltip for clearing all slots if there are saves in them
	LoadMenuInitData *m_params;
	XCONTENT_DATA m_XContentData;
	PBYTE m_pbImageData;
	DWORD m_dwImageBytes;
	HXUIBRUSH m_hXuiBrush;
	PBYTE m_pbSlotListFile;
	unsigned int m_uiSlotListFileBytes;
	SLOTDATA *m_pSlotDataA;
	bool m_bWaitingForWrite;
	void *m_pvSaveMem;
	unsigned int m_uiStorageLength;
	bool m_bSaveDataReceived;
	unsigned int m_uiSlotID;
};