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.
Afficher le fichier Open project: NexusMods/NexusModManager-4.5 Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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.
Résultat void

CompleteFileInstallation() public méthode

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

DontInstallAnyDataFiles() public méthode

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

DontInstallAnyPlugins() public méthode

Instructs the installer not to automatically install the plugins.
public DontInstallAnyPlugins ( ) : void
Résultat void

DontInstallDataFile() public méthode

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.
Résultat void

DontInstallDataFolder() public méthode

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.
Résultat void

DontInstallDataFolder() public méthode

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.
Résultat void

DontInstallModFile() public méthode

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.
Résultat void

DontInstallModFolder() public méthode

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.
Résultat void

DontInstallPlugin() public méthode

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.
Résultat void

GetDirectoryName() public méthode

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.
Résultat void

GetFileName() public méthode

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.
Résultat void

GetFileNameWithoutExtension() public méthode

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.
Résultat void

GetVar() public méthode

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.
Résultat string

InputString() public méthode

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.
Résultat void

InputString() public méthode

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.
Résultat void

InputString() public méthode

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.
Résultat void

InstallAllDataFiles() public méthode

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

InstallAllPlugins() public méthode

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

LoadAfter() public méthode

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.
Résultat void

LoadBefore() public méthode

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.
Résultat void

LoadEarly() public méthode

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.
Résultat void

ModScriptInterpreterContext() public méthode

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.
Résultat System

RemoveString() public méthode

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.
Résultat void

RemoveString() public méthode

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.
Résultat void

SetVar() public méthode

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.
Résultat void

StringLength() public méthode

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.
Résultat void

Substring() public méthode

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.
Résultat void

Substring() public méthode

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.
Résultat void

fSet() public méthode

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

iSet() public méthode

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