From 81f05a3bd1c2fac303fa469090476f3c3c05164f Mon Sep 17 00:00:00 2001 From: JappaWakka Date: Mon, 22 Apr 2024 19:25:07 +0200 Subject: [PATCH] Added construct Returns if the specified file (including extension) exists (relative to the GameMode's ContentPath). --- P3D/World/ActionScript/V2/ScriptConstructs/DoSystem.vb | 4 +++- P3D/World/ActionScript/V2/ScriptLibrary.vb | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/P3D/World/ActionScript/V2/ScriptConstructs/DoSystem.vb b/P3D/World/ActionScript/V2/ScriptConstructs/DoSystem.vb index 36b50d61c..464075131 100644 --- a/P3D/World/ActionScript/V2/ScriptConstructs/DoSystem.vb +++ b/P3D/World/ActionScript/V2/ScriptConstructs/DoSystem.vb @@ -152,8 +152,10 @@ Return output Case "scriptlevel" Return ActionScript.ScriptLevelIndex.ToString() - case "language" + Case "language" Return Localization.LanguageSuffix + Case "fileexists" + Return ReturnBoolean(GameModeManager.ContentFileExists(argument)) End Select Return DefaultNull diff --git a/P3D/World/ActionScript/V2/ScriptLibrary.vb b/P3D/World/ActionScript/V2/ScriptLibrary.vb index d332c96f2..c5c8bfa01 100644 --- a/P3D/World/ActionScript/V2/ScriptLibrary.vb +++ b/P3D/World/ActionScript/V2/ScriptLibrary.vb @@ -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 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", "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 Private Shared Sub DoEnvironment()