mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-17 00:47:05 +00:00
Added support for renaming property archetypes. Added support for enums to override the default type name. Added the ability for enums/choices/flags with no values/flags to be edited as ints.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "CPropertyNameValidator.h"
|
||||
#include "UICommon.h"
|
||||
#include <Common/Hash/CCRC32.h>
|
||||
|
||||
CPropertyNameValidator::CPropertyNameValidator(QObject* pParent)
|
||||
@@ -12,14 +13,23 @@ void CPropertyNameValidator::SetProperty(IProperty* pProp)
|
||||
emit changed();
|
||||
}
|
||||
|
||||
/** Set the type name override */
|
||||
void CPropertyNameValidator::SetTypeNameOverride(const QString& kNewTypeName)
|
||||
{
|
||||
mTypeNameOverride = kNewTypeName;
|
||||
emit changed();
|
||||
}
|
||||
|
||||
/** Perform validation */
|
||||
QValidator::State CPropertyNameValidator::validate(QString& rInput, int&) const
|
||||
{
|
||||
if (mpProperty)
|
||||
{
|
||||
TString TypeName = (mTypeNameOverride.isEmpty() ? mpProperty->HashableTypeName() : TO_TSTRING(mTypeNameOverride));
|
||||
|
||||
CCRC32 Hash;
|
||||
Hash.Hash( rInput.toStdString().c_str() );
|
||||
Hash.Hash( mpProperty->HashableTypeName() );
|
||||
Hash.Hash( *TypeName );
|
||||
u32 PropertyID = Hash.Digest();
|
||||
|
||||
if (PropertyID != mpProperty->ID())
|
||||
|
||||
Reference in New Issue
Block a user