Added <System.FileExists(FilePath)> construct

Returns if the specified file (including extension) exists (relative to the GameMode's ContentPath).
This commit is contained in:
JappaWakka 2024-04-22 19:25:07 +02:00
parent 3318a6accc
commit 81f05a3bd1
2 changed files with 5 additions and 1 deletions

View File

@ -152,8 +152,10 @@
Return output Return output
Case "scriptlevel" Case "scriptlevel"
Return ActionScript.ScriptLevelIndex.ToString() Return ActionScript.ScriptLevelIndex.ToString()
case "language" Case "language"
Return Localization.LanguageSuffix Return Localization.LanguageSuffix
Case "fileexists"
Return ReturnBoolean(GameModeManager.ContentFileExists(argument))
End Select End Select
Return DefaultNull Return DefaultNull

View File

@ -435,6 +435,8 @@ Namespace ScriptVersion2
r(New ScriptCommand("system", "issng", "bool", {New ScriptArgument("expression", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Checks if the expression is a single (Outdated, use <math.issng> instead).", ",", True)) r(New ScriptCommand("system", "issng", "bool", {New ScriptArgument("expression", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Checks if the expression is a single (Outdated, use <math.issng> instead).", ",", True))
r(New ScriptCommand("system", "chrw", "str", {New ScriptArgument("charCodes", ScriptArgument.ArgumentTypes.IntArr)}.ToList(), "Converts Unicode CharCodes into a string.", ",", True)) r(New ScriptCommand("system", "chrw", "str", {New ScriptArgument("charCodes", ScriptArgument.ArgumentTypes.IntArr)}.ToList(), "Converts Unicode CharCodes into a string.", ",", True))
r(New ScriptCommand("system", "scriptlevel", "int", "Returns the current script level (call depth).", ",", True)) r(New ScriptCommand("system", "scriptlevel", "int", "Returns the current script level (call depth).", ",", True))
r(New ScriptCommand("system", "Language", "str", "Returns the current game language suffix.", ",", True))
r(New ScriptCommand("system", "FileExists", "bool", {New ScriptArgument("filePath", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Returns if the specified file (including extension) exists (relative to the GameMode's ContentPath).", ",", True))
End Sub End Sub
Private Shared Sub DoEnvironment() Private Shared Sub DoEnvironment()