C# Class Nexus.Client.ModManagement.Scripting.ModScript.ModScriptInterpreterContext

Provides the function context to use when executing Mod Script scripts.
This provides some methods for changing the state of the script execution context. This includes tracking variable values, and files that should not be installed. All values in Mod Script are strings. Thus, all parameters to the functions are strings. If they represent another datatype, the functions must convert the values before using them. There are a few exceptions, where some methods accept non-string parameters. This is becuase these methods are called by the interpreter, and not from the interpreted code.
ファイルを表示 Open project: NexusMods/NexusModManager-4.5 Class Usage Examples

Public Methods

Method Description
CombinePaths ( string p_strVariableName, string p_strPath1, string p_strPath2 ) : void

Combines the given paths, and stores it in the specified variable.

CompleteFileInstallation ( ) : void

Installs all files in the mod that have not been excluded from being installed.

DontInstallAnyDataFiles ( ) : void

Instructs the installer not to automatically install the data files.

DontInstallAnyPlugins ( ) : void

Instructs the installer not to automatically install the plugins.

DontInstallDataFile ( string p_strPath ) : void

Installs the specified file from the mod to the file system.

This is an alias for DontInstallModFile(string). It exists to maintain compatibility with old Mod Scripts.

DontInstallDataFolder ( string p_strPath ) : void

Adds the given files in the specified mod folder to the list of files not to install when doing an install.

This is an alias for DontInstallModFolder(string, string). It exists to maintain compatibility with old Mod Scripts.

DontInstallDataFolder ( string p_strPath, string p_strRecurse ) : void

Adds the given files in the specified mod folder to the list of files not to install when doing an install.

This is an alias for DontInstallModFolder(string, string). It exists to maintain compatibility with old Mod Scripts.

DontInstallModFile ( string p_strPath ) : void

Adds the given file to the list of files not to install when doing an install.

DontInstallModFolder ( string p_strPath, string p_strRecurse ) : void

Adds the given files in the specified mod folder to the list of files not to install when doing an install.

DontInstallPlugin ( string p_strPath ) : void

Installs the specified file from the mod to the file system.

This is an alias for DontInstallModFile(string). It exists to maintain compatibility with old Mod Scripts.

GetDirectoryName ( string p_strVariableName, string p_strPath ) : void

Gets the name of the directory of the given path, and stores it in the specified variable.

GetFileName ( string p_strVariableName, string p_strPath ) : void

Gets the name of the file of the given path, including extension, and stores it in the specified variable.

GetFileNameWithoutExtension ( string p_strVariableName, string p_strPath ) : void

Gets the name of the file of the given path, excluding extension, and stores it in the specified variable.

GetVar ( string p_strVariableName ) : string

Gets the value of the specified variable.

InputString ( string p_strVariableName ) : void

Displays text editor, and stores the entered text in the specified variable.

InputString ( string p_strVariableName, string p_strTitle ) : void

Displays text editor, and returns the entered text in the specified variable.

InputString ( string p_strVariableName, string p_strTitle, string p_strInitialValue ) : void

Displays text editor, and returns the entered text in the specified variable.

InstallAllDataFiles ( ) : void

Installs all non-plugin files that have not been excluded.

InstallAllPlugins ( ) : void

Installs all plugin files that have not been excluded.

LoadAfter ( string p_strLoadSecond, string p_strLoadFirst ) : void

Ensures that one plugin is loaded after another.

LoadBefore ( string p_strLoadFirst, string p_strLoadSecond ) : void

Ensures that one plugin is loaded before another.

LoadEarly ( string p_strPlugin ) : void

Ensures that the given plugin is loaded early in the load order.

ModScriptInterpreterContext ( Nexus.Client.ModManagement.Scripting.ModScript.ModScriptFunctionProxy p_msfFunctions ) : System

A simple construtor that initializes the object with the given dependencies.

RemoveString ( string p_strVariableName, string p_strValue, string p_strStart ) : void

Removes the specified substring from the given value, and stores it in the specified variable.

RemoveString ( string p_strVariableName, string p_strValue, string p_strStart, string p_strLength ) : void

Removes the specified substring from the given value, and stores it in the specified variable.

SetVar ( string p_strVariableName, string p_strValue ) : void

Sets the value of the specified varaible.

StringLength ( string p_strVariableName, string p_strValue ) : void

