metaforce/Runtime/MP1/CInGameGuiManager.hpp

146 lines
5.0 KiB
C++
Raw Normal View History

2017-02-12 03:17:18 +00:00
#ifndef __URDE_CINGAMEGUIMANAGER_HPP__
#define __URDE_CINGAMEGUIMANAGER_HPP__
#include "CToken.hpp"
#include "CRandom16.hpp"
#include "CPlayerVisor.hpp"
#include "CFaceplateDecoration.hpp"
#include "CSamusFaceReflection.hpp"
#include "CMessageScreen.hpp"
#include "CSaveGameScreen.hpp"
#include "Camera/CCameraFilter.hpp"
#include "CStateManager.hpp"
#include "DataSpec/DNACommon/Tweaks/ITweakGui.hpp"
2017-02-18 02:19:50 +00:00
#include "CInventoryScreen.hpp"
2017-04-26 06:43:48 +00:00
#include "CPauseScreen.hpp"
#include "CPauseScreenBlur.hpp"
#include "CInGameGuiManagerCommon.hpp"
2017-02-12 03:17:18 +00:00
namespace urde
{
class CStateManager;
class CArchitectureQueue;
class CDependencyGroup;
class CModelData;
class CActorLights;
class CGuiModel;
class CGuiCamera;
class CAutoMapper;
namespace MP1
{
2017-04-26 06:43:48 +00:00
class CPauseScreenBlur;
2017-02-18 02:19:50 +00:00
class CSamusHud;
2017-04-26 06:43:48 +00:00
class CPauseScreen;
2017-02-12 03:17:18 +00:00
class CInGameGuiManager
{
2017-05-18 19:27:21 +00:00
public:
using EHelmetVisMode = DataSpec::ITweakGui::EHelmetVisMode;
using EHudVisMode = DataSpec::ITweakGui::EHudVisMode;
private:
2017-02-12 03:17:18 +00:00
enum class ELoadPhase
{
LoadDepsGroup = 0,
PreLoadDeps,
LoadDeps,
Done
};
struct SGuiProfileInfo
{
};
TLockedToken<CDependencyGroup> x0_iggmPreLoad;
std::vector<CToken> x8_preLoadDeps;
ELoadPhase x18_loadPhase = ELoadPhase::LoadDepsGroup;
CRandom16 x1c_rand;
CFaceplateDecoration x20_faceplateDecor;
std::unique_ptr<CPlayerVisor> x30_playerVisor;
std::unique_ptr<CSamusHud> x34_samusHud;
std::unique_ptr<CAutoMapper> x38_autoMapper;
2017-04-26 06:43:48 +00:00
std::unique_ptr<CPauseScreenBlur> x3c_pauseScreenBlur;
2017-02-12 03:17:18 +00:00
std::unique_ptr<CSamusFaceReflection> x40_samusReflection;
2017-02-18 02:19:50 +00:00
std::unique_ptr<CMessageScreen> x44_messageScreen;
2017-04-26 06:43:48 +00:00
std::unique_ptr<CPauseScreen> x48_pauseScreen;
2017-02-12 03:17:18 +00:00
std::unique_ptr<CSaveGameScreen> x4c_saveUI;
TLockedToken<CTexture> x50_deathDot;
std::vector<TLockedToken<CDependencyGroup>> x5c_pauseScreenDGRPs;
std::vector<TLockedToken<CDependencyGroup>> xc8_inGameGuiDGRPs;
std::vector<u32> xd8_;
2017-02-18 02:19:50 +00:00
std::vector<CToken> xe8_pauseResources;
2017-02-12 03:17:18 +00:00
CCameraFilterPass xf8_camFilter;
2017-02-18 02:19:50 +00:00
ResId x124_pauseGameHudMessage = -1;
float x128_pauseGameHudTime = 0.f;
2017-02-12 03:17:18 +00:00
std::list<CToken> x12c_;
u32 x140_ = 0;
CGuiWidget* x144_basewidget_automapper = nullptr;
CGuiModel* x148_model_automapper = nullptr;
CGuiCamera* x14c_basehud_camera = nullptr;
CGuiWidget* x150_basewidget_functional = nullptr;
zeus::CQuaternion x154_automapperRotate;
zeus::CVector3f x164_automapperOffset;
zeus::CQuaternion x170_camRotate;
zeus::CVector3f x180_camOffset;
zeus::CTransform x18c_camXf;
2017-02-18 02:19:50 +00:00
EInGameGuiState x1bc_prevState = EInGameGuiState::Zero;
EInGameGuiState x1c0_nextState = EInGameGuiState::Zero;
2017-02-12 03:17:18 +00:00
SOnScreenTex x1c4_onScreenTex;
2017-05-18 19:27:21 +00:00
float x1d8_onScreenTexAlpha = 0.f;
2017-02-12 03:17:18 +00:00
TLockedToken<CTexture> x1dc_onScreenTexTok; // Used to be heap-allocated
2017-05-18 19:27:21 +00:00
EHelmetVisMode x1e0_helmetVisMode;
2017-02-12 03:17:18 +00:00
bool x1e4_enableTargetingManager;
bool x1e8_enableAutoMapper;
2017-05-18 19:27:21 +00:00
EHudVisMode x1ec_hudVisMode;
2017-02-12 03:17:18 +00:00
u32 x1f0_enablePlayerVisor;
2017-05-18 19:27:21 +00:00
float x1f4_visorStaticAlpha;
2017-02-12 03:17:18 +00:00
union
{
struct
{
bool x1f8_24_ : 1;
2017-05-18 19:27:21 +00:00
bool x1f8_25_playerAlive : 1;
2017-02-18 02:19:50 +00:00
bool x1f8_26_deferTransition : 1;
2017-05-18 19:27:21 +00:00
bool x1f8_27_exitSaveUI : 1;
2017-02-12 03:17:18 +00:00
};
u32 _dummy = 0;
};
static std::vector<TLockedToken<CDependencyGroup>> LockPauseScreenDependencies();
bool CheckDGRPLoadComplete() const;
void BeginStateTransition(EInGameGuiState state, CStateManager& stateMgr);
2017-02-18 02:19:50 +00:00
void EnsureStates(CStateManager& stateMgr);
void DoStateTransition(CStateManager& stateMgr);
void DestroyAreaTextures(CStateManager& stateMgr);
void TryReloadAreaTextures();
2017-04-15 05:32:25 +00:00
bool IsInGameStateNotTransitioning() const;
bool IsInPausedStateNotTransitioning() const;
2017-05-18 19:27:21 +00:00
void UpdateAutoMapper(float dt, const CStateManager& stateMgr);
void OnNewPauseScreenState(CArchitectureQueue& archQueue);
2017-02-12 03:17:18 +00:00
public:
CInGameGuiManager(CStateManager& stateMgr, CArchitectureQueue& archQueue);
bool CheckLoadComplete(CStateManager& stateMgr);
2017-05-18 19:27:21 +00:00
void Update(CStateManager& stateMgr, float dt, CArchitectureQueue& archQueue, bool useHud);
2017-02-18 02:19:50 +00:00
void ProcessControllerInput(CStateManager& stateMgr, const CFinalInput& input,
CArchitectureQueue& archQueue);
2017-04-26 06:43:48 +00:00
void PreDraw(CStateManager& stateMgr, bool cameraActive);
2017-02-18 02:19:50 +00:00
void Draw(CStateManager& stateMgr);
void ShowPauseGameHudMessage(CStateManager& stateMgr, ResId pauseMsg, float time);
void PauseGame(CStateManager& stateMgr, EInGameGuiState state);
void StartFadeIn();
bool WasInGame() const { return x1bc_prevState >= EInGameGuiState::Zero && x1bc_prevState <= EInGameGuiState::InGame; }
bool IsInGame() const { return x1c0_nextState >= EInGameGuiState::Zero && x1c0_nextState <= EInGameGuiState::InGame; }
2017-05-18 19:27:21 +00:00
bool IsInSaveUI() const { return x1f8_27_exitSaveUI; }
2017-02-18 02:19:50 +00:00
bool GetIsGameDraw() const;
static std::string GetIdentifierForMidiEvent(ResId world, ResId area, const std::string& midiObj);
2017-02-12 03:17:18 +00:00
};
}
}
#endif // __URDE_CINGAMEGUIMANAGER_HPP__