metaforce/Runtime/MP1/CFrontEndUI.hpp

142 lines
3.7 KiB
C++
Raw Normal View History

2016-04-13 06:07:23 +00:00
#ifndef __URDE_CFRONTENDUI_HPP__
#define __URDE_CFRONTENDUI_HPP__
2015-08-27 00:23:46 +00:00
#include "CIOWin.hpp"
#include "CGameDebug.hpp"
2016-09-16 20:18:03 +00:00
#include "RetroTypes.hpp"
#include "CToken.hpp"
2015-08-27 00:23:46 +00:00
2016-03-04 23:04:53 +00:00
namespace urde
2015-08-27 00:23:46 +00:00
{
class CGuiSliderGroup;
class CGuiTableGroup;
2016-08-05 23:48:53 +00:00
class CMoviePlayer;
2015-08-31 03:44:42 +00:00
struct SObjectTag;
2016-09-16 20:18:03 +00:00
class CDependencyGroup;
class CTexture;
class CAudioGroupSet;
2016-12-13 05:22:30 +00:00
class CSaveWorld;
class CStringTable;
class CGuiFrame;
class CSaveUI;
2015-08-27 00:23:46 +00:00
namespace MP1
{
class CFrontEndUI : public CIOWin
{
2016-09-16 20:18:03 +00:00
public:
2016-12-13 05:22:30 +00:00
enum class EScreen
2016-09-16 20:18:03 +00:00
{
Zero,
One,
Two,
Three,
Four,
Five,
Six
};
2016-12-13 05:22:30 +00:00
struct SNewFileSelect
2016-09-16 20:18:03 +00:00
{
};
2016-12-13 05:22:30 +00:00
enum class EMenuMovie
{
Stopped = -1,
FirstStart = 0,
StartLoop,
StartFileSelectA,
FileSelectLoop,
FileSelectPlayGameA,
FileSelectGBA,
GBALoop,
GBAFileSelectA,
GBAFileSelectB
};
2016-09-16 20:18:03 +00:00
private:
2016-12-13 05:22:30 +00:00
EScreen x14_screen = EScreen::Zero;
2016-09-16 20:18:03 +00:00
u32 x18_rndA;
u32 x1c_rndB;
TLockedToken<CDependencyGroup> x20_depsGroup;
TLockedToken<CTexture> x38_pressStart;
TLockedToken<CAudioGroupSet> x44_frontendAudioGrp;
2016-12-13 05:22:30 +00:00
EScreen x50_curScreen = EScreen::Zero;
EScreen x54_nextScreen = EScreen::Zero;
float x58_movieSeconds = 0.f;
bool x5c_movieSecondsNeeded = false;
2016-09-16 20:18:03 +00:00
float x60_ = 0.f;
float x64_ = 0.f;
float x68_ = 1.f;
2016-12-13 05:22:30 +00:00
u32 x6c_;
std::unique_ptr<CMoviePlayer> x70_menuMovies[9];
EMenuMovie xb8_curMovie = EMenuMovie::Stopped;
2016-09-16 20:18:03 +00:00
int xbc_nextAttract = 0;
int xc0_attractCount = 0;
2016-12-13 05:22:30 +00:00
std::unique_ptr<CMoviePlayer> xc4_attractMovie;
CMoviePlayer* xcc_curMoviePtr = nullptr;
bool xd0_ = false;
bool xd1_moviesLoaded = false;
bool xd2_ = false;
2016-09-16 20:18:03 +00:00
u32 xd4_ = 0;
u32 xd8_ = 0;
2016-12-13 05:22:30 +00:00
std::unique_ptr<CSaveUI> xdc_saveUI;
std::unique_ptr<SNewFileSelect> xe0_newFileSel;
2016-09-16 20:18:03 +00:00
u32 xe4_ = 0;
u32 xec_ = 0;
u32 xf0_ = 0;
u32 xf4_ = 0;
2016-12-13 05:22:30 +00:00
void SetMovieSecondsDeferred()
2015-08-27 00:23:46 +00:00
{
2016-12-13 05:22:30 +00:00
x58_movieSeconds = 1000000.f;
x5c_movieSecondsNeeded = true;
}
void SetMovieSeconds(float seconds)
2015-08-27 00:23:46 +00:00
{
2016-12-13 05:22:30 +00:00
x58_movieSeconds = seconds;
x5c_movieSecondsNeeded = false;
}
void TransitionToFive();
public:
2015-08-27 00:23:46 +00:00
2016-09-16 20:18:03 +00:00
CFrontEndUI(CArchitectureQueue& queue);
2015-08-27 00:23:46 +00:00
void OnSliderSelectionChange(CGuiSliderGroup* grp, float);
void OnCheckBoxSelectionChange(CGuiTableGroup* grp);
void OnOptionSubMenuCancel(CGuiTableGroup* grp);
void OnOptionsMenuCancel(CGuiTableGroup* grp);
void OnNewGameMenuCancel(CGuiTableGroup* grp);
void OnFileMenuCancel(CGuiTableGroup* grp);
void OnGenericMenuSelectionChange(CGuiTableGroup* grp, int, int);
void OnOptionsMenuAdvance(CGuiTableGroup* grp);
void OnNewGameMenuAdvance(CGuiTableGroup* grp);
void OnFileMenuAdvance(CGuiTableGroup* grp);
void OnMainMenuAdvance(CGuiTableGroup* grp);
2016-09-16 20:18:03 +00:00
void StartSlideShow(CArchitectureQueue& queue);
std::string GetAttractMovieFileName(int idx);
std::string GetNextAttractMovieFileName();
2015-08-27 00:23:46 +00:00
void SetCurrentMovie(EMenuMovie movie);
void StopAttractMovie();
2016-12-13 05:22:30 +00:00
void StartAttractMovie();
2015-08-27 00:23:46 +00:00
void UpdateMenuHighlights(CGuiTableGroup* grp);
void CompleteStateTransition();
bool CanBuild(const SObjectTag& tag);
void StartStateTransition(EScreen screen);
void HandleDebugMenuReturnValue(CGameDebug::EReturnValue val, CArchitectureQueue& queue);
void Draw() const;
void UpdateMovies(float dt);
2016-12-13 05:22:30 +00:00
bool PumpMovieLoad();
2016-09-16 20:18:03 +00:00
void ProcessUserInput(const CFinalInput& input, CArchitectureQueue& queue);
EMessageReturn Update(float dt, CArchitectureQueue& queue);
2015-08-27 00:23:46 +00:00
EMessageReturn OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue);
void StartGame();
void InitializeFrame();
};
}
}
2016-04-13 06:07:23 +00:00
#endif // __URDE_CFRONTENDUI_HPP__