C# Class Nexus.Client.Games.Morrowind.PluginManagement.Boss.BossSorter

The interface for BOSS functionality.
This use BAPI to expose BOSS's pluing sorting and activation abilities.
Inheritance: ILoadOrderManager, IDisposable
Afficher le fichier Open project: NexusMods/NexusModManager-4.5 Class Usage Examples

Méthodes publiques

Méthode Description
BossSorter ( IEnvironmentInfo p_eifEnvironmentInfo, MorrowindGameMode p_gmdGameMode, FileUtil p_futFileUtility, string p_strMasterlistPath ) : System

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

Dispose ( ) : void

Disposes of any resources that the sorter allocated.

GetActivePlugins ( ) : string[]

Gets the list of active plugins.

GetIndexedPlugin ( Int32 p_intIndex ) : string

Gets the plugin at the specified load index.

GetLoadOrder ( ) : string[]

Gets the list of plugin, sorted by load order.

GetPluginLoadOrder ( string p_strPlugin ) : Int32

Gets the load index of the specified plugin.

IsMaster ( string p_strPlugin ) : bool

Gets whether the plugin is a master file.

IsPluginActive ( string p_strPlugin ) : bool

Determines if the specified plugin is active.

Load ( string p_strMasterlistPath, string p_strUserlistPath ) : void

Loads the specified masterlist.

Loads the masterlist and userlist from the paths specified. Can be called multiple times. On error, the database is unchanged.

MasterlistHasUpdate ( ) : bool

Updates the masterlist at the given path.

SetActivePlugins ( string p_strActivePlugins ) : void

Sets the list of active plugins.

SetLoadOrder ( string p_strPlugins ) : void

Sets the load order of the plugins.

The returned list of sorted plugins will include plugins that were not included in the specified order list, if plugins exist that weren't included. The extra plugins will be apeended to the end of the given order.

SetPluginActive ( string p_strPlugin, bool p_booActive ) : void

Sets the active status of the specified plugin.

SetPluginLoadOrder ( string p_strPlugin, Int32 p_intIndex ) : void

Sets the load order of the specified plugin.

Sets the load order of the specified plugin, removing it from its current position if it has one. The first position in the load order is 0. If the index specified is greater than the number of plugins in the load order, the plugin will be inserted at the end of the load order.

SortMods ( bool p_booTrialOnly ) : string[]

Sorts the user's mods

UpdateMasterlist ( ) : void

Updates the masterlist at the given path.

Méthodes protégées

Méthode Description
AddPluginDirectory ( string p_strPlugin ) : string

Makes the given plugin path absolute.

Dispose ( bool p_booDisposing ) : void

Disposes of the unamanged resources need for BAPI.

MarshalPluginArray ( IntPtr p_ptrPluginArray, UInt32 p_uintLength ) : string[]

Marshal the given pointer to an array of plugins.

This adjusts the plugin paths to be in the format expected by the mod manager.

StripPluginDirectory ( string p_strPlugin ) : string

Removes the plugin directory from the given plugin path.

BAPI expects plugin paths to be relative to the plugins directory. This adjusts the plugin path for that purpose.

StripPluginDirectory ( string p_strPlugins ) : string[]

Removes the plugin directory from the given plugin paths.

BAPI expects plugin paths to be relative to the plugins directory. This adjusts the plugin paths for that purpose.

Private Methods

Méthode Description
CreateBossDb ( ) : IntPtr

Creates the BOSS DB.

Explicitly manage database lifetime. Allows clients to free memory when they want/need to. This function also checks that plugins.txt and loadorder.txt (if they both exist) are in sync.

DestroyBossDb ( ) : void

Destroys the BOSS DB.

EvalConditionals ( ) : void

Evaluates the loaded masterlist.

Evaluates all conditional lines and regex mods the loaded masterlist. This exists so that Load() doesn't need to be called whenever the mods installed are changed. Evaluation does not take place unless this function is called. Repeated calls re-evaluate the masterlist from scratch each time, ignoring the results of any previous evaluations. Paths are case-sensitive if the underlying filesystem is case-sensitive.

FreeLibrary ( IntPtr hModule ) : bool
GetLastErrorDetails ( ) : string

Gets the details of the last error.

