// TODO: FNewPluginMountedEvent / OnNewPluginCreated / OnNewPluginMounted public void MountNewlyCreatedPlugin(string pluginName) { using (FStringUnsafe pluginNameUnsafe = new FStringUnsafe(pluginName)) { Native_IPluginManager.MountNewlyCreatedPlugin(Address, ref pluginNameUnsafe.Array); } }
/// <summary> /// Stores the specified path, utilizing it in future search passes when /// searching for available plugins. Optionally refreshes the manager after /// the new path has been added. /// </summary> /// <param name="extraDiscoveryPath">The path you want searched for additional plugins.</param> /// <param name="refresh">Signals the function to refresh the plugin database after the new path has been added</param> public void AddPluginSearchPath(string extraDiscoveryPath, bool refresh = true) { using (FStringUnsafe extraDiscoveryPathUnsafe = new FStringUnsafe(extraDiscoveryPath)) { Native_IPluginManager.AddPluginSearchPath(Address, ref extraDiscoveryPathUnsafe.Array, refresh); } }
/// <summary> /// Get the localization paths for all enabled plugins. /// </summary> /// <returns>The localization paths for all enabled plugins.</returns> public string[] GetLocalizationPathsForEnabledPlugins() { using (TArrayUnsafe <string> resultUnsafe = new TArrayUnsafe <string>()) { Native_IPluginManager.GetLocalizationPathsForEnabledPlugins(Address, resultUnsafe.Address); return(resultUnsafe.ToArray()); } }
/// <summary> /// Gets an array of plugins that loaded their own content pak file /// </summary> public IPlugin[] GetPluginsWithPakFile() { using (TArrayUnsafe <FSharedPtr> resultUnsafe = new TArrayUnsafe <FSharedPtr>()) { Native_IPluginManager.GetPluginsWithPakFile(Address, resultUnsafe.Address); return(GetPluginArray(resultUnsafe)); } }
/// <summary> /// Access singleton instance. /// </summary> /// <returns>Reference to the singleton object.</returns> public static IPluginManager Get() { if (instance == null) { instance = new IPluginManager(); instance.Address = Native_IPluginManager.Get(); } return(instance); }
/// <summary> /// Finds information for an enabled plugin. /// </summary> /// <param name="name">The plugin's information, or nullptr.</param> /// <returns></returns> public IPlugin FindPlugin(string name) { using (FStringUnsafe nameUnsafe = new FStringUnsafe(name)) { FSharedPtr sharedPtr; Native_IPluginManager.FindPlugin(Address, ref nameUnsafe.Array, out sharedPtr); if (sharedPtr.IsValid()) { return(new IPlugin(sharedPtr)); } return(null); } }
/// <summary> /// Checks whether modules for the enabled plug-ins are up to date. /// </summary> /// <param name="incompatibleModules">Incompatible module names.</param> /// <returns>true if the enabled plug-in modules are up to date.</returns> public bool CheckModuleCompatibility(out string[] incompatibleModules) { // !IS_MONOLITHIC if (Native_IPluginManager.CheckModuleCompatibility == null) { incompatibleModules = null; return(true); } using (TArrayUnsafe <string> incompatibleModulesUnsafe = new TArrayUnsafe <string>()) { bool result = Native_IPluginManager.CheckModuleCompatibility(Address, incompatibleModulesUnsafe.Address); incompatibleModules = incompatibleModulesUnsafe.ToArray(); return(result); } }
/// <summary> /// Checks if all the required plug-ins are available. If not, will present an error dialog the first time a plug-in is loaded or this function is called. /// </summary> /// <returns>true if all the required plug-ins are available.</returns> public bool AreRequiredPluginsAvailable() { return(Native_IPluginManager.AreRequiredPluginsAvailable(Address)); }
/// <summary> /// Loads all plug-ins /// </summary> /// <param name="loadingPhase">Which loading phase we're loading plug-in modules from. Only modules that are configured to be /// loaded at the specified loading phase will be loaded during this call.</param> public bool LoadModulesForEnabledPlugins(ELoadingPhase loadingPhase) { return(Native_IPluginManager.LoadModulesForEnabledPlugins(Address, (int)loadingPhase)); }
/// <summary> /// Updates the list of plugins. /// </summary> public void RefreshPluginsList() { Native_IPluginManager.RefreshPluginsList(Address); }