mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-14 23:56:23 +00:00
Changed Echoes enum properties to choices
This commit is contained in:
@@ -306,6 +306,33 @@ void SetPropertyName(u32 ID, const char* pkTypeName, const char* pkNewName)
|
||||
}
|
||||
}
|
||||
|
||||
/** Change the type name associated with a property ID */
|
||||
void SetTypeName(u32 ID, const char* pkOldTypeName, const char* pkNewTypeName)
|
||||
{
|
||||
u32 OldTypeHash = CCRC32::StaticHashString(pkOldTypeName);
|
||||
u32 NewTypeHash = CCRC32::StaticHashString(pkNewTypeName);
|
||||
|
||||
SNameKey OldKey( OldTypeHash, ID );
|
||||
auto MapNode = gNameMap.extract(OldKey);
|
||||
|
||||
if (!MapNode.empty())
|
||||
{
|
||||
SNameKey& Key = MapNode.key();
|
||||
SNameValue& Value = MapNode.mapped();
|
||||
Key.TypeHash = NewTypeHash;
|
||||
gHashToTypeName[NewTypeHash] = pkNewTypeName;
|
||||
|
||||
for (auto Iter = Value.PropertyList.begin(); Iter != Value.PropertyList.end(); Iter++)
|
||||
{
|
||||
IProperty* pProperty = *Iter;
|
||||
pProperty->RecacheName();
|
||||
}
|
||||
|
||||
gNameMap.insert( std::move(MapNode) );
|
||||
gMapIsDirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
/** Registers a property in the name map. Should be called on all properties that use the map */
|
||||
void RegisterProperty(IProperty* pProperty)
|
||||
{
|
||||
|
||||
@@ -34,6 +34,9 @@ void RetrieveXMLsWithProperty(u32 ID, const char* pkTypeName, std::set<TString>&
|
||||
/** Updates the name of a given property in the map */
|
||||
void SetPropertyName(u32 ID, const char* pkTypeName, const char* pkNewName);
|
||||
|
||||
/** Change the type name associated with a property ID */
|
||||
void SetTypeName(u32 ID, const char* pkOldTypeName, const char* pkNewTypeName);
|
||||
|
||||
/** Registers a property in the name map. Should be called on all properties that use the map */
|
||||
void RegisterProperty(IProperty* pProperty);
|
||||
|
||||
|
||||
@@ -416,6 +416,11 @@ bool IProperty::HasAccurateName()
|
||||
return mFlags.HasFlag( EPropertyFlag::HasCorrectPropertyName );
|
||||
}
|
||||
|
||||
void IProperty::RecacheName()
|
||||
{
|
||||
mFlags.ClearFlag( EPropertyFlag::HasCachedNameCheck | EPropertyFlag::HasCorrectPropertyName );
|
||||
}
|
||||
|
||||
/** IPropertyNew Accessors */
|
||||
EGame IProperty::Game() const
|
||||
{
|
||||
|
||||
@@ -202,6 +202,7 @@ public:
|
||||
void ClearDirtyFlag();
|
||||
bool UsesNameMap();
|
||||
bool HasAccurateName();
|
||||
void RecacheName();
|
||||
|
||||
/** Accessors */
|
||||
EGame Game() const;
|
||||
|
||||
Reference in New Issue
Block a user