- added a new 'Translate' struct which wraps the native methods of 'Translation'.

This is for use in actors where the name 'Translation' is shadowed by a local member variable.
This commit is contained in:
Christoph Oelckers 2020-10-17 09:22:27 +02:00
parent 19444194a5
commit adf306d5b2
1 changed files with 17 additions and 1 deletions

View File

@ -46,11 +46,27 @@ extend struct Translation
{
Color colors[256];
native int AddTranslation();
native static bool SetPlayerTranslation(int group, int num, int plrnum, PlayerClass pclass);
native static int GetID(Name transname);
}
// This is needed because Actor contains a field named 'translation' which shadows the above.
struct Translate version("4.5")
{
static int MakeID(int group, int num)
{
return (group << 16) + num;
}
static bool SetPlayerTranslation(int group, int num, int plrnum, PlayerClass pclass)
{
return Translation.SetPlayerTranslation(group, num, plrnum, pclass);
}
static int GetID(Name transname)
{
return Translation.GetID(transname);
}
}
struct DamageTypeDefinition native
{
native static bool IgnoreArmor(Name type);