mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-15 16:16:14 +00:00
Fixed doors not rendering correctly, fixed array properties not displaying correctly, fixed crashes when accessing certain property types
This commit is contained in:
@@ -340,21 +340,33 @@ IPropertyNew* CTemplateLoader::LoadProperty(XMLElement* pElem, CScriptTemplate*
|
||||
}
|
||||
else
|
||||
{
|
||||
pArray->mpItemArchetype = IPropertyNew::Create(EPropertyTypeNew::Struct, mGame);
|
||||
pStruct = TPropCast<CStructPropertyNew>(pArray->mpItemArchetype);
|
||||
pStruct->mFlags = EPropertyFlag::IsAtomic | EPropertyFlag::IsArrayArchetype;
|
||||
if (Name == "Activation Times")
|
||||
{
|
||||
CFloatProperty* pFloatItem = (CFloatProperty*) IPropertyNew::Create(EPropertyTypeNew::Float, mGame);
|
||||
pFloatItem->mName = "Time";
|
||||
pFloatItem->mID = 0;
|
||||
pFloatItem->mDefaultValue = 0.0f;
|
||||
pFloatItem->mFlags = EPropertyFlag::IsArrayArchetype;
|
||||
pArray->mpItemArchetype = pFloatItem;
|
||||
}
|
||||
else
|
||||
{
|
||||
pArray->mpItemArchetype = IPropertyNew::Create(EPropertyTypeNew::Struct, mGame);
|
||||
pStruct = TPropCast<CStructPropertyNew>(pArray->mpItemArchetype);
|
||||
pStruct->mFlags = EPropertyFlag::IsAtomic | EPropertyFlag::IsArrayArchetype;
|
||||
}
|
||||
}
|
||||
|
||||
XMLElement* pItemNameElem = pElem->FirstChildElement("element_name");
|
||||
|
||||
if (pItemNameElem)
|
||||
if (pStruct && pItemNameElem)
|
||||
pStruct->mName = pItemNameElem->GetText();
|
||||
}
|
||||
|
||||
// Load parameter overrides
|
||||
XMLElement *pProperties = pElem->FirstChildElement("properties");
|
||||
|
||||
if (pProperties)
|
||||
if (pStruct && pProperties)
|
||||
{
|
||||
LoadProperties(pProperties, pScript, pStruct, rkTemplateName);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ void IPropertyNew::Serialize(IArchive& rArc)
|
||||
//
|
||||
// We can't currently tell if this property is atomic, as the flag hasn't been serialized and the parent
|
||||
// hasn't been set, but atomic sub-properties don't use hash IDs, so we can do a pseudo-check against the ID.
|
||||
if (rArc.Game() <= ePrime || IsRootParent() || mID <= 0xFF)
|
||||
if (rArc.Game() <= ePrime || IsRootParent() || IsArrayArchetype() || mID <= 0xFF)
|
||||
{
|
||||
rArc << SerialParameter("Name", mName, mpArchetype ? SH_Optional : 0, mpArchetype ? mpArchetype->mName : "");
|
||||
}
|
||||
@@ -162,7 +162,7 @@ void IPropertyNew::Initialize(IPropertyNew* pInParent, CScriptTemplate* pInTempl
|
||||
mpScriptTemplate = pInTemplate;
|
||||
|
||||
// Look up property name if needed.
|
||||
if (Game() >= eEchoesDemo && !IsRootParent() && !IsIntrinsic() && !mpParent->IsAtomic())
|
||||
if (Game() >= eEchoesDemo && !IsRootParent() && !IsIntrinsic() && !mpParent->IsAtomic() && !IsArrayArchetype())
|
||||
{
|
||||
mName = CMasterTemplate::PropertyName(mID);
|
||||
}
|
||||
@@ -301,8 +301,8 @@ bool IPropertyNew::HasAccurateName()
|
||||
if (mID == FOURCC('XFRM') || mID == FOURCC('INAM') || mID == FOURCC('ACTV'))
|
||||
return true;
|
||||
|
||||
// Children of atomic properties defer to parents. Intrinsic properties also defer to parents.
|
||||
if ( (mpParent && mpParent->IsAtomic()) || IsIntrinsic() )
|
||||
// Children of atomic properties defer to parents. Intrinsic properties and array archetypes also defer to parents.
|
||||
if ( (mpParent && mpParent->IsAtomic()) || IsIntrinsic() || IsArrayArchetype() )
|
||||
{
|
||||
if (mpParent)
|
||||
return mpParent->HasAccurateName();
|
||||
|
||||
@@ -37,6 +37,11 @@ void CDoorExtra::PropertyModified(IPropertyNew* pProperty)
|
||||
MarkTransformChanged();
|
||||
}
|
||||
|
||||
else if (pProperty == mShieldColorProp)
|
||||
{
|
||||
mShieldColor = mShieldColorProp.Get();
|
||||
}
|
||||
|
||||
else if (pProperty == mDisabledProp)
|
||||
{
|
||||
// The Echoes demo doesn't have the shield color property. The color is
|
||||
|
||||
Reference in New Issue
Block a user