IEmulatorSettingsCapability14.1
Interface in Unbroken.LaunchBox.Plugins.Components.Emulators
public interface IEmulatorSettingsCapabilityDescribes the settings LaunchBox displays for one configured emulator, stores against that emulator, and hands back at launch.
Remarks
LaunchBox owns presentation, pending edits, platform inheritance, and the master enable switch. The integration owns persistence through its plugin-scoped services and the meaning of each setting. Implement IEmulatorLaunchPreparationCapability as well to consume loaded values through EmulatorLaunchPreparationRequest.EmulatorSettings.Methods
CopySettingsAsyncCopies plugin-owned settings as part of the host's emulator copy operation.DeleteSettingsAsyncRemoves plugin-owned settings when an emulator entry is deleted.GetSettingsPageGets the settings page for one configured emulator.LoadSettingsAsyncLoads a detached settings snapshot for a specific emulator entry.SaveSettingsAsyncPersists the settings accepted by the user in the shared editor.
CopySettingsAsync
Task CopySettingsAsync(
IEmulator source,
IEmulator destination,
CancellationToken cancellationToken
)Copies plugin-owned settings as part of the host's emulator copy operation.
source- The original emulator entry.
destination- The copied entry. Its ID may be unchanged for an in-memory clone.
cancellationToken- Cancels the operation.
Returns
A task completing after any required settings copy succeeds.Remarks
Preserve all platform overrides. A same-ID clone references the same persisted settings and must not overwrite them.DeleteSettingsAsync
Task DeleteSettingsAsync(
IEmulator emulator,
CancellationToken cancellationToken
)Removes plugin-owned settings when an emulator entry is deleted.
emulator- The entry being deleted.
cancellationToken- Cancels the operation.
Returns
A task completing after removal succeeds.GetSettingsPage
PluginConfigurationForm? GetSettingsPage(IEmulator emulator)Gets the settings page for one configured emulator.
emulator- The emulator whose settings are being opened.
Returns
The page to display, ornull when the integration exposes no settings for this emulator.
Remarks
LaunchBox calls this while the user browses the emulator edit window and never on the game launch path, so it may inspect the installed emulator to decide which settings that build supports. Return a scoped form with load, validation, and submission callbacks bound to this emulator. Choices can be built from current state, such as the monitors attached right now. A setting the emulator cannot support is best omitted from the page, and any value already stored for an omitted setting must be treated as omitted at launch.LoadSettingsAsync
Task<PluginConfigurationValues> LoadSettingsAsync(
IEmulator emulator,
CancellationToken cancellationToken
)Loads a detached settings snapshot for a specific emulator entry.
emulator- The entry whose stable ID identifies its settings.
cancellationToken- Cancels the operation.
Returns
The saved settings, or empty explicit values for a new entry.SaveSettingsAsync
Task SaveSettingsAsync(
IEmulator emulator,
PluginConfigurationValues settings,
CancellationToken cancellationToken
)Persists the settings accepted by the user in the shared editor.
emulator- The entry receiving the settings.
settings- The complete snapshot, including base values and platform overrides.
cancellationToken- Cancels the operation.