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
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
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
trueif the count was incremented successfully, otherwisefalse.
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
countint
Returns
- bool
trueif the count was incremented successfully, otherwisefalse.
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
phasestringThe name of the phase to advance to.
Returns
- bool
trueif the phase was advanced successfully, otherwisefalse.
ExitSubphase()
Unsets the subphase, if the progress indicator is available.
public static bool ExitSubphase()
Returns
- bool
trueif the subphase was changed successfully, otherwisefalse.
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
millisecondsintHow long to wait under the right conditions, in milliseconds.
actionActionThe action to run.
cancellationTokenCancellationTokenThe cancellation token that will be checked prior to completing the returned task.
Returns
- Task
A task that represents the completion of the
actionand optionalmilliseconds-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
millisecondsintHow long to wait under the right conditions, in milliseconds.
taskFuncFunc<Task>cancellationTokenCancellationTokenThe cancellation token that will be checked prior to completing the returned task.
Returns
- Task
A task that represents the completion of the
taskFuncand optionalmilliseconds-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
millisecondsintHow long to wait under the right conditions, in milliseconds.
taskTaskThe to wait for the completion of.
cancellationTokenCancellationTokenThe cancellation token that will be checked prior to completing the returned task.
Returns
- Task
A task that represents the completion of the
taskand optionalmilliseconds-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
millisecondsintHow long to wait under the right conditions, in milliseconds.
taskFuncFunc<Task<T>>cancellationTokenCancellationTokenThe cancellation token that will be checked prior to completing the returned task.
Returns
- Task<T>
A task that represents the completion of the
taskFuncand optionalmilliseconds-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
millisecondsintHow long to wait under the right conditions, in milliseconds.
funcFunc<T>The function to run.
cancellationTokenCancellationTokenThe cancellation token that will be checked prior to completing the returned task.
Returns
- Task<T>
A task that represents the completion of the
funcand optionalmilliseconds-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
millisecondsintHow long to wait under the right conditions, in milliseconds.
taskTask<T>The to wait for the completion of.
cancellationTokenCancellationTokenThe cancellation token that will be checked prior to completing the returned task.
Returns
- Task<T>
A task that represents the completion of the
taskand optionalmilliseconds-long wait.
Type Parameters
T
SetSubphase(string)
Sets the subphase, if the progress indicator is available.
public static bool SetSubphase(string subphase)
Parameters
subphasestringThe name of the subphase.
Returns
- bool
trueif the subphase was changed successfully, otherwisefalse.