๐ Plugin Helper
Short Description
Singleton helper that manages Gorgeous plugin/module registration, dependency validation and persistent state used by the runtime utilities.
Long Description
UGorgeousPluginHelper is a lightweight, globally accessible UObject used by Gorgeous modules to register themselves, validate dependency chains and record persistent plugin state across runs. It helps plugins determine whether required core features are available, detects circular dependencies, and surfaces load-state notifications.
๐ Features
- Register/unregister module interfaces and query registered modules.
- Defer module registration until dependencies are available.
- Validate plugin dependency chains and report failure reasons.
- Persist simple metadata (installed systems, validation counters) across sessions.
- Determine plugin load state (
FullyLoaded,PartiallyLoaded,NotLoaded,Unknown).
GetCoreModuleInterface
Returns the core IGorgeousThingsModuleInterface for a given functionality type, or nullptr when not registered. Use to obtain access to core services without a compile-time dependency.
| Parameter Name | Type | Description |
|---|---|---|
FunctionalityType |
EGorgeousModuleFunctionality |
The requested core functionality. |
if (auto* Core = UGorgeousPluginHelper::Get()->GetCoreModuleInterface(MyFunctionality)) {
// use Core
}
RegisterModule / UnregisterModule / IsModuleRegistered
Modules call RegisterModule during startup to announce themselves. The helper tracks expected/loaded modules per plugin so it can compute plugin load state. UnregisterModule removes registration (used on shutdown) and IsModuleRegistered checks presence.
UGorgeousPluginHelper::Get()->RegisterModule(MyModuleInterface);
ValidateDependencyChain
Validates that every dependency of the provided plugin is installed/enabled. When validation fails the function collects failed plugin names and textual reasons for reporting.
| Parameter Name | Type | Description |
|---|---|---|
PluginName |
FName |
Plugin to validate. |
OutFailedDependencies |
TArray<FName>& |
Receives failed dependency names. |
OutFailureReasons |
TMap<FName, FString>& |
Receives failure reasons per dependency. |
TArray<FName> Failed;
TMap<FName, FString> Reasons;
if (!UGorgeousPluginHelper::Get()->ValidateDependencyChain(MyPlugin, Failed, Reasons)) {
// report
}
Persistent counters and recorded systems
The helper persists a small amount of metadata (validation counters, previously installed systems) so that multi-startup validation and notifications behave sensibly across sessions.
int32 Count = UGorgeousPluginHelper::Get()->GetSystemValidationCount();
UGorgeousPluginHelper::Get()->IncrementSystemValidationCount();
Notes
- Circular dependency detection and deferred registration logic is intentionally conservative to avoid false positives; if your plugin defers registration you must ensure the helper can discover declared dependencies.
Where to find the header
src/content/gorgeous-core/RuntimeUtilities/Helpers/Headers/GorgeousPluginHelper.h