Gets the length of the given value, and stores it in the specified variable.

Substring ( string p_strVariableName, string p_strValue, string p_strStart ) : void

Gets the specified substring of the given value, and stores it in the specified variable.

Substring ( string p_strVariableName, string p_strValue, string p_strStart, string p_strLength ) : void

Gets the specified substring of the given value, and stores it in the specified variable.

fSet ( ) : void

Evaluates the given mathematical expression, and stores the result in the specified variable.

This is an alias for iSet.

iSet ( ) : void

Evaluates the given mathematical expression, and stores the result in the specified variable.

Method Details

CombinePaths() public method

Combines the given paths, and stores it in the specified variable.
public CombinePaths ( string p_strVariableName, string p_strPath1, string p_strPath2 ) : void
p_strVariableName string The name of the variable in which to store the conbined path.
p_strPath1 string The first path to combine.
p_strPath2 string The second path to combine.
return void

CompleteFileInstallation() public method

Installs all files in the mod that have not been excluded from being installed.
public CompleteFileInstallation ( ) : void
return void

DontInstallAnyDataFiles() public method

Instructs the installer not to automatically install the data files.
public DontInstallAnyDataFiles ( ) : void
return void

DontInstallAnyPlugins() public method

Instructs the installer not to automatically install the plugins.
public DontInstallAnyPlugins ( ) : void
return void

DontInstallDataFile() public method

Installs the specified file from the mod to the file system.
This is an alias for DontInstallModFile(string). It exists to maintain compatibility with old Mod Scripts.
public DontInstallDataFile ( string p_strPath ) : void
p_strPath string The path of the file to install.
return void

DontInstallDataFolder() public method

Adds the given files in the specified mod folder to the list of files not to install when doing an install.
This is an alias for DontInstallModFolder(string, string). It exists to maintain compatibility with old Mod Scripts.
public DontInstallDataFolder ( string p_strPath ) : void
p_strPath string The path of the folder in the mod whose files to exclude when doing an install.
return void

DontInstallDataFolder() public method

Adds the given files in the specified mod folder to the list of files not to install when doing an install.
This is an alias for DontInstallModFolder(string, string). It exists to maintain compatibility with old Mod Scripts.
public DontInstallDataFolder ( string p_strPath, string p_strRecurse ) : void
p_strPath string The path of the folder in the mod whose files to exclude when doing an install.
p_strRecurse string Whether to exclude all files in all subfolders.
return void

DontInstallModFile() public method

Adds the given file to the list of files not to install when doing an install.
public DontInstallModFile ( string p_strPath ) : void
p_strPath string The path of the file in the mod to exclude when doing an install.
return void

DontInstallModFolder() public method

Adds the given files in the specified mod folder to the list of files not to install when doing an install.
public DontInstallModFolder ( string p_strPath, string p_strRecurse ) : void
p_strPath string The path of the folder in the mod whose files to exclude when doing an install.
p_strRecurse string Whether to exclude all files in all subfolders.
return void

DontInstallPlugin() public method

Installs the specified file from the mod to the file system.
This is an alias for DontInstallModFile(string). It exists to maintain compatibility with old Mod Scripts.
public DontInstallPlugin ( string p_strPath ) : void
p_strPath string The path of the file to install.
return void

GetDirectoryName() public method

Gets the name of the directory of the given path, and stores it in the specified variable.
public GetDirectoryName ( string p_strVariableName, string p_strPath ) : void
p_strVariableName string The name of the variable in which to store the conbined path.
p_strPath string The path from which to extract the directory name.
return void

GetFileName() public method

Gets the name of the file of the given path, including extension, and stores it in the specified variable.
public GetFileName ( string p_strVariableName, string p_strPath ) : void
p_strVariableName string The name of the variable in which to store the conbined path.
p_strPath string The path from which to extract the file name.
return void

GetFileNameWithoutExtension() public method

Gets the name of the file of the given path, excluding extension, and stores it in the specified variable.
public GetFileNameWithoutExtension ( string p_strVariableName, string p_strPath ) : void
p_strVariableName string The name of the variable in which to store the combined path.
p_strPath string The path from which to extract the file name.
return void

GetVar() public method

Gets the value of the specified variable.
public GetVar ( string p_strVariableName ) : string
p_strVariableName string The name of the variable whose value is to be returned.
return string

InputString() public method

Displays text editor, and stores the entered text in the specified variable.
public InputString ( string p_strVariableName ) : void
p_strVariableName string The name of the variable in which to store the text.
return void

InputString() public method

Displays text editor, and returns the entered text in the specified variable.
public InputString ( string p_strVariableName, string p_strTitle ) : void
p_strVariableName string The name of the variable in which to store the text.
p_strTitle string The titel of the editor.
return void

InputString() public method

Displays text editor, and returns the entered text in the specified variable.
public InputString ( string p_strVariableName, string p_strTitle, string p_strInitialValue ) : void
p_strVariableName string The name of the variable in which to store the text.
p_strTitle string The titel of the editor.
p_strInitialValue string The initial value of the editor.
return void

InstallAllDataFiles() public method

Installs all non-plugin files that have not been excluded.
public InstallAllDataFiles ( ) : void
return void

InstallAllPlugins() public method

Installs all plugin files that have not been excluded.
public InstallAllPlugins ( ) : void
return void

LoadAfter() public method

Ensures that one plugin is loaded after another.
public LoadAfter ( string p_strLoadSecond, string p_strLoadFirst ) : void
p_strLoadSecond string The plugin after which to load the other specified plugin.
p_strLoadFirst string The plugin to load after the other specified plugin.
return void

LoadBefore() public method

Ensures that one plugin is loaded before another.
public LoadBefore ( string p_strLoadFirst, string p_strLoadSecond ) : void
p_strLoadFirst string The plugin to load before the other specified plugin.
p_strLoadSecond string The plugin before which to load the other specified plugin.
return void

LoadEarly() public method

Ensures that the given plugin is loaded early in the load order.
public LoadEarly ( string p_strPlugin ) : void
p_strPlugin string The plugin to load early.
return void

ModScriptInterpreterContext() public method

A simple construtor that initializes the object with the given dependencies.
public ModScriptInterpreterContext ( Nexus.Client.ModManagement.Scripting.ModScript.ModScriptFunctionProxy p_msfFunctions ) : System
p_msfFunctions Nexus.Client.ModManagement.Scripting.ModScript.ModScriptFunctionProxy The object that proxies the script function calls /// out of the sandbox.
return System

RemoveString() public method

Removes the specified substring from the given value, and stores it in the specified variable.
public RemoveString ( string p_strVariableName, string p_strValue, string p_strStart ) : void
p_strVariableName string The name of the variable in which to store the substring.
p_strValue string The value from which to remove the substring.
p_strStart string The inclusive start position of the substring.
return void

RemoveString() public method

Removes the specified substring from the given value, and stores it in the specified variable.
public RemoveString ( string p_strVariableName, string p_strValue, string p_strStart, string p_strLength ) : void
p_strVariableName string The name of the variable in which to store the substring.
p_strValue string The value from which to remove the substring.
p_strStart string The inclusive start position of the substring.
p_strLength string The length of the substring.
return void

SetVar() public method

Sets the value of the specified varaible.
public SetVar ( string p_strVariableName, string p_strValue ) : void
p_strVariableName string The name of the variable whose value is to be set.
p_strValue string The value to assign to the specified variable.
return void

StringLength() public method

Gets the length of the given value, and stores it in the specified variable.
public StringLength ( string p_strVariableName, string p_strValue ) : void
p_strVariableName string The name of the variable in which to store the length.
p_strValue string The value from whose length is to be determined.
return void

Substring() public method

Gets the specified substring of the given value, and stores it in the specified variable.
public Substring ( string p_strVariableName, string p_strValue, string p_strStart ) : void
p_strVariableName string The name of the variable in which to store the substring.
p_strValue string The value from which to get the substring.
p_strStart string The inclusive start position of the substring.
return void

Substring() public method

Gets the specified substring of the given value, and stores it in the specified variable.
public Substring ( string p_strVariableName, string p_strValue, string p_strStart, string p_strLength ) : void
p_strVariableName string The name of the variable in which to store the substring.
p_strValue string The value from which to get the substring.
p_strStart string The inclusive start position of the substring.
p_strLength string The length of the substring.
return void

fSet() public method

Evaluates the given mathematical expression, and stores the result in the specified variable.
This is an alias for iSet.
public fSet ( ) : void
return void

iSet() public method

Evaluates the given mathematical expression, and stores the result in the specified variable.
public iSet ( ) : void
return void