/// <summary> /// Determines if the specified plugin is active. /// </summary> /// <param name="p_strPath">The path to the plugin whose active status is to be determined.</param> /// <returns><c>true</c> if the specified plugin is active; /// <c>false</c> otherwise.</returns> public bool IsPluginActive(string p_strPath) { string strPath = p_strPath; if (!Path.IsPathRooted(p_strPath)) { strPath = Path.Combine(GameMode.PluginDirectory, GameMode.GetModFormatAdjustedPath(null, p_strPath, true)); } return(ActivePlugins.Contains(ManagedPluginRegistry.GetPlugin(strPath))); }
/// <summary> /// Determines if the specified plugin is active. /// </summary> /// <param name="p_strPath">The path to the plugin whose active status is to be determined.</param> /// <returns><c>true</c> if the specified plugin is active; /// <c>false</c> otherwise.</returns> public bool IsPluginActive(string p_strPath) { string strPath = p_strPath; if (!Path.IsPathRooted(p_strPath)) { strPath = Path.Combine(GameMode.GameModeEnvironmentInfo.InstallationPath, p_strPath); } return(ActivePlugins.Contains(ManagedPluginRegistry.GetPlugin(strPath))); }
/// <summary> /// Writes the current load order and the id of the specified game mode to the specified /// <see cref="TextWriter"/> and returns the number of plugins written. /// </summary> /// <param name="p_twWriter">The TextWriter to export the current load order to.</param> /// <returns>The number of plugins exported.</returns> private int ExportLoadOrder(TextWriter p_twWriter) { if (p_twWriter == null) { throw new ArgumentNullException("p_twWriter"); } p_twWriter.WriteLine("GameMode={0}", CurrentGameMode.ModeId); p_twWriter.WriteLine(); int intNumPluginsExported = 0; foreach (Plugin p in ManagedPlugins) { p_twWriter.WriteLine(Path.GetFileName(p.Filename) + "=" + (ActivePlugins.Contains(p) ? "1" : "0")); intNumPluginsExported++; } return(intNumPluginsExported); }