C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

CombinePaths() публичный Метод

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.
Результат void

CompleteFileInstallation() публичный Метод

Installs all files in the mod that have not been excluded from being installed.
public CompleteFileInstallation ( ) : void
Результат void

DontInstallAnyDataFiles() публичный Метод

Instructs the installer not to automatically install the data files.
public DontInstallAnyDataFiles ( ) : void
Результат void

DontInstallAnyPlugins() публичный Метод

Instructs the installer not to automatically install the plugins.
public DontInstallAnyPlugins ( ) : void
Результат void

DontInstallDataFile() публичный Метод

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.
Результат void

DontInstallDataFolder() публичный Метод

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.
Результат void

DontInstallDataFolder() публичный Метод

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.
Результат void

DontInstallModFile() публичный Метод

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.
Результат void

DontInstallModFolder() публичный Метод

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.
Результат void

DontInstallPlugin() публичный Метод

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.
Результат void

GetDirectoryName() публичный Метод

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.
Результат void

GetFileName() публичный Метод

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.
Результат void

GetFileNameWithoutExtension() публичный Метод

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.
Результат void

GetVar() публичный Метод

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.
Результат string

InputString() публичный Метод

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.
Результат void

InputString() публичный Метод

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.
Результат void

InputString() публичный Метод

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.
Результат void

InstallAllDataFiles() публичный Метод

Installs all non-plugin files that have not been excluded.
public InstallAllDataFiles ( ) : void
Результат void

InstallAllPlugins() публичный Метод

Installs all plugin files that have not been excluded.
public InstallAllPlugins ( ) : void
Результат void

LoadAfter() публичный Метод

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.
Результат void

LoadBefore() публичный Метод

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.
Результат void

LoadEarly() публичный Метод

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.
Результат void

ModScriptInterpreterContext() публичный Метод

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.
Результат System

RemoveString() публичный Метод

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.
Результат void

RemoveString() публичный Метод

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.
Результат void

SetVar() публичный Метод

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.
Результат void

StringLength() публичный Метод

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.
Результат void

Substring() публичный Метод

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.
Результат void

Substring() публичный Метод

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.
Результат void

fSet() публичный Метод

Evaluates the given mathematical expression, and stores the result in the specified variable.
This is an alias for iSet.
public fSet ( ) : void
Результат void

iSet() публичный Метод

Evaluates the given mathematical expression, and stores the result in the specified variable.
public iSet ( ) : void
Результат void