mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-05-25 08:41:26 +00:00
61 lines
1.3 KiB
C++
61 lines
1.3 KiB
C++
#include "CAreaAttributes.h"
|
|
#include "Core/Resource/Script/CMasterTemplate.h"
|
|
#include "Core/Resource/Script/CScriptLayer.h"
|
|
|
|
CAreaAttributes::CAreaAttributes(CScriptObject *pObj)
|
|
{
|
|
SetObject(pObj);
|
|
}
|
|
|
|
CAreaAttributes::~CAreaAttributes()
|
|
{
|
|
}
|
|
|
|
void CAreaAttributes::SetObject(CScriptObject *pObj)
|
|
{
|
|
mpObj = pObj;
|
|
mGame = pObj->Template()->MasterTemplate()->GetGame();
|
|
}
|
|
|
|
bool CAreaAttributes::IsLayerEnabled() const
|
|
{
|
|
return mpObj->Layer()->IsActive();
|
|
}
|
|
|
|
bool CAreaAttributes::IsSkyEnabled() const
|
|
{
|
|
CPropertyStruct *pBaseStruct = mpObj->Properties();
|
|
|
|
switch (mGame)
|
|
{
|
|
case ePrime:
|
|
case eEchoesDemo:
|
|
case eEchoes:
|
|
case eCorruptionProto:
|
|
case eCorruption:
|
|
case eReturns:
|
|
return static_cast<TBoolProperty*>(pBaseStruct->PropertyByIndex(1))->Get();
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
|
|
CModel* CAreaAttributes::SkyModel() const
|
|
{
|
|
CPropertyStruct *pBaseStruct = mpObj->Properties();
|
|
|
|
switch (mGame)
|
|
{
|
|
case ePrime:
|
|
return (CModel*) static_cast<TFileProperty*>(pBaseStruct->PropertyByIndex(7))->Get().Load();
|
|
case eEchoesDemo:
|
|
case eEchoes:
|
|
case eCorruptionProto:
|
|
case eCorruption:
|
|
case eReturns:
|
|
return (CModel*) static_cast<TFileProperty*>(pBaseStruct->PropertyByID(0xD208C9FA))->Get().Load();
|
|
default:
|
|
return nullptr;
|
|
}
|
|
}
|