mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-18 09:25:31 +00:00
Implemented new property editor, CPropertyView
This commit is contained in:
@@ -15,9 +15,9 @@ CAnimationParameters::CAnimationParameters()
|
||||
mUnknown4 = 0;
|
||||
}
|
||||
|
||||
CAnimationParameters::CAnimationParameters(IInputStream& SCLY, EGame game)
|
||||
CAnimationParameters::CAnimationParameters(IInputStream& SCLY, EGame Game)
|
||||
{
|
||||
mGame = game;
|
||||
mGame = Game;
|
||||
mpCharSet = nullptr;
|
||||
mNodeIndex = 0;
|
||||
mUnknown1 = 0;
|
||||
@@ -25,28 +25,28 @@ CAnimationParameters::CAnimationParameters(IInputStream& SCLY, EGame game)
|
||||
mUnknown3 = 0;
|
||||
mUnknown4 = 0;
|
||||
|
||||
if (game <= eEchoes)
|
||||
if (Game <= eEchoes)
|
||||
{
|
||||
u32 animSetID = SCLY.ReadLong();
|
||||
u32 AnimSetID = SCLY.ReadLong();
|
||||
mNodeIndex = SCLY.ReadLong();
|
||||
mUnknown1 = SCLY.ReadLong();
|
||||
|
||||
mpCharSet = gResCache.GetResource(animSetID, "ANCS");
|
||||
mpCharSet = gResCache.GetResource(AnimSetID, "ANCS");
|
||||
}
|
||||
|
||||
else if (game <= eCorruption)
|
||||
else if (Game <= eCorruption)
|
||||
{
|
||||
u64 charID = SCLY.ReadLongLong();
|
||||
u64 CharID = SCLY.ReadLongLong();
|
||||
mUnknown1 = SCLY.ReadLong();
|
||||
|
||||
mpCharSet = gResCache.GetResource(charID, "CHAR");
|
||||
mpCharSet = gResCache.GetResource(CharID, "CHAR");
|
||||
}
|
||||
|
||||
else if (game == eReturns)
|
||||
else if (Game == eReturns)
|
||||
{
|
||||
SCLY.Seek(-6, SEEK_CUR);
|
||||
u32 offset = SCLY.Tell();
|
||||
u32 propID = SCLY.ReadLong();
|
||||
u32 Offset = SCLY.Tell();
|
||||
u32 PropID = SCLY.ReadLong();
|
||||
SCLY.Seek(2, SEEK_CUR);
|
||||
|
||||
mUnknown1 = (u32) SCLY.ReadByte();
|
||||
@@ -64,21 +64,30 @@ CAnimationParameters::CAnimationParameters(IInputStream& SCLY, EGame game)
|
||||
|
||||
else if (mUnknown1 != 0x80)
|
||||
{
|
||||
Log::FileError(SCLY.GetSourceString(), offset,
|
||||
"Unexpected AnimationParameters byte: " + TString::HexString(mUnknown1, true, true, 2) + " (property " + TString::HexString(propID, true, true, 8) + ")");
|
||||
Log::FileError(SCLY.GetSourceString(), Offset,
|
||||
"Unexpected AnimationParameters byte: " + TString::HexString(mUnknown1, true, true, 2) + " (property " + TString::HexString(PropID, true, true, 8) + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CModel* CAnimationParameters::GetCurrentModel(s32 nodeIndex)
|
||||
CModel* CAnimationParameters::GetCurrentModel(s32 NodeIndex /*= -1*/)
|
||||
{
|
||||
if (!mpCharSet) return nullptr;
|
||||
if (mpCharSet->Type() != eAnimSet) return nullptr;
|
||||
if (nodeIndex == -1) nodeIndex = mNodeIndex;
|
||||
if (NodeIndex == -1) NodeIndex = mNodeIndex;
|
||||
|
||||
CAnimSet *pSet = static_cast<CAnimSet*>(mpCharSet.RawPointer());
|
||||
if (pSet->getNodeCount() <= (u32) nodeIndex) return nullptr;
|
||||
return pSet->getNodeModel(nodeIndex);
|
||||
if (mpCharSet->getNodeCount() <= (u32) NodeIndex) return nullptr;
|
||||
return mpCharSet->getNodeModel(NodeIndex);
|
||||
}
|
||||
|
||||
TString CAnimationParameters::GetCurrentCharacterName(s32 NodeIndex /*= -1*/)
|
||||
{
|
||||
if (!mpCharSet) return "";
|
||||
if (mpCharSet->Type() != eAnimSet) return "";
|
||||
if (NodeIndex == -1) NodeIndex = mNodeIndex;
|
||||
|
||||
if (mpCharSet->getNodeCount() <= (u32) NodeIndex) return "";
|
||||
return mpCharSet->getNodeName((u32) NodeIndex);
|
||||
}
|
||||
|
||||
// ************ GETTERS ************
|
||||
@@ -87,7 +96,7 @@ EGame CAnimationParameters::Version()
|
||||
return mGame;
|
||||
}
|
||||
|
||||
CResource* CAnimationParameters::Resource()
|
||||
CAnimSet* CAnimationParameters::AnimSet()
|
||||
{
|
||||
return mpCharSet;
|
||||
}
|
||||
@@ -97,9 +106,9 @@ u32 CAnimationParameters::CharacterIndex()
|
||||
return mNodeIndex;
|
||||
}
|
||||
|
||||
u32 CAnimationParameters::Unknown(u32 index)
|
||||
u32 CAnimationParameters::Unknown(u32 Index)
|
||||
{
|
||||
switch (index)
|
||||
switch (Index)
|
||||
{
|
||||
case 0: return mUnknown1;
|
||||
case 1: return mUnknown2;
|
||||
@@ -121,18 +130,18 @@ void CAnimationParameters::SetResource(CResource *pRes)
|
||||
Log::Error("Resource with invalid type passed to CAnimationParameters: " + pRes->Source());
|
||||
}
|
||||
|
||||
void CAnimationParameters::SetNodeIndex(u32 index)
|
||||
void CAnimationParameters::SetNodeIndex(u32 Index)
|
||||
{
|
||||
mNodeIndex = index;
|
||||
mNodeIndex = Index;
|
||||
}
|
||||
|
||||
void CAnimationParameters::SetUnknown(u32 index, u32 value)
|
||||
void CAnimationParameters::SetUnknown(u32 Index, u32 Value)
|
||||
{
|
||||
switch (index)
|
||||
switch (Index)
|
||||
{
|
||||
case 0: mUnknown1 = value;
|
||||
case 1: mUnknown2 = value;
|
||||
case 2: mUnknown3 = value;
|
||||
case 3: mUnknown4 = value;
|
||||
case 0: mUnknown1 = Value;
|
||||
case 1: mUnknown2 = Value;
|
||||
case 2: mUnknown3 = Value;
|
||||
case 3: mUnknown4 = Value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#ifndef CANIMATIONPARAMETERS_H
|
||||
#define CANIMATIONPARAMETERS_H
|
||||
|
||||
#include "CResource.h"
|
||||
#include "TResPtr.h"
|
||||
#include "CAnimSet.h"
|
||||
#include "EGame.h"
|
||||
#include "TResPtr.h"
|
||||
#include "Core/Resource/Model/CModel.h"
|
||||
|
||||
class CAnimationParameters
|
||||
{
|
||||
EGame mGame;
|
||||
TResPtr<CResource> mpCharSet;
|
||||
TResPtr<CAnimSet> mpCharSet;
|
||||
|
||||
u32 mNodeIndex;
|
||||
u32 mUnknown1;
|
||||
@@ -19,19 +19,20 @@ class CAnimationParameters
|
||||
|
||||
public:
|
||||
CAnimationParameters();
|
||||
CAnimationParameters(IInputStream& SCLY, EGame game);
|
||||
CModel* GetCurrentModel(s32 nodeIndex = -1);
|
||||
CAnimationParameters(IInputStream& SCLY, EGame Game);
|
||||
CModel* GetCurrentModel(s32 NodeIndex = -1);
|
||||
TString GetCurrentCharacterName(s32 NodeIndex = -1);
|
||||
|
||||
// Getters
|
||||
EGame Version();
|
||||
CResource* Resource();
|
||||
CAnimSet* AnimSet();
|
||||
u32 CharacterIndex();
|
||||
u32 Unknown(u32 index);
|
||||
|
||||
// Setters
|
||||
void SetResource(CResource *pRes);
|
||||
void SetNodeIndex(u32 index);
|
||||
void SetUnknown(u32 index, u32 value);
|
||||
void SetNodeIndex(u32 Index);
|
||||
void SetUnknown(u32 Index, u32 Value);
|
||||
};
|
||||
|
||||
#endif // CANIMATIONPARAMETERS_H
|
||||
|
||||
@@ -138,7 +138,7 @@ void CScriptLoader::ReadProperty(IProperty *pProp, u32 Size, IInputStream& SCLY)
|
||||
}
|
||||
|
||||
case eCharacterProperty: {
|
||||
TAnimParamsProperty *pAnimCast = static_cast<TAnimParamsProperty*>(pProp);
|
||||
TCharacterProperty *pAnimCast = static_cast<TCharacterProperty*>(pProp);
|
||||
pAnimCast->Set(CAnimationParameters(SCLY, mVersion));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ IPropertyTemplate* CTemplateLoader::LoadProperty(XMLElement *pElem, CStructTempl
|
||||
while (pParams)
|
||||
{
|
||||
TString ParamName = TString(pParams->Name()).ToLower();
|
||||
TString ParamVal = TString(pParams->GetText()).ToLower();
|
||||
TString ParamVal = TString(pParams->GetText());
|
||||
|
||||
// Load versions
|
||||
if (ParamName == "versions")
|
||||
|
||||
@@ -12,7 +12,7 @@ CScriptObject::CScriptObject(CGameArea *pArea, CScriptLayer *pLayer, CScriptTemp
|
||||
, mHasInGameModel(false)
|
||||
{
|
||||
mpTemplate->AddObject(this);
|
||||
mpProperties = (CPropertyStruct*) pTemplate->BaseStruct()->InstantiateProperty();
|
||||
mpProperties = (CPropertyStruct*) pTemplate->BaseStruct()->InstantiateProperty(nullptr);
|
||||
}
|
||||
|
||||
CScriptObject::~CScriptObject()
|
||||
|
||||
@@ -233,7 +233,7 @@ CModel* CScriptTemplate::FindDisplayModel(CPropertyStruct *pProperties)
|
||||
|
||||
else if (pProp->Type() == eCharacterProperty)
|
||||
{
|
||||
TAnimParamsProperty *pParams = static_cast<TAnimParamsProperty*>(pProp);
|
||||
TCharacterProperty *pParams = static_cast<TCharacterProperty*>(pProp);
|
||||
pRes = pParams->Get().GetCurrentModel(it->ForceNodeIndex);
|
||||
}
|
||||
}
|
||||
@@ -332,7 +332,7 @@ bool CScriptTemplate::HasInGameModel(CPropertyStruct *pProperties)
|
||||
|
||||
else if (pProp->Type() == eCharacterProperty)
|
||||
{
|
||||
TAnimParamsProperty *pParams = static_cast<TAnimParamsProperty*>(pProp);
|
||||
TCharacterProperty *pParams = static_cast<TCharacterProperty*>(pProp);
|
||||
pRes = pParams->Get().GetCurrentModel(it->ForceNodeIndex);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,21 +2,26 @@
|
||||
#include "IPropertyTemplate.h"
|
||||
|
||||
// ************ IProperty ************
|
||||
IPropertyTemplate* IProperty::Template()
|
||||
IPropertyTemplate* IProperty::Template() const
|
||||
{
|
||||
return mpTemplate;
|
||||
}
|
||||
|
||||
TString IProperty::Name()
|
||||
TString IProperty::Name() const
|
||||
{
|
||||
return mpTemplate->Name();
|
||||
}
|
||||
|
||||
u32 IProperty::ID()
|
||||
u32 IProperty::ID() const
|
||||
{
|
||||
return mpTemplate->PropertyID();
|
||||
}
|
||||
|
||||
TIDString IProperty::IDString(bool FullPath) const
|
||||
{
|
||||
return mpTemplate->IDString(FullPath);
|
||||
}
|
||||
|
||||
// ************ CPropertyStruct ************
|
||||
CPropertyStruct::~CPropertyStruct()
|
||||
{
|
||||
@@ -24,12 +29,12 @@ CPropertyStruct::~CPropertyStruct()
|
||||
delete *it;
|
||||
}
|
||||
|
||||
IProperty* CPropertyStruct::PropertyByIndex(u32 index)
|
||||
IProperty* CPropertyStruct::PropertyByIndex(u32 index) const
|
||||
{
|
||||
return mProperties[index];
|
||||
}
|
||||
|
||||
IProperty* CPropertyStruct::PropertyByID(u32 ID)
|
||||
IProperty* CPropertyStruct::PropertyByID(u32 ID) const
|
||||
{
|
||||
for (auto it = mProperties.begin(); it != mProperties.end(); it++)
|
||||
{
|
||||
@@ -39,7 +44,7 @@ IProperty* CPropertyStruct::PropertyByID(u32 ID)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
IProperty* CPropertyStruct::PropertyByIDString(const TIDString& rkStr)
|
||||
IProperty* CPropertyStruct::PropertyByIDString(const TIDString& rkStr) const
|
||||
{
|
||||
// Resolve namespace
|
||||
u32 NSStart = rkStr.IndexOf(":");
|
||||
@@ -68,7 +73,7 @@ IProperty* CPropertyStruct::PropertyByIDString(const TIDString& rkStr)
|
||||
}
|
||||
}
|
||||
|
||||
CPropertyStruct* CPropertyStruct::StructByIndex(u32 index)
|
||||
CPropertyStruct* CPropertyStruct::StructByIndex(u32 index) const
|
||||
{
|
||||
IProperty *pProp = PropertyByIndex(index);
|
||||
|
||||
@@ -78,7 +83,7 @@ CPropertyStruct* CPropertyStruct::StructByIndex(u32 index)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CPropertyStruct* CPropertyStruct::StructByID(u32 ID)
|
||||
CPropertyStruct* CPropertyStruct::StructByID(u32 ID) const
|
||||
{
|
||||
IProperty *pProp = PropertyByID(ID);
|
||||
|
||||
@@ -88,7 +93,7 @@ CPropertyStruct* CPropertyStruct::StructByID(u32 ID)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CPropertyStruct* CPropertyStruct::StructByIDString(const TIDString& rkStr)
|
||||
CPropertyStruct* CPropertyStruct::StructByIDString(const TIDString& rkStr) const
|
||||
{
|
||||
IProperty *pProp = PropertyByIDString(rkStr);
|
||||
|
||||
@@ -119,8 +124,8 @@ void CArrayProperty::Resize(u32 Size)
|
||||
}
|
||||
}
|
||||
|
||||
CStructTemplate* CArrayProperty::SubStructTemplate()
|
||||
CStructTemplate* CArrayProperty::SubStructTemplate() const
|
||||
{
|
||||
// CArrayTemplate inherits from CStructTemplate. It defines the substruct structure.
|
||||
// CArrayTemplate inherits from CStructTemplate. The template defines the substruct structure.
|
||||
return static_cast<CStructTemplate*>(Template());
|
||||
}
|
||||
|
||||
@@ -25,16 +25,29 @@ typedef TString TIDString;
|
||||
class IProperty
|
||||
{
|
||||
friend class CScriptLoader;
|
||||
protected:
|
||||
IPropertyTemplate *mpTemplate;
|
||||
public:
|
||||
IProperty(IPropertyTemplate *pTemp) : mpTemplate(pTemp) {}
|
||||
virtual ~IProperty() {}
|
||||
virtual EPropertyType Type() = 0;
|
||||
|
||||
IPropertyTemplate* Template();
|
||||
TString Name();
|
||||
u32 ID();
|
||||
protected:
|
||||
class CPropertyStruct *mpParent;
|
||||
IPropertyTemplate *mpTemplate;
|
||||
|
||||
public:
|
||||
IProperty(IPropertyTemplate *pTemp, CPropertyStruct *pParent)
|
||||
: mpParent(pParent)
|
||||
, mpTemplate(pTemp)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~IProperty() {}
|
||||
virtual EPropertyType Type() const = 0;
|
||||
virtual TString ToString() const { return ""; }
|
||||
|
||||
inline CPropertyStruct* Parent() const { return mpParent; }
|
||||
|
||||
// These functions can't be in the header to avoid circular includes with IPropertyTemplate.h
|
||||
IPropertyTemplate* Template() const;
|
||||
TString Name() const;
|
||||
u32 ID() const;
|
||||
TIDString IDString(bool FullPath) const;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -46,15 +59,17 @@ class TTypedProperty : public IProperty
|
||||
friend class CScriptLoader;
|
||||
ValueClass mValue;
|
||||
public:
|
||||
TTypedProperty(IPropertyTemplate *pTemp)
|
||||
: IProperty(pTemp) {}
|
||||
TTypedProperty(IPropertyTemplate *pTemp, CPropertyStruct *pParent)
|
||||
: IProperty(pTemp, pParent) {}
|
||||
|
||||
TTypedProperty(IPropertyTemplate *pTemp, PropType v)
|
||||
: IProperty(pTemp), mValue(v) {}
|
||||
|
||||
~TTypedProperty() {}
|
||||
inline EPropertyType Type() { return TypeEnum; }
|
||||
inline PropType Get() { return mValue.Get(); }
|
||||
virtual EPropertyType Type() const { return TypeEnum; }
|
||||
virtual TString ToString() const { return mValue.ToString(); }
|
||||
|
||||
inline PropType Get() const { return mValue.Get(); }
|
||||
inline void Set(PropType v) { mValue.Set(v); }
|
||||
};
|
||||
typedef TTypedProperty<bool, eBoolProperty, CBoolValue> TBoolProperty;
|
||||
@@ -68,7 +83,7 @@ typedef TTypedProperty<TString, eStringProperty, CStringValue>
|
||||
typedef TTypedProperty<CVector3f, eVector3Property, CVector3Value> TVector3Property;
|
||||
typedef TTypedProperty<CColor, eColorProperty, CColorValue> TColorProperty;
|
||||
typedef TTypedProperty<CResourceInfo, eFileProperty, CFileValue> TFileProperty;
|
||||
typedef TTypedProperty<CAnimationParameters, eCharacterProperty, CCharacterValue> TAnimParamsProperty;
|
||||
typedef TTypedProperty<CAnimationParameters, eCharacterProperty, CCharacterValue> TCharacterProperty;
|
||||
typedef TTypedProperty<std::vector<u8>, eUnknownProperty, CUnknownValue> TUnknownProperty;
|
||||
|
||||
/*
|
||||
@@ -79,25 +94,25 @@ class CPropertyStruct : public IProperty
|
||||
friend class CScriptLoader;
|
||||
std::vector<IProperty*> mProperties;
|
||||
public:
|
||||
CPropertyStruct(IPropertyTemplate *pTemp)
|
||||
: IProperty(pTemp) {}
|
||||
CPropertyStruct(IPropertyTemplate *pTemp, CPropertyStruct *pParent)
|
||||
: IProperty(pTemp, pParent) {}
|
||||
|
||||
~CPropertyStruct();
|
||||
|
||||
EPropertyType Type() { return eStructProperty; }
|
||||
EPropertyType Type() const { return eStructProperty; }
|
||||
|
||||
// Inline
|
||||
inline u32 Count() { return mProperties.size(); }
|
||||
inline u32 Count() const { return mProperties.size(); }
|
||||
inline void AddSubProperty(IProperty *pProp) { mProperties.push_back(pProp); }
|
||||
inline IProperty* operator[](u32 index) { return mProperties[index]; }
|
||||
|
||||
// Functions
|
||||
IProperty* PropertyByIndex(u32 index);
|
||||
IProperty* PropertyByID(u32 ID);
|
||||
IProperty* PropertyByIDString(const TIDString& rkStr);
|
||||
CPropertyStruct* StructByIndex(u32 index);
|
||||
CPropertyStruct* StructByID(u32 ID);
|
||||
CPropertyStruct* StructByIDString(const TIDString& rkStr);
|
||||
IProperty* PropertyByIndex(u32 index) const;
|
||||
IProperty* PropertyByID(u32 ID) const;
|
||||
IProperty* PropertyByIDString(const TIDString& rkStr) const;
|
||||
CPropertyStruct* StructByIndex(u32 index) const;
|
||||
CPropertyStruct* StructByID(u32 ID) const;
|
||||
CPropertyStruct* StructByIDString(const TIDString& rkStr) const;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -109,20 +124,25 @@ class CArrayProperty : public IProperty
|
||||
std::vector<CPropertyStruct*> mSubStructs;
|
||||
|
||||
public:
|
||||
CArrayProperty(IPropertyTemplate *pTemp)
|
||||
: IProperty(pTemp) {}
|
||||
CArrayProperty(IPropertyTemplate *pTemp, CPropertyStruct *pParent)
|
||||
: IProperty(pTemp, pParent) {}
|
||||
|
||||
EPropertyType Type() { return eArrayProperty; }
|
||||
~CArrayProperty() {
|
||||
for (u32 iSub = 0; iSub < mSubStructs.size(); iSub++)
|
||||
delete mSubStructs[iSub];
|
||||
}
|
||||
|
||||
EPropertyType Type() const { return eArrayProperty; }
|
||||
|
||||
// Inline
|
||||
inline u32 Count() { return mSubStructs.size(); }
|
||||
inline u32 Count() const { return mSubStructs.size(); }
|
||||
inline void Reserve(u32 amount) { mSubStructs.reserve(amount); }
|
||||
inline CPropertyStruct* ElementByIndex(u32 index) { return mSubStructs[index]; }
|
||||
inline CPropertyStruct* operator[](u32 index) { return ElementByIndex(index); }
|
||||
|
||||
// Functions
|
||||
void Resize(u32 Size);
|
||||
CStructTemplate* SubStructTemplate();
|
||||
CStructTemplate* SubStructTemplate() const;
|
||||
};
|
||||
|
||||
#endif // IPROPERTY
|
||||
|
||||
@@ -66,9 +66,11 @@ public:
|
||||
{
|
||||
if (rkParamName == "should_cook")
|
||||
{
|
||||
if (rkValue == "always")
|
||||
TString lValue = rkValue.ToLower();
|
||||
|
||||
if (lValue == "always")
|
||||
mCookPreference = eAlwaysCook;
|
||||
else if (rkValue == "never")
|
||||
else if (lValue == "never")
|
||||
mCookPreference = eNeverCook;
|
||||
else
|
||||
mCookPreference = eNoCookPreference;
|
||||
@@ -78,7 +80,7 @@ public:
|
||||
mDescription = rkValue;
|
||||
}
|
||||
|
||||
virtual IProperty* InstantiateProperty() = 0;
|
||||
virtual IProperty* InstantiateProperty(CPropertyStruct *pParent) = 0;
|
||||
|
||||
inline TString Name() const
|
||||
{
|
||||
@@ -152,14 +154,14 @@ public:
|
||||
IPropertyTemplate::SetParam(rkParamName, rkValue);
|
||||
|
||||
if (rkParamName == "default")
|
||||
mDefaultValue.FromString(rkValue);
|
||||
mDefaultValue.FromString(rkValue.ToLower());
|
||||
}
|
||||
|
||||
virtual IProperty* InstantiateProperty()
|
||||
virtual IProperty* InstantiateProperty(CPropertyStruct *pParent)
|
||||
{
|
||||
typedef TTypedProperty<PropType, PropTypeEnum, ValueClass> TPropertyType;
|
||||
|
||||
TPropertyType *pOut = new TPropertyType(this);
|
||||
TPropertyType *pOut = new TPropertyType(this, pParent);
|
||||
pOut->Set(GetDefaultValue());
|
||||
return pOut;
|
||||
}
|
||||
@@ -215,7 +217,7 @@ public:
|
||||
|
||||
if (rkParamName == "range")
|
||||
{
|
||||
TStringList Components = rkValue.Split(", ");
|
||||
TStringList Components = rkValue.ToLower().Split(", ");
|
||||
|
||||
if (Components.size() == 2)
|
||||
{
|
||||
@@ -271,9 +273,9 @@ public:
|
||||
virtual bool CanHaveDefault() const { return false; }
|
||||
virtual bool IsNumerical() const { return false; }
|
||||
|
||||
IProperty* InstantiateProperty()
|
||||
IProperty* InstantiateProperty(CPropertyStruct *pParent)
|
||||
{
|
||||
return new TFileProperty(this);
|
||||
return new TFileProperty(this, pParent);
|
||||
}
|
||||
|
||||
void SetAllowedExtensions(const TStringList& rkExtensions)
|
||||
@@ -342,9 +344,9 @@ public:
|
||||
virtual bool CanHaveDefault() const { return true; }
|
||||
virtual bool IsNumerical() const { return false; }
|
||||
|
||||
virtual IProperty* InstantiateProperty()
|
||||
virtual IProperty* InstantiateProperty(CPropertyStruct *pParent)
|
||||
{
|
||||
TEnumProperty *pEnum = new TEnumProperty(this);
|
||||
TEnumProperty *pEnum = new TEnumProperty(this, pParent);
|
||||
u32 Index = EnumeratorIndex(GetDefaultValue());
|
||||
pEnum->Set(Index);
|
||||
return pEnum;
|
||||
@@ -411,9 +413,9 @@ public:
|
||||
virtual bool CanHaveDefault() const { return true; }
|
||||
virtual bool IsNumerical() const { return false; }
|
||||
|
||||
virtual IProperty* InstantiateProperty()
|
||||
virtual IProperty* InstantiateProperty(CPropertyStruct *pParent)
|
||||
{
|
||||
TBitfieldProperty *pBitfield = new TBitfieldProperty(this);
|
||||
TBitfieldProperty *pBitfield = new TBitfieldProperty(this, pParent);
|
||||
pBitfield->Set(GetDefaultValue());
|
||||
return pBitfield;
|
||||
}
|
||||
@@ -466,13 +468,13 @@ public:
|
||||
bool CanHaveDefault() const { return false; }
|
||||
bool IsNumerical() const { return false; }
|
||||
|
||||
IProperty* InstantiateProperty()
|
||||
IProperty* InstantiateProperty(CPropertyStruct *pParent)
|
||||
{
|
||||
CPropertyStruct *pStruct = new CPropertyStruct(this);
|
||||
CPropertyStruct *pStruct = new CPropertyStruct(this, pParent);
|
||||
|
||||
for (u32 iSub = 0; iSub < mSubProperties.size(); iSub++)
|
||||
{
|
||||
IProperty *pSubProp = mSubProperties[iSub]->InstantiateProperty();
|
||||
IProperty *pSubProp = mSubProperties[iSub]->InstantiateProperty(pStruct);
|
||||
pStruct->AddSubProperty(pSubProp);
|
||||
}
|
||||
|
||||
@@ -516,14 +518,14 @@ public:
|
||||
|
||||
EPropertyType Type() const { return eArrayProperty; }
|
||||
|
||||
IProperty* InstantiateProperty()
|
||||
IProperty* InstantiateProperty(CPropertyStruct *pParent)
|
||||
{
|
||||
return new CArrayProperty(this);
|
||||
return new CArrayProperty(this, pParent);
|
||||
}
|
||||
|
||||
CPropertyStruct* CreateSubStruct()
|
||||
{
|
||||
return (CPropertyStruct*) CStructTemplate::InstantiateProperty();
|
||||
return (CPropertyStruct*) CStructTemplate::InstantiateProperty(nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ void CDoorExtra::AddToRenderer(CRenderer *pRenderer, const SViewInfo& ViewInfo)
|
||||
{
|
||||
if (!mpShieldModel) return;
|
||||
if (ViewInfo.GameMode && !mpInstance->IsActive()) return;
|
||||
if ((ViewInfo.ShowFlags & eShowObjectGeometry) == 0) return;
|
||||
if (!ViewInfo.GameMode && ((ViewInfo.ShowFlags & eShowObjectGeometry) == 0)) return;
|
||||
|
||||
if (mpParent->IsVisible() && ViewInfo.ViewFrustum.BoxInFrustum(AABox()))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user