the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2using namespace std;
3#include "../media/xuiscene_ingameinfo.h"
4#include "XUI_CustomMessages.h"
5
6class INetworkPlayer;
7
8#define INGAME_INFO_TOOLTIP_TIMER 1000
9
10#define VOICE_ICON_DATA_ID 0
11#define MAP_ICON_DATA_ID 1
12#define OPS_ICON_DATA_ID 2
13
14class CScene_InGameInfo : public CXuiSceneImpl
15{
16protected:
17 // Control and Element wrapper objects.
18 CXuiList playersList;
19 CXuiControl m_gameOptionsButton;
20 CXuiControl m_title;
21
22 // Message map. Here we tie messages to message handlers.
23 XUI_BEGIN_MSG_MAP()
24 XUI_ON_XM_INIT( OnInit )
25 XUI_ON_XM_DESTROY( OnDestroy )
26 XUI_ON_XM_NOTIFY_SELCHANGED( OnNotifySelChanged )
27 XUI_ON_XM_NOTIFY_PRESS_EX(OnNotifyPressEx)
28 XUI_ON_XM_KEYDOWN(OnKeyDown)
29 XUI_ON_XM_TIMER( OnTimer )
30 XUI_ON_XM_TRANSITION_START( OnTransitionStart )
31 XUI_ON_XM_TRANSITION_END( OnTransitionEnd )
32 XUI_ON_XM_NOTIFY_SET_FOCUS( OnNotifySetFocus )
33
34 XUI_ON_XM_GET_SOURCE_TEXT(OnGetSourceDataText)
35 XUI_ON_XM_GET_SOURCE_IMAGE(OnGetSourceDataImage)
36 XUI_ON_XM_GET_ITEMCOUNT_ALL(OnGetItemCountAll)
37 XUI_ON_XM_SPLITSCREENPLAYER_MESSAGE(OnCustomMessage_Splitscreenplayer)
38 XUI_END_MSG_MAP()
39
40 // Control mapping to objects
41 BEGIN_CONTROL_MAP()
42 MAP_CONTROL(IDC_GamePlayers, playersList)
43 MAP_CONTROL(IDC_GameOptionsButton, m_gameOptionsButton)
44 MAP_CONTROL(IDC_Title, m_title)
45 END_CONTROL_MAP()
46
47 HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled );
48 HRESULT OnDestroy();
49 HRESULT OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, BOOL& bHandled );
50 HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled);
51 HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled);
52 HRESULT OnTimer(XUIMessageTimer *pData,BOOL& rfHandled);
53 HRESULT OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled );
54 HRESULT OnTransitionEnd( XUIMessageTransition *pTransition, BOOL& bHandled );
55 HRESULT OnNotifySetFocus( HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled );
56
57 HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled);
58
59 HRESULT OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, BOOL& bHandled);
60 HRESULT OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,BOOL& bHandled);
61 HRESULT OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData, BOOL& bHandled);
62
63public:
64
65 // Define the class. The class name must match the ClassOverride property
66 // set for the scene in the UI Authoring tool.
67 XUI_IMPLEMENT_CLASS( CScene_InGameInfo, L"CScene_InGameInfo", XUI_CLASS_SCENE )
68
69 static void OnPlayerChanged(void *callbackParam, INetworkPlayer *pPlayer, bool leaving);
70
71private:
72 bool m_isHostPlayer;
73 int m_iPad;
74 D3DXVECTOR3 m_OriginalPosition;
75
76 int m_playersCount;
77 BYTE m_players[MINECRAFT_NET_MAX_PLAYERS]; // An array of QNet small-id's
78 bool m_bIgnoreKeyPresses;
79
80 void updateTooltips();
81
82public:
83 static int KickPlayerReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
84};