93 lines
2.4 KiB
C++
93 lines
2.4 KiB
C++
#pragma once
|
|
|
|
#include "UIScene.h"
|
|
|
|
class LevelGenerationOptions;
|
|
class FriendSessionInfo;
|
|
|
|
class UIScene_MiniGamesMenu : public UIScene
|
|
{
|
|
private:
|
|
enum EControls
|
|
{
|
|
eControl_SavesList,
|
|
eControl_GamesList,
|
|
};
|
|
|
|
enum eActions
|
|
{
|
|
eAction_None = 0,
|
|
eAction_ViewInvites,
|
|
eAction_JoinGame,
|
|
};
|
|
eActions m_eAction;
|
|
|
|
static const int CREATE_BUTTON_INDEX = 0;
|
|
|
|
protected:
|
|
UIControl_SaveList m_buttonListSaves;
|
|
UIControl_SaveList m_buttonListGames;
|
|
UIControl_Label m_labelSavesListTitle, m_labelJoinListTitle, m_labelNoGames;
|
|
UIControl m_controlSavesTimer, m_controlJoinTimer;
|
|
|
|
private:
|
|
UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene)
|
|
UI_MAP_ELEMENT(m_buttonListSaves, "SavesList")
|
|
UI_MAP_ELEMENT(m_buttonListGames, "JoinList")
|
|
|
|
UI_MAP_ELEMENT(m_labelSavesListTitle, "SavesListTitle")
|
|
UI_MAP_ELEMENT(m_labelJoinListTitle, "JoinListTitle")
|
|
UI_MAP_ELEMENT(m_labelNoGames, "NoGames")
|
|
|
|
UI_MAP_ELEMENT(m_controlSavesTimer, "SavesTimer")
|
|
UI_MAP_ELEMENT(m_controlJoinTimer, "JoinTimer")
|
|
UI_END_MAP_ELEMENTS_AND_NAMES()
|
|
|
|
int m_iDefaultButtonsC;
|
|
vector<FriendSessionInfo*>* m_currentSessions;
|
|
vector<LevelGenerationOptions*> m_generators;
|
|
|
|
bool m_bIgnoreInput;
|
|
bool m_bInParty;
|
|
bool m_bShowingPartyGamesOnly;
|
|
JoinMenuInitData* m_initData;
|
|
bool m_bMultiplayerAllowed;
|
|
int m_iGameListIndex;
|
|
|
|
public:
|
|
UIScene_MiniGamesMenu(int iPad, void* initData, UILayer* parentLayer);
|
|
virtual ~UIScene_MiniGamesMenu();
|
|
|
|
virtual void updateTooltips();
|
|
virtual void updateComponents();
|
|
|
|
virtual void handleDestroy();
|
|
virtual void handleLoseFocus();
|
|
virtual void handleGainFocus(bool navBack);
|
|
virtual void handleTimerComplete(int id); // ← added
|
|
// INPUT
|
|
virtual void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool& handled); // ← THIS was missing
|
|
virtual void handleFocusChange(F64 controlId, F64 childId); // ← added
|
|
virtual void handleInitFocus(F64 controlId, F64 childId); // ← added
|
|
|
|
virtual EUIScene getSceneType() { return eUIScene_MiniGamesMenu; }
|
|
|
|
static void UpdateGamesListCallback(LPVOID pParam);
|
|
|
|
virtual void tick();
|
|
|
|
private:
|
|
void Initialise();
|
|
void UpdateGamesList();
|
|
void AddDefaultButtons();
|
|
bool DoesSavesListHaveFocus();
|
|
bool DoesGamesListHaveFocus();
|
|
|
|
protected:
|
|
virtual wstring getMoviePath();
|
|
|
|
private:
|
|
void CheckAndJoinGame(int gameIndex);
|
|
void LoadLevelGen(LevelGenerationOptions* levelGen);
|
|
void handlePress(F64 controlId, F64 childId);
|
|
}; |