mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-10 05:57:48 +00:00
Added AnimationParameters property type, decreased contents margins for struct properties in the modify tab, other minor fixes/cleanup
This commit is contained in:
@@ -102,6 +102,10 @@ CPropertyStruct* CScriptLoader::LoadStructMP1(CInputStream& SCLY, CStructTemplat
|
||||
pProp = LoadStructMP1(SCLY, StructTmp);
|
||||
break;
|
||||
}
|
||||
case eAnimParamsProperty: {
|
||||
pProp = new CAnimParamsProperty(CAnimationParameters(SCLY, mVersion));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
pProp = new CUnknownProperty();
|
||||
break;
|
||||
@@ -192,15 +196,17 @@ CScriptLayer* CScriptLoader::LoadLayerMP1(CInputStream &SCLY)
|
||||
void CScriptLoader::LoadStructMP2(CInputStream& SCLY, CPropertyStruct *pStruct, CStructTemplate *pTemp)
|
||||
{
|
||||
// Verify property count
|
||||
u32 propCount = pTemp->Count();
|
||||
|
||||
if (!pTemp->IsSingleProperty())
|
||||
{
|
||||
u16 numProperties = SCLY.ReadShort();
|
||||
if (numProperties != pTemp->Count())
|
||||
if ((numProperties != propCount) && (mVersion < eReturns))
|
||||
Log::FileWarning(SCLY.GetSourceString(), SCLY.Tell() - 2, "Struct \"" + pTemp->Name() + "\" template property count doesn't match file");
|
||||
propCount = numProperties;
|
||||
}
|
||||
|
||||
// Parse properties
|
||||
u32 propCount = pTemp->Count();
|
||||
pStruct->Reserve(propCount);
|
||||
|
||||
for (u32 iProp = 0; iProp < propCount; iProp++)
|
||||
@@ -351,6 +357,11 @@ void CScriptLoader::LoadStructMP2(CInputStream& SCLY, CPropertyStruct *pStruct,
|
||||
break;
|
||||
}
|
||||
|
||||
case eAnimParamsProperty: {
|
||||
CAnimParamsProperty *pAnimCast = static_cast<CAnimParamsProperty*>(pProp);
|
||||
pAnimCast->Set(CAnimationParameters(SCLY, mVersion));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "CTemplateLoader.h"
|
||||
#include "CWorldLoader.h"
|
||||
#include "../script/EAttribType.h"
|
||||
#include <Core/Log.h>
|
||||
|
||||
void CTemplateLoader::LoadStructProperties(tinyxml2::XMLElement *pElem, CStructTemplate *pTemp, const std::string& templateName)
|
||||
|
||||
Reference in New Issue
Block a user