2016-03-10 03:47:37 +00:00
|
|
|
#ifndef __URDE_CGUIFRAME_HPP__
|
|
|
|
#define __URDE_CGUIFRAME_HPP__
|
|
|
|
|
|
|
|
#include "CGuiWidget.hpp"
|
2017-01-29 03:58:16 +00:00
|
|
|
#include "CGuiHeadWidget.hpp"
|
2016-03-11 22:50:15 +00:00
|
|
|
#include "CGuiWidgetIdDB.hpp"
|
2016-03-16 20:49:35 +00:00
|
|
|
#include "IObj.hpp"
|
2017-03-20 05:09:53 +00:00
|
|
|
#include <array>
|
2016-03-10 03:47:37 +00:00
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
2016-03-11 05:32:18 +00:00
|
|
|
class CGuiSys;
|
2016-03-11 22:50:15 +00:00
|
|
|
class CLight;
|
|
|
|
class CGuiCamera;
|
2018-02-04 06:46:47 +00:00
|
|
|
struct CFinalInput;
|
2016-03-11 22:50:15 +00:00
|
|
|
class CGuiLight;
|
2016-03-16 20:49:35 +00:00
|
|
|
class CVParamTransfer;
|
2016-09-02 19:32:57 +00:00
|
|
|
class CObjectReference;
|
2016-12-15 22:37:34 +00:00
|
|
|
class CSimplePool;
|
2017-04-13 19:28:31 +00:00
|
|
|
class CBooModel;
|
2016-03-11 22:50:15 +00:00
|
|
|
|
2016-03-11 05:32:18 +00:00
|
|
|
class CGuiFrame
|
|
|
|
{
|
2017-01-30 04:16:20 +00:00
|
|
|
friend class CGuiSys;
|
2016-03-11 22:50:15 +00:00
|
|
|
private:
|
2018-05-06 23:47:55 +00:00
|
|
|
std::vector<CGuiLight*> m_indexedLights;
|
|
|
|
|
2017-08-13 05:26:14 +00:00
|
|
|
CAssetId x0_id;
|
2016-12-15 22:37:34 +00:00
|
|
|
u32 x4_ = 0;
|
|
|
|
CGuiSys& x8_guiSys;
|
2017-01-22 01:40:12 +00:00
|
|
|
std::shared_ptr<CGuiHeadWidget> xc_headWidget;
|
|
|
|
std::shared_ptr<CGuiWidget> x10_rootWidget;
|
|
|
|
std::shared_ptr<CGuiCamera> x14_camera;
|
2016-12-15 22:37:34 +00:00
|
|
|
CGuiWidgetIdDB x18_idDB;
|
2017-01-22 01:40:12 +00:00
|
|
|
std::vector<std::shared_ptr<CGuiWidget>> x2c_widgets;
|
|
|
|
std::vector<std::shared_ptr<CGuiLight>> x3c_lights;
|
2016-12-15 22:37:34 +00:00
|
|
|
int x4c_a;
|
|
|
|
int x50_b;
|
|
|
|
int x54_c;
|
|
|
|
bool x58_24_loaded : 1;
|
2016-03-14 23:32:44 +00:00
|
|
|
|
2017-01-30 04:16:20 +00:00
|
|
|
zeus::CTransform m_aspectTransform;
|
|
|
|
float m_aspectConstraint = -1.f;
|
2017-11-19 23:48:09 +00:00
|
|
|
float m_maxAspect = -1.f;
|
2017-01-30 04:16:20 +00:00
|
|
|
|
2016-03-11 05:32:18 +00:00
|
|
|
public:
|
2017-08-13 05:26:14 +00:00
|
|
|
CGuiFrame(CAssetId id, CGuiSys& sys, int a, int b, int c, CSimplePool* sp);
|
2017-01-30 04:16:20 +00:00
|
|
|
~CGuiFrame();
|
2016-03-11 22:50:15 +00:00
|
|
|
|
2016-12-15 22:37:34 +00:00
|
|
|
CGuiSys& GetGuiSys() {return x8_guiSys;}
|
2017-11-12 05:14:57 +00:00
|
|
|
CAssetId GetAssetId() const {return x0_id;}
|
2016-03-12 04:58:56 +00:00
|
|
|
|
2017-03-20 05:09:53 +00:00
|
|
|
CGuiLight* GetFrameLight(int idx) const { return m_indexedLights[idx]; }
|
2017-02-12 03:17:18 +00:00
|
|
|
CGuiCamera* GetFrameCamera() const { return x14_camera.get(); }
|
2017-11-13 06:19:18 +00:00
|
|
|
CGuiWidget* FindWidget(std::string_view name) const;
|
2016-03-11 22:50:15 +00:00
|
|
|
CGuiWidget* FindWidget(s16 id) const;
|
2017-01-22 01:40:12 +00:00
|
|
|
void SetFrameCamera(std::shared_ptr<CGuiCamera>&& camr) { x14_camera = std::move(camr); }
|
|
|
|
void SetHeadWidget(std::shared_ptr<CGuiHeadWidget>&& hwig) { xc_headWidget = std::move(hwig); }
|
2017-01-29 03:58:16 +00:00
|
|
|
CGuiHeadWidget* GetHeadWidget() const { return xc_headWidget.get(); }
|
2016-03-11 22:50:15 +00:00
|
|
|
void SortDrawOrder();
|
2017-04-13 19:28:31 +00:00
|
|
|
void EnableLights(u32 lights, CBooModel& model) const;
|
2016-03-11 22:50:15 +00:00
|
|
|
void DisableLights() const;
|
|
|
|
void RemoveLight(CGuiLight* light);
|
2017-03-20 05:09:53 +00:00
|
|
|
void AddLight(CGuiLight* light);
|
|
|
|
void RegisterLight(std::shared_ptr<CGuiLight>&& light);
|
2016-03-11 22:50:15 +00:00
|
|
|
bool GetIsFinishedLoading() const;
|
|
|
|
void Touch() const;
|
2017-01-30 04:16:20 +00:00
|
|
|
const zeus::CTransform& GetAspectTransform() const { return m_aspectTransform; }
|
|
|
|
void SetAspectConstraint(float c);
|
2017-11-19 23:48:09 +00:00
|
|
|
void SetMaxAspect(float c);
|
2016-03-11 22:50:15 +00:00
|
|
|
|
2016-12-15 22:37:34 +00:00
|
|
|
void Update(float dt);
|
2016-03-11 22:50:15 +00:00
|
|
|
void Draw(const CGuiWidgetDrawParms& parms) const;
|
|
|
|
void Initialize();
|
2017-01-22 01:40:12 +00:00
|
|
|
void LoadWidgetsInGame(CInputStream& in, CSimplePool* sp);
|
2016-12-16 04:35:49 +00:00
|
|
|
void ProcessUserInput(const CFinalInput& input) const;
|
2016-03-11 22:50:15 +00:00
|
|
|
|
2016-12-15 22:37:34 +00:00
|
|
|
CGuiWidgetIdDB& GetWidgetIdDB() {return x18_idDB;}
|
2016-03-11 22:50:15 +00:00
|
|
|
|
2017-08-13 05:26:14 +00:00
|
|
|
static std::unique_ptr<CGuiFrame> CreateFrame(CAssetId frmeId, CGuiSys& sys, CInputStream& in, CSimplePool* sp);
|
2016-03-11 05:32:18 +00:00
|
|
|
};
|
2016-03-10 03:47:37 +00:00
|
|
|
|
2016-03-16 20:49:35 +00:00
|
|
|
std::unique_ptr<IObj> RGuiFrameFactoryInGame(const SObjectTag& tag, CInputStream& in,
|
2016-09-02 19:32:57 +00:00
|
|
|
const CVParamTransfer& vparms,
|
|
|
|
CObjectReference* selfRef);
|
2016-03-16 20:49:35 +00:00
|
|
|
|
2016-03-10 03:47:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __URDE_CGUIFRAME_HPP__
|