2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-08-14 21:38:05 +00:00
|
|
|
|
2019-09-23 19:00:23 +00:00
|
|
|
#include <optional>
|
|
|
|
#include <utility>
|
|
|
|
|
|
|
|
#include "Runtime/CScannableObjectInfo.hpp"
|
|
|
|
#include "Runtime/RetroTypes.hpp"
|
|
|
|
#include "Runtime/rstl.hpp"
|
2019-09-29 00:30:53 +00:00
|
|
|
#include "Runtime/Camera/CCameraFilter.hpp"
|
2019-09-23 19:00:23 +00:00
|
|
|
#include "Runtime/Graphics/CTexture.hpp"
|
|
|
|
#include "Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp"
|
|
|
|
|
|
|
|
#include <zeus/CColor.hpp>
|
|
|
|
#include <zeus/CQuaternion.hpp>
|
|
|
|
#include <zeus/CVector2f.hpp>
|
2016-08-14 21:38:05 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde {
|
2019-09-23 19:00:23 +00:00
|
|
|
class CAuiImagePane;
|
|
|
|
class CGuiFrame;
|
|
|
|
class CGuiModel;
|
2016-08-14 21:38:05 +00:00
|
|
|
class CGuiTextPane;
|
|
|
|
class CGuiWidget;
|
2017-05-17 05:04:38 +00:00
|
|
|
class CStringTable;
|
2019-09-23 19:00:23 +00:00
|
|
|
struct CFinalInput;
|
2017-05-17 05:04:38 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CScanDisplay {
|
|
|
|
friend class CHudDecoInterfaceScan;
|
|
|
|
|
2016-08-14 21:38:05 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
class CDataDot {
|
|
|
|
public:
|
|
|
|
enum class EDotState { Hidden, Seek, Hold, RevealPane, Done };
|
|
|
|
|
|
|
|
private:
|
|
|
|
EDotState x0_dotState = EDotState::Hidden;
|
|
|
|
zeus::CVector2f x4_startPos;
|
|
|
|
zeus::CVector2f xc_curPos;
|
|
|
|
zeus::CVector2f x14_targetPos;
|
|
|
|
float x1c_transDur = 0.f;
|
|
|
|
float x20_remTime = 0.f;
|
|
|
|
float x24_alpha = 0.f;
|
|
|
|
float x28_desiredAlpha = 0.f;
|
|
|
|
CTexturedQuadFilter m_quad;
|
|
|
|
|
|
|
|
public:
|
2020-03-26 00:46:05 +00:00
|
|
|
explicit CDataDot(const TLockedToken<CTexture>& dataDotTex) : m_quad(EFilterType::Add, dataDotTex) {}
|
2018-12-08 05:30:43 +00:00
|
|
|
void Update(float dt);
|
2020-03-30 01:44:07 +00:00
|
|
|
void Draw(const zeus::CColor& color, float radius);
|
2018-12-08 05:30:43 +00:00
|
|
|
float GetTransitionFactor() const { return x1c_transDur > 0.f ? x20_remTime / x1c_transDur : 0.f; }
|
|
|
|
void StartTransitionTo(const zeus::CVector2f&, float);
|
|
|
|
void SetDestPosition(const zeus::CVector2f&);
|
|
|
|
void SetDesiredAlpha(float a) { x28_desiredAlpha = a; }
|
|
|
|
void SetDotState(EDotState s) { x0_dotState = s; }
|
|
|
|
void SetAlpha(float a) { x24_alpha = a; }
|
|
|
|
const zeus::CVector2f& GetCurrPosition() const { return xc_curPos; }
|
|
|
|
EDotState GetDotState() const { return x0_dotState; }
|
|
|
|
};
|
2016-08-14 21:38:05 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
enum class EScanState { Inactive, Downloading, DownloadComplete, ViewingScan, Done };
|
2016-08-15 20:43:04 +00:00
|
|
|
|
2017-04-02 03:03:37 +00:00
|
|
|
private:
|
2018-12-08 05:30:43 +00:00
|
|
|
TLockedToken<CTexture> x0_dataDot;
|
|
|
|
EScanState xc_state = EScanState::Inactive;
|
|
|
|
TUniqueId x10_objId = kInvalidUniqueId;
|
2019-06-12 02:05:17 +00:00
|
|
|
std::optional<CScannableObjectInfo> x14_scannableInfo;
|
2018-12-08 05:30:43 +00:00
|
|
|
const CGuiFrame& xa0_selHud;
|
|
|
|
CGuiWidget* xa4_textGroup = nullptr;
|
|
|
|
CGuiTextPane* xa8_message = nullptr;
|
|
|
|
CGuiTextPane* xac_scrollMessage = nullptr;
|
|
|
|
CGuiModel* xb0_xmark = nullptr;
|
|
|
|
CGuiModel* xb4_abutton = nullptr;
|
|
|
|
CGuiModel* xb8_dash = nullptr;
|
|
|
|
rstl::reserved_vector<CDataDot, 4> xbc_dataDots;
|
|
|
|
rstl::reserved_vector<std::pair<float, CAuiImagePane*>, 4> x170_paneStates;
|
|
|
|
TLockedToken<CStringTable> x194_scanStr; // Used to be optional
|
|
|
|
float x1a4_xAlpha = 0.f;
|
|
|
|
float x1a8_bodyAlpha = 0.f;
|
|
|
|
int x1ac_pageCounter = 0;
|
|
|
|
float x1b0_aPulse = 1.f;
|
|
|
|
bool x1b4_scanComplete = false;
|
2017-05-17 05:04:38 +00:00
|
|
|
|
2020-04-13 01:54:40 +00:00
|
|
|
float GetDownloadStartTime(size_t idx) const;
|
|
|
|
float GetDownloadFraction(size_t idx, float scanningTime) const;
|
2018-12-08 05:30:43 +00:00
|
|
|
static void SetScanMessageTypeEffect(CGuiTextPane* pane, bool type);
|
2017-04-02 03:03:37 +00:00
|
|
|
|
2016-08-14 21:38:05 +00:00
|
|
|
public:
|
2020-03-26 00:46:05 +00:00
|
|
|
explicit CScanDisplay(const CGuiFrame& selHud);
|
2018-12-08 05:30:43 +00:00
|
|
|
void ProcessInput(const CFinalInput& input);
|
|
|
|
void StartScan(TUniqueId id, const CScannableObjectInfo& scanInfo, CGuiTextPane* message, CGuiTextPane* scrollMessage,
|
|
|
|
CGuiWidget* textGroup, CGuiModel* xmark, CGuiModel* abutton, CGuiModel* dash, float scanTime);
|
|
|
|
void StopScan();
|
|
|
|
void Update(float dt, float scanningTime);
|
2020-03-30 01:44:07 +00:00
|
|
|
void Draw();
|
2018-12-08 05:30:43 +00:00
|
|
|
EScanState GetScanState() const { return xc_state; }
|
|
|
|
TUniqueId ScanTarget() const { return x10_objId; }
|
2016-08-14 21:38:05 +00:00
|
|
|
};
|
2017-05-17 05:04:38 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace urde
|