2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2017-02-12 03:17:18 +00:00
|
|
|
|
2019-09-28 02:53:03 +00:00
|
|
|
#include <list>
|
|
|
|
#include <memory>
|
|
|
|
#include <optional>
|
|
|
|
#include <vector>
|
|
|
|
|
2022-02-19 13:04:45 +00:00
|
|
|
#include "Runtime/Tweaks/ITweakGui.hpp"
|
2019-09-28 02:53:03 +00:00
|
|
|
|
2020-04-20 01:09:30 +00:00
|
|
|
#include "Runtime/CDependencyGroup.hpp"
|
2019-09-28 02:53:03 +00:00
|
|
|
#include "Runtime/CRandom16.hpp"
|
|
|
|
#include "Runtime/CToken.hpp"
|
|
|
|
#include "Runtime/CStateManager.hpp"
|
|
|
|
#include "Runtime/Camera/CCameraFilter.hpp"
|
|
|
|
#include "Runtime/Graphics/Shaders/CRandomStaticFilter.hpp"
|
|
|
|
#include "Runtime/MP1/CFaceplateDecoration.hpp"
|
|
|
|
#include "Runtime/MP1/CInGameGuiManagerCommon.hpp"
|
|
|
|
#include "Runtime/MP1/CInventoryScreen.hpp"
|
|
|
|
#include "Runtime/MP1/CMessageScreen.hpp"
|
|
|
|
#include "Runtime/MP1/CPauseScreen.hpp"
|
|
|
|
#include "Runtime/MP1/CPauseScreenBlur.hpp"
|
|
|
|
#include "Runtime/MP1/CPlayerVisor.hpp"
|
|
|
|
#include "Runtime/MP1/CSamusFaceReflection.hpp"
|
|
|
|
#include "Runtime/MP1/CSaveGameScreen.hpp"
|
|
|
|
|
|
|
|
#include <zeus/CQuaternion.hpp>
|
|
|
|
#include <zeus/CTransform.hpp>
|
|
|
|
#include <zeus/CVector3f.hpp>
|
2017-02-12 03:17:18 +00:00
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce {
|
2019-09-28 02:53:03 +00:00
|
|
|
class CActorLights;
|
2017-02-12 03:17:18 +00:00
|
|
|
class CArchitectureQueue;
|
2019-09-28 02:53:03 +00:00
|
|
|
class CAutoMapper;
|
2017-02-12 03:17:18 +00:00
|
|
|
class CGuiCamera;
|
2019-09-28 02:53:03 +00:00
|
|
|
class CGuiModel;
|
|
|
|
class CModelData;
|
|
|
|
class CStateManager;
|
2017-02-12 03:17:18 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace MP1 {
|
2019-09-28 02:53:03 +00:00
|
|
|
class CPauseScreen;
|
2017-04-26 06:43:48 +00:00
|
|
|
class CPauseScreenBlur;
|
2017-02-18 02:19:50 +00:00
|
|
|
class CSamusHud;
|
2017-02-12 03:17:18 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CInGameGuiManager {
|
2017-05-18 19:27:21 +00:00
|
|
|
public:
|
2022-02-19 13:04:45 +00:00
|
|
|
using EHelmetVisMode = Tweaks::ITweakGui::EHelmetVisMode;
|
|
|
|
using EHudVisMode = Tweaks::ITweakGui::EHudVisMode;
|
2017-05-18 19:27:21 +00:00
|
|
|
|
|
|
|
private:
|
2018-12-08 05:30:43 +00:00
|
|
|
enum class ELoadPhase { LoadDepsGroup = 0, PreLoadDeps, LoadDeps, Done };
|
2017-02-12 03:17:18 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
struct SGuiProfileInfo {};
|
2017-02-12 03:17:18 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
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;
|
|
|
|
std::unique_ptr<CPauseScreenBlur> x3c_pauseScreenBlur;
|
|
|
|
std::unique_ptr<CSamusFaceReflection> x40_samusReflection;
|
|
|
|
std::unique_ptr<CMessageScreen> x44_messageScreen;
|
|
|
|
std::unique_ptr<CPauseScreen> x48_pauseScreen;
|
|
|
|
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_;
|
|
|
|
std::vector<CToken> xe8_pauseResources;
|
2022-03-23 05:35:13 +00:00
|
|
|
CCameraFilterPass xf8_camFilter;
|
2018-12-08 05:30:43 +00:00
|
|
|
CAssetId x124_pauseGameHudMessage;
|
|
|
|
float x128_pauseGameHudTime = 0.f;
|
|
|
|
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_mapCamXf;
|
|
|
|
EInGameGuiState x1bc_prevState = EInGameGuiState::Zero;
|
|
|
|
EInGameGuiState x1c0_nextState = EInGameGuiState::Zero;
|
|
|
|
SOnScreenTex x1c4_onScreenTex;
|
|
|
|
float x1d8_onScreenTexAlpha = 0.f;
|
|
|
|
TLockedToken<CTexture> x1dc_onScreenTexTok; // Used to be heap-allocated
|
2019-06-12 02:05:17 +00:00
|
|
|
std::optional<CTexturedQuadFilterAlpha> m_onScreenQuad;
|
2018-12-08 05:30:43 +00:00
|
|
|
EHelmetVisMode x1e0_helmetVisMode;
|
|
|
|
bool x1e4_enableTargetingManager;
|
|
|
|
bool x1e8_enableAutoMapper;
|
|
|
|
EHudVisMode x1ec_hudVisMode;
|
|
|
|
u32 x1f0_enablePlayerVisor;
|
|
|
|
float x1f4_visorStaticAlpha;
|
2020-04-21 07:22:41 +00:00
|
|
|
bool x1f8_24_ : 1 = false;
|
|
|
|
bool x1f8_25_playerAlive : 1 = true;
|
|
|
|
bool x1f8_26_deferTransition : 1 = false;
|
|
|
|
bool x1f8_27_exitSaveUI : 1 = true;
|
2017-02-12 03:17:18 +00:00
|
|
|
|
2019-06-12 02:05:17 +00:00
|
|
|
std::optional<CTexturedQuadFilter> m_deathRenderTexQuad;
|
|
|
|
std::optional<CTexturedQuadFilter> m_deathDotQuad;
|
2020-03-31 03:52:22 +00:00
|
|
|
CRandomStaticFilter m_randomStatic{EFilterType::Blend};
|
|
|
|
CColoredQuadFilter m_deathWhiteout{EFilterType::Blend};
|
|
|
|
CColoredQuadFilter m_deathBlackout{EFilterType::Blend};
|
2017-05-21 16:01:04 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
static std::vector<TLockedToken<CDependencyGroup>> LockPauseScreenDependencies();
|
|
|
|
bool CheckDGRPLoadComplete() const;
|
|
|
|
void BeginStateTransition(EInGameGuiState state, CStateManager& stateMgr);
|
|
|
|
void EnsureStates(CStateManager& stateMgr);
|
|
|
|
void DoStateTransition(CStateManager& stateMgr);
|
|
|
|
void DestroyAreaTextures(CStateManager& stateMgr);
|
|
|
|
void TryReloadAreaTextures();
|
|
|
|
bool IsInGameStateNotTransitioning() const;
|
|
|
|
bool IsInPausedStateNotTransitioning() const;
|
2020-03-31 10:24:54 +00:00
|
|
|
void UpdateAutoMapper(float dt, CStateManager& stateMgr);
|
2018-12-08 05:30:43 +00:00
|
|
|
void OnNewPauseScreenState(CArchitectureQueue& archQueue);
|
|
|
|
void RefreshHudOptions();
|
2017-02-12 03:17:18 +00:00
|
|
|
|
|
|
|
public:
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CInGameGuiManager(CStateManager& stateMgr, CArchitectureQueue& archQueue);
|
2018-12-08 05:30:43 +00:00
|
|
|
bool CheckLoadComplete(CStateManager& stateMgr);
|
|
|
|
void Update(CStateManager& stateMgr, float dt, CArchitectureQueue& archQueue, bool useHud);
|
|
|
|
void ProcessControllerInput(CStateManager& stateMgr, const CFinalInput& input, CArchitectureQueue& archQueue);
|
|
|
|
void PreDraw(CStateManager& stateMgr, bool cameraActive);
|
|
|
|
void Draw(CStateManager& stateMgr);
|
|
|
|
void ShowPauseGameHudMessage(CStateManager& stateMgr, CAssetId 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; }
|
|
|
|
bool IsInSaveUI() const { return x1f8_27_exitSaveUI; }
|
|
|
|
bool GetIsGameDraw() const;
|
2017-02-12 03:17:18 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace MP1
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce
|