Done - LoadCreateJoinMenu | Iggy Game UI to RmlUi

This commit is contained in:
Zero
2026-06-17 00:17:12 +02:00
parent 3fff023cad
commit a495d520e1
16 changed files with 886 additions and 6297 deletions

View File

@@ -1,6 +1,17 @@
#pragma once
#pragma push_macro("byte")
#pragma push_macro("GetNextSibling")
#pragma push_macro("GetFirstChild")
#undef byte
#undef GetNextSibling
#undef GetFirstChild
#include "UIScene.h"
#include <RmlUi/Core/EventListener.h>
#include <RmlUi/Core/ElementDocument.h>
// NOTE: pop_macro at end of file
class LevelGenerationOptions;
class C4JThread;
@@ -12,7 +23,7 @@ class C4JThread;
#define SONY_REMOTE_STORAGE_UPLOAD
#endif
class UIScene_LoadCreateJoinMenu : public UIScene
class UIScene_LoadCreateJoinMenu : public UIScene, public Rml::EventListener
{
private:
enum EControls
@@ -58,66 +69,6 @@ private:
int m_iSaveDetailsCount;
protected:
UIControl m_controlMainPanel;
UIControl m_controlLoadGame;
UIControl m_controlLoadGamePanel;
UIControl m_controlNewGame;
UIControl m_controlNewGamePanel;
UIControl m_controlJoinGame;
UIControl m_controlJoinGamePanel;
UIControl_SaveList m_buttonListSaves;
UIControl_SaveList m_buttonListNewGames;
UIControl_SaveList m_buttonListGames;
UIControl_Label m_labelSavesListTitle, m_labelCreateListTitle, m_labelJoinListTitle, m_labelNoGames;
UIControl m_controlSavesTimer, m_controlNewGameTimer, m_controlJoinTimer;
#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64)
UIControl_SpaceIndicatorBar m_spaceIndicatorSaves;
#endif
IggyName m_funcSetActiveTab, m_funcSetMatchesAvailable, m_funcShowSaveSizeBar;
bool m_hasMainPanel;
bool m_hasNewGameList;
bool m_hasNoGamesLabel;
bool m_hasTabButtons;
ELoadCreateJoinTab m_activeTab;
IggyValuePath m_loadGamePath;
IggyValuePath m_newGamePath;
IggyValuePath m_joinGamePath;
bool m_hasLoadGamePath;
bool m_hasNewGamePath;
bool m_hasJoinGamePath;
private:
UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene)
UI_MAP_ELEMENT( m_controlLoadGame, "LoadGame")
UI_BEGIN_MAP_CHILD_ELEMENTS( m_controlLoadGame )
UI_MAP_ELEMENT( m_buttonListSaves, "LoadGameList")
UI_MAP_ELEMENT( m_controlSavesTimer, "LoadGameTimer")
#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64)
UI_MAP_ELEMENT( m_spaceIndicatorSaves, "SaveSizeBar")
#endif
UI_END_MAP_CHILD_ELEMENTS()
UI_MAP_ELEMENT( m_controlNewGame, "NewGame")
UI_BEGIN_MAP_CHILD_ELEMENTS( m_controlNewGame )
UI_MAP_ELEMENT( m_buttonListNewGames, "NewGameList")
UI_MAP_ELEMENT( m_controlNewGameTimer, "NewGameTimer")
UI_END_MAP_CHILD_ELEMENTS()
UI_MAP_ELEMENT( m_controlJoinGame, "JoinGame")
UI_BEGIN_MAP_CHILD_ELEMENTS( m_controlJoinGame )
UI_MAP_ELEMENT( m_buttonListGames, "JoinGameGamesList")
UI_MAP_ELEMENT( m_controlJoinTimer, "JoinGamesTimer")
UI_END_MAP_CHILD_ELEMENTS()
UI_MAP_ELEMENT( m_labelSavesListTitle, "LoadGameTabTitle")
UI_MAP_ELEMENT( m_labelCreateListTitle, "NewGameTabTitle")
UI_MAP_ELEMENT( m_labelJoinListTitle, "JoinGameTabTitle")
UI_MAP_NAME( m_funcSetActiveTab, L"SetActiveTab")
UI_MAP_NAME( m_funcSetMatchesAvailable, L"SetMatchesAvailable")
UI_MAP_NAME( m_funcShowSaveSizeBar, L"ShowSaveSizeBar")
UI_END_MAP_ELEMENTS_AND_NAMES()
int m_iDefaultButtonsC;
int m_iMashUpButtonsC;
int m_iState;
@@ -144,7 +95,6 @@ private:
int m_iSaveInfoC;
int m_iSaveListIndex;
int m_iGameListIndex;
//int *m_iConfigA; // track the texture packs that we don't have installed
#ifndef _XBOX_ONE
bool m_bSaveTransferInProgress;
bool m_bSaveTransferCancelled;
@@ -154,8 +104,8 @@ private:
bool m_bPendingJoinTabAvailabilityRefresh;
bool m_bPendingJoinVisualRefresh;
bool m_bRebuildingJoinVisual;
bool m_bHasNoGamesLabel;
int m_iNewGameListIndex;
bool m_bHasNoGamesLabel;
int m_iNewGameListIndex;
#ifdef _WINDOWS64
int m_lastHoverMouseX;
int m_lastHoverMouseY;
@@ -165,6 +115,8 @@ int m_iNewGameListIndex;
int m_hoverBaseIndexJoin;
#endif
ELoadCreateJoinTab m_activeTab;
public:
UIScene_LoadCreateJoinMenu(int iPad, void *initData, UILayer *parentLayer);
virtual ~UIScene_LoadCreateJoinMenu();
@@ -190,6 +142,14 @@ public:
#endif
virtual void tick();
// Override focus/movie lifecycle for RmlUi (no Iggy movie)
virtual void gainFocus() override;
virtual void reloadMovie(bool force) override;
virtual void render(S32 width, S32 height, C4JRender::eViewportType viewport) override;
// Rml::EventListener
void ProcessEvent(Rml::Event& event) override;
private:
void Initialise();
void GetSaveInfo();
@@ -208,8 +168,15 @@ private:
void UpdateJoinTabAvailability();
void UpdateSaveSizeBarVisibility();
// RmlUi helper methods
void ShowTabPanel(const char* panelId, bool show);
void SetTabButtonState(int tabIndex);
void ClearList(const char* listId);
void AddListItem(const char* listId, const wstring& text, const wchar_t* textureName = nullptr);
void SetListTexture(int itemIndex, const char* listId, const wchar_t* textureName);
int GetListItemCount(const char* listId);
protected:
// TODO: This should be pure virtual in this class
virtual wstring getMoviePath();
public:
@@ -250,6 +217,7 @@ private:
eAddServerPhase m_addServerPhase;
wstring m_addServerIP;
wstring m_addServerPort;
wstring m_addServerName;
void BeginAddServer();
void AppendServerToFile(const wstring& ip, const wstring& port, const wstring& name);
static int AddServerKeyboardCallback(LPVOID lpParam, bool bRes);
@@ -261,6 +229,7 @@ private:
static void remoteStorageGetSaveCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code);
#endif
#ifdef __ORBIS__
//static int PSPlusReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
#endif
@@ -385,4 +354,12 @@ private:
static void CancelCopySaveCallback(LPVOID lpParam);
static int CopySaveErrorDialogFinishedCallback(void *pParam,int iPad,C4JStorage::EMessageResult result);
#endif
};
// RmlUi document
private:
Rml::ElementDocument* m_document;
};
#pragma pop_macro("GetFirstChild")
#pragma pop_macro("GetNextSibling")
#pragma pop_macro("byte")