Table of Contents

Class LoadProgressReporter

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

Contains methods to update Resonite's loading progress indicator with custom phases.

public static class LoadProgressReporter
Inheritance
LoadProgressReporter
Inherited Members

Properties

Available

Gets whether the progress indicator is available, determining the availability of the methods and properties of this class.

public static bool Available { get; }

Property Value

bool

FixedPhaseIndex

Gets the index of the current fixed phase, if the progress indicator is available.

public static int? FixedPhaseIndex { get; }

Property Value

int?

LoadProgressIndicator

Gets or sets the concrete ILoadProgressIndicator implementation used to report the load progress of mods and their monkeys.

public static ILoadProgressIndicator? LoadProgressIndicator { get; set; }

Property Value

ILoadProgressIndicator

TotalFixedPhaseCount

Gets the number of fixed phases, if the progress indicator is available.

public static int? TotalFixedPhaseCount { get; }

Property Value

int?

Methods

AddFixedPhase()

Increments the TotalFixedPhaseCount to make space for an additional phase, if the progress indicator is available..

public static bool AddFixedPhase()

Returns

bool

true if the count was incremented successfully, otherwise false.

Remarks

Should be used as early as possible, to make sure the progress bar doesn't go backwards.

AddFixedPhases(int)

Increments the TotalFixedPhaseCount by count to make space for additional phases, if the progress indicator is available.

public static bool AddFixedPhases(int count)

Parameters

count int

Returns

bool

true if the count was incremented successfully, otherwise false.

Remarks

Should be used as early as possible, to make sure the progress bar doesn't go backwards.

AdvanceFixedPhase(string)

Increments the FixedPhaseIndex and sets the fixed phase to advance the progress bar, if the progress indicator is available.

public static bool AdvanceFixedPhase(string phase)

Parameters

phase string

The name of the phase to advance to.

Returns

bool

true if the phase was advanced successfully, otherwise false.

ExitSubphase()

Unsets the subphase, if the progress indicator is available.

public static bool ExitSubphase()

Returns

bool

true if the subphase was changed successfully, otherwise false.

RunForPrettySplashAsync(int, Action, CancellationToken)

Runs the given action and waits for at least the specified time before completing, if the progress indicator is available and pretty splash progress is enabled.

public static Task RunForPrettySplashAsync(int milliseconds, Action action, CancellationToken cancellationToken = default)

Parameters

milliseconds int

How long to wait under the right conditions, in milliseconds.

action Action

The action to run.

cancellationToken CancellationToken

The cancellation token that will be checked prior to completing the returned task.

Returns

Task

A task that represents the completion of the action and optional milliseconds-long wait.

RunForPrettySplashAsync(int, Func<Task>, CancellationToken)

Runs the given taskFunc and waits for at least the specified time before completing, if the progress indicator is available and pretty splash progress is enabled.

public static Task RunForPrettySplashAsync(int milliseconds, Func<Task> taskFunc, CancellationToken cancellationToken = default)

Parameters

milliseconds int

How long to wait under the right conditions, in milliseconds.

taskFunc Func<Task>

The Task-function to run.

cancellationToken CancellationToken

The cancellation token that will be checked prior to completing the returned task.

Returns

Task

A task that represents the completion of the taskFunc and optional milliseconds-long wait.

RunForPrettySplashAsync(int, Task, CancellationToken)

Waits for the given task to complete, but at least for the specified time before itself completing, if the progress indicator is available and pretty splash progress is enabled.

public static Task RunForPrettySplashAsync(int milliseconds, Task task, CancellationToken cancellationToken = default)

Parameters

milliseconds int

How long to wait under the right conditions, in milliseconds.

task Task

The to wait for the completion of.

cancellationToken CancellationToken

The cancellation token that will be checked prior to completing the returned task.

Returns

Task

A task that represents the completion of the task and optional milliseconds-long wait.

RunForPrettySplashAsync<T>(int, Func<Task<T>>, CancellationToken)

Runs the given taskFunc and waits for at least the specified time before completing, if the progress indicator is available and pretty splash progress is enabled.

public static Task<T> RunForPrettySplashAsync<T>(int milliseconds, Func<Task<T>> taskFunc, CancellationToken cancellationToken = default)

Parameters

milliseconds int

How long to wait under the right conditions, in milliseconds.

taskFunc Func<Task<T>>

The Task-function to run.

cancellationToken CancellationToken

The cancellation token that will be checked prior to completing the returned task.

Returns

Task<T>

A task that represents the completion of the taskFunc and optional milliseconds-long wait.

Type Parameters

T

RunForPrettySplashAsync<T>(int, Func<T>, CancellationToken)

Runs the given func and waits for at least the specified time before completing, if the progress indicator is available and pretty splash progress is enabled.

public static Task<T> RunForPrettySplashAsync<T>(int milliseconds, Func<T> func, CancellationToken cancellationToken = default)

Parameters

milliseconds int

How long to wait under the right conditions, in milliseconds.

func Func<T>

The function to run.

cancellationToken CancellationToken

The cancellation token that will be checked prior to completing the returned task.

Returns

Task<T>

A task that represents the completion of the func and optional milliseconds-long wait.

Type Parameters

T

RunForPrettySplashAsync<T>(int, Task<T>, CancellationToken)

Waits for the given task to complete, but at least for the specified time before itself completing, if the progress indicator is available and pretty splash progress is enabled.

public static Task<T> RunForPrettySplashAsync<T>(int milliseconds, Task<T> task, CancellationToken cancellationToken = default)

Parameters

milliseconds int

How long to wait under the right conditions, in milliseconds.

task Task<T>

The to wait for the completion of.

cancellationToken CancellationToken

The cancellation token that will be checked prior to completing the returned task.

Returns

Task<T>

A task that represents the completion of the task and optional milliseconds-long wait.

Type Parameters

T

SetSubphase(string)

Sets the subphase, if the progress indicator is available.

public static bool SetSubphase(string subphase)

Parameters

subphase string

The name of the subphase.

Returns

bool

true if the subphase was changed successfully, otherwise false.