- exported GetUDMF methods to scripting.

This commit is contained in:
Christoph Oelckers 2017-02-15 01:03:47 +01:00
commit 6fef653aa1
4 changed files with 102 additions and 4 deletions

View file

@ -342,7 +342,7 @@ FUDMFKey *FUDMFKeys::Find(FName key)
//
//===========================================================================
int GetUDMFInt(int type, int index, const char *key)
int GetUDMFInt(int type, int index, FName key)
{
assert(type >=0 && type <=3);
@ -359,7 +359,16 @@ int GetUDMFInt(int type, int index, const char *key)
return 0;
}
double GetUDMFFloat(int type, int index, const char *key)
DEFINE_ACTION_FUNCTION(FLevelLocals, GetUDMFInt)
{
PARAM_SELF_STRUCT_PROLOGUE(FLevelLocals);
PARAM_INT(type);
PARAM_INT(index);
PARAM_NAME(key);
ACTION_RETURN_INT(GetUDMFInt(type, index, key));
}
double GetUDMFFloat(int type, int index, FName key)
{
assert(type >=0 && type <=3);
@ -376,6 +385,41 @@ double GetUDMFFloat(int type, int index, const char *key)
return 0;
}
DEFINE_ACTION_FUNCTION(FLevelLocals, GetUDMFFloat)
{
PARAM_SELF_STRUCT_PROLOGUE(FLevelLocals);
PARAM_INT(type);
PARAM_INT(index);
PARAM_NAME(key);
ACTION_RETURN_FLOAT(GetUDMFFloat(type, index, key));
}
FString GetUDMFString(int type, int index, FName key)
{
assert(type >= 0 && type <= 3);
FUDMFKeys *pKeys = UDMFKeys[type].CheckKey(index);
if (pKeys != NULL)
{
FUDMFKey *pKey = pKeys->Find(key);
if (pKey != NULL)
{
return pKey->StringVal;
}
}
return "";
}
DEFINE_ACTION_FUNCTION(FLevelLocals, GetUDMFString)
{
PARAM_SELF_STRUCT_PROLOGUE(FLevelLocals);
PARAM_INT(type);
PARAM_INT(index);
PARAM_NAME(key);
ACTION_RETURN_STRING(GetUDMFString(type, index, key));
}
//===========================================================================
//