mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
Added ToInt() and ToDouble() functions to ZScript string
https://forum.zdoom.org/viewtopic.php?t=57678
This commit is contained in:
parent
2f3cd7775a
commit
7b98fdb910
2 changed files with 15 additions and 0 deletions
|
@ -1280,3 +1280,16 @@ DEFINE_ACTION_FUNCTION(FStringStruct, ToLower)
|
|||
self->ToLower();
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FStringStruct, ToInt)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FString);
|
||||
PARAM_INT_DEF(base);
|
||||
ACTION_RETURN_INT(self->ToLong(base));
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FStringStruct, ToDouble)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FString);
|
||||
ACTION_RETURN_FLOAT(self->ToDouble());
|
||||
}
|
||||
|
|
|
@ -664,6 +664,8 @@ struct StringStruct native
|
|||
native int LastIndexOf(String substr) const;
|
||||
native void ToUpper();
|
||||
native void ToLower();
|
||||
native int ToInt(int base = 0) const;
|
||||
native double ToDouble() const;
|
||||
}
|
||||
|
||||
class SectorEffect : Thinker native
|
||||
|
|
Loading…
Reference in a new issue