Table of Contents

Class FallbackLocaleGenerator

Namespace
MonkeyLoader.Resonite.Locale
Assembly
MonkeyLoader.Resonite.Integration.dll

Subscribes to the LocaleLoadingEvent and generates the FallbackLocaleGenerationEvent when it's loading the final fallback locale to inject programmatically generated keys.

public sealed class FallbackLocaleGenerator : ResoniteAsyncEventHandlerMonkey<FallbackLocaleGenerator, LocaleLoadingEvent>, IResoniteMonkey, IMonkey, IRun, IShutdown, IComparable<IMonkey>, INestedIdentifiable<Mod>, INestedIdentifiable, IIdentifiable, IAsyncEventHandler<LocaleLoadingEvent>, IPrioritizable, IAsyncEventSource<FallbackLocaleGenerationEvent>
Inheritance
FallbackLocaleGenerator
Implements
Inherited Members
Extension Methods

Fields

LocaleCode

The fallback locale code.

public const string LocaleCode = "en"

Field Value

string

Properties

Priority

Gets the priority of this item. Use the Priority values as a base.

public override int Priority { get; }

Property Value

int

An interger used to sort the prioritizable items.
Higher comes first with the default comparer.

Methods

AppliesTo(LocaleLoadingEvent)

Determines whether the given event should be handled by this event handler based on its data.

protected override bool AppliesTo(LocaleLoadingEvent eventData)

Parameters

eventData LocaleLoadingEvent

An object containing all the relevant information for the event.

Returns

bool

true if this event handler applies to the event; otherwise, false.

GetFeaturePatches()

Gets the impacts this (pre-)patcher has on certain features.

protected override IEnumerable<IFeaturePatch> GetFeaturePatches()

Returns

IEnumerable<IFeaturePatch>

Handle(LocaleLoadingEvent)

Handles the given event based on its data, if AppliesTo returned true.

protected override Task Handle(LocaleLoadingEvent eventData)

Parameters

eventData LocaleLoadingEvent

An object containing all the relevant information for the applicable event.

Returns

Task

OnEngineReady()

Override this method to be called when the FrooxEngine.Engine is ready.
This is the primary method for patching used by Resonite Mods as basic facilities of the game are ready to use, while most other code hasn't been run yet.
Return true if patching was successful.

protected override bool OnEngineReady()

Returns

bool

Whether the patching was successful.

Remarks

Override OnLoaded() to patch before anything is initialized, but strongly consider also overriding this method if you do that.
Otherwise your patches will be applied twice, if you're using [HarmonyPatchCategory(nameof(MyPatcher))] attributes.

By default:Registers this Monkey as an event handler and applies the Harmony patches of the category with this patcher's type's name.
Easy to apply by using [HarmonyPatchCategory(nameof(MyPatcher))] attribute.