GetProcAddress ( IntPtr hModule, [ procName ) : IntPtr
HandleStatusCode ( UInt32 p_uintStatusCode ) : void

Handles the status code returned by the BAPI methods.

LoadLibrary ( [ fileName ) : IntPtr
LoadMethods ( ) : void

Loads the native BAPI methods.

RemoveNonExistentPlugins ( string p_strPlugins ) : string[]

Removes non-existent and ghosted plugins from the given list.

Method Details

AddPluginDirectory() protected méthode

Makes the given plugin path absolute.
protected AddPluginDirectory ( string p_strPlugin ) : string
p_strPlugin string The plugin path to adjust.
Résultat string

BossSorter() public méthode

A simple constructor that initializes the object with the given dependencies.
public BossSorter ( IEnvironmentInfo p_eifEnvironmentInfo, MorrowindGameMode p_gmdGameMode, FileUtil p_futFileUtility, string p_strMasterlistPath ) : System
p_eifEnvironmentInfo IEnvironmentInfo The application's envrionment info.
p_gmdGameMode MorrowindGameMode The game mode for which plugins are being managed.
p_futFileUtility Nexus.Client.Util.FileUtil The file utility class.
p_strMasterlistPath string The path to the masterlist file to use.
Résultat System

Dispose() public méthode

Disposes of any resources that the sorter allocated.
public Dispose ( ) : void
Résultat void

Dispose() protected méthode

Disposes of the unamanged resources need for BAPI.
protected Dispose ( bool p_booDisposing ) : void
p_booDisposing bool Whether the method is being called from the method.
Résultat void

GetActivePlugins() public méthode

Gets the list of active plugins.
public GetActivePlugins ( ) : string[]
Résultat string[]

GetIndexedPlugin() public méthode

Gets the plugin at the specified load index.
public GetIndexedPlugin ( Int32 p_intIndex ) : string
p_intIndex System.Int32 The load index of the plugin to retrieve.
Résultat string

GetLoadOrder() public méthode

Gets the list of plugin, sorted by load order.
public GetLoadOrder ( ) : string[]
Résultat string[]

GetPluginLoadOrder() public méthode

Gets the load index of the specified plugin.
public GetPluginLoadOrder ( string p_strPlugin ) : Int32
p_strPlugin string The plugin whose load order is to be retrieved.
Résultat System.Int32

IsMaster() public méthode

Gets whether the plugin is a master file.
public IsMaster ( string p_strPlugin ) : bool
p_strPlugin string The plugin for which it is to be determined if the file is a plugin.
Résultat bool

IsPluginActive() public méthode

Determines if the specified plugin is active.
public IsPluginActive ( string p_strPlugin ) : bool
p_strPlugin string The plugins whose active state is to be determined.
Résultat bool

Load() public méthode

Loads the specified masterlist.
Loads the masterlist and userlist from the paths specified. Can be called multiple times. On error, the database is unchanged.
public Load ( string p_strMasterlistPath, string p_strUserlistPath ) : void
p_strMasterlistPath string The path to the masterlist to load.
p_strUserlistPath string The path to the userlist to load.
Résultat void

MarshalPluginArray() protected méthode

Marshal the given pointer to an array of plugins.
This adjusts the plugin paths to be in the format expected by the mod manager.
protected MarshalPluginArray ( IntPtr p_ptrPluginArray, UInt32 p_uintLength ) : string[]
p_ptrPluginArray System.IntPtr The pointer to the array of plugin names to marshal.
p_uintLength System.UInt32 the length of the array to marshal.
Résultat string[]

MasterlistHasUpdate() public méthode

Updates the masterlist at the given path.
public MasterlistHasUpdate ( ) : bool
Résultat bool

SetActivePlugins() public méthode

Sets the list of active plugins.
public SetActivePlugins ( string p_strActivePlugins ) : void
p_strActivePlugins string The list of plugins to set as active.
Résultat void

SetLoadOrder() public méthode

Sets the load order of the plugins.
The returned list of sorted plugins will include plugins that were not included in the specified order list, if plugins exist that weren't included. The extra plugins will be apeended to the end of the given order.
public SetLoadOrder ( string p_strPlugins ) : void
p_strPlugins string The list of plugins in the desired order.
Résultat void

SetPluginActive() public méthode

Sets the active status of the specified plugin.
public SetPluginActive ( string p_strPlugin, bool p_booActive ) : void
p_strPlugin string The plugin whose active status is to be set.
p_booActive bool Whether the specified plugin should be made active or inactive.
Résultat void

SetPluginLoadOrder() public méthode

Sets the load order of the specified plugin.
Sets the load order of the specified plugin, removing it from its current position if it has one. The first position in the load order is 0. If the index specified is greater than the number of plugins in the load order, the plugin will be inserted at the end of the load order.
public SetPluginLoadOrder ( string p_strPlugin, Int32 p_intIndex ) : void
p_strPlugin string The plugin whose load order is to be set.
p_intIndex System.Int32 The load index at which to place the specified plugin.
Résultat void

SortMods() public méthode

Sorts the user's mods
public SortMods ( bool p_booTrialOnly ) : string[]
p_booTrialOnly bool Whether the sort should actually be performed, or just previewed.
Résultat string[]

StripPluginDirectory() protected méthode

Removes the plugin directory from the given plugin path.
BAPI expects plugin paths to be relative to the plugins directory. This adjusts the plugin path for that purpose.
protected StripPluginDirectory ( string p_strPlugin ) : string
p_strPlugin string The plugin path to adjust.
Résultat string

StripPluginDirectory() protected méthode

Removes the plugin directory from the given plugin paths.
BAPI expects plugin paths to be relative to the plugins directory. This adjusts the plugin paths for that purpose.
protected StripPluginDirectory ( string p_strPlugins ) : string[]
p_strPlugins string The array of plugin paths to adjust.
Résultat string[]

UpdateMasterlist() public méthode

Updates the masterlist at the given path.
public UpdateMasterlist ( ) : void
Résultat void