gave translations a dedicated scripted type.

This is needed for implementing reliable serialization of custom translations. As long as they are merely ints they cannot be restored on loading a savegame because the serialization code does not know that these variables are special.
This commit is contained in:
Christoph Oelckers 2023-11-09 17:22:46 +01:00
commit f0c9b1765e
19 changed files with 341 additions and 34 deletions

View file

@ -1196,6 +1196,21 @@ FSerializer &Serialize(FSerializer &arc, const char *key, FTextureID &value, FTe
return arc;
}
//==========================================================================
//
//
//
//==========================================================================
FSerializer& Serialize(FSerializer& arc, const char* key, FTranslationID& value, FTranslationID* defval)
{
int v = value.index();
int* defv = (int*)defval;
Serialize(arc, key, v, defv);
value = FTranslationID::fromInt(v);
return arc;
}
//==========================================================================
//
// This never uses defval and instead uses 'null' as default