Skip to main content

Interface IFramework

This class represents the Framework of the native game client and grants access to various subsystems.

Assembly: Dalamud.dll
View Source
Declaration
public interface IFramework

Properties

LastUpdate

Gets the last time that the Framework Update event was triggered.

View Source
Declaration
DateTime LastUpdate { get; }

LastUpdateUTC

Gets the last time in UTC that the Framework Update event was triggered.

View Source
Declaration
DateTime LastUpdateUTC { get; }

UpdateDelta

Gets the delta between the last Framework Update and the currently executing one.

View Source
Declaration
TimeSpan UpdateDelta { get; }

IsInFrameworkUpdateThread

Gets a value indicating whether currently executing code is running in the game's framework update thread.

View Source
Declaration
bool IsInFrameworkUpdateThread { get; }

IsFrameworkUnloading

Gets a value indicating whether game Framework is unloading.

View Source
Declaration
bool IsFrameworkUnloading { get; }

Methods

GetTaskFactory()

Gets a System.Threading.Tasks.TaskFactory that runs tasks during Framework Update event.

View Source
Declaration
TaskFactory GetTaskFactory()
Returns

System.Threading.Tasks.TaskFactory: The task factory.### DelayTicks(long, CancellationToken) Returns a task that completes after the given number of ticks.

View Source
Declaration
Task DelayTicks(long numTicks, CancellationToken cancellationToken = default)
Returns

System.Threading.Tasks.Task: A new System.Threading.Tasks.Task that gets resolved after specified number of ticks happen.

Parameters
TypeNameDescription
System.Int64numTicksNumber of ticks to delay.
System.Threading.CancellationTokencancellationTokenThe cancellation token.

Run(Action, CancellationToken)

Run given function right away if this function has been called from game's Framework.Update thread, or otherwise run on next Framework.Update call.

View Source
Declaration
Task Run(Action action, CancellationToken cancellationToken = default)
Returns

System.Threading.Tasks.Task: Task representing the pending or already completed function.

Parameters
TypeNameDescription
System.ActionactionFunction to call.
System.Threading.CancellationTokencancellationTokenThe cancellation token.

Run<T>(Func<T>, CancellationToken)

Run given function right away if this function has been called from game's Framework.Update thread, or otherwise run on next Framework.Update call.

View Source
Declaration
Task<T> Run<T>(Func<T> action, CancellationToken cancellationToken = default)
Returns

System.Threading.Tasks.Task<<T>>: Task representing the pending or already completed function.

Parameters
TypeNameDescription
System.Func<<T>>actionFunction to call.
System.Threading.CancellationTokencancellationTokenThe cancellation token.
Type Parameters
NameDescription
TReturn type.

Run(Func<Task>, CancellationToken)

Run given function right away if this function has been called from game's Framework.Update thread, or otherwise run on next Framework.Update call.

View Source
Declaration
Task Run(Func<Task> action, CancellationToken cancellationToken = default)
Returns

System.Threading.Tasks.Task: Task representing the pending or already completed function.

Parameters
TypeNameDescription
System.Func<System.Threading.Tasks.Task>actionFunction to call.
System.Threading.CancellationTokencancellationTokenThe cancellation token.

Run<T>(Func<Task<T>>, CancellationToken)

Run given function right away if this function has been called from game's Framework.Update thread, or otherwise run on next Framework.Update call.

View Source
Declaration
Task<T> Run<T>(Func<Task<T>> action, CancellationToken cancellationToken = default)
Returns

System.Threading.Tasks.Task<<T>>: Task representing the pending or already completed function.

Parameters
TypeNameDescription
System.Func<System.Threading.Tasks.Task<<T>>>actionFunction to call.
System.Threading.CancellationTokencancellationTokenThe cancellation token.
Type Parameters
NameDescription
TReturn type.

RunOnFrameworkThread<T>(Func<T>)

Run given function right away if this function has been called from game's Framework.Update thread, or otherwise run on next Framework.Update call.

View Source
Declaration
Task<T> RunOnFrameworkThread<T>(Func<T> func)
Returns

System.Threading.Tasks.Task<<T>>: Task representing the pending or already completed function.

Parameters
TypeNameDescription
System.Func<<T>>funcFunction to call.
Type Parameters
NameDescription
TReturn type.

RunOnFrameworkThread(Action)

Run given function right away if this function has been called from game's Framework.Update thread, or otherwise run on next Framework.Update call.

View Source
Declaration
Task RunOnFrameworkThread(Action action)
Returns

System.Threading.Tasks.Task: Task representing the pending or already completed function.

Parameters
TypeNameDescription
System.ActionactionFunction to call.

RunOnFrameworkThread<T>(Func<Task<T>>)

Run given function right away if this function has been called from game's Framework.Update thread, or otherwise run on next Framework.Update call.

View Source
Declaration
[Obsolete("Use RunOnTick instead.")]
Task<T> RunOnFrameworkThread<T>(Func<Task<T>> func)
Returns

System.Threading.Tasks.Task<<T>>: Task representing the pending or already completed function.

Parameters
TypeNameDescription
System.Func<System.Threading.Tasks.Task<<T>>>funcFunction to call.
Type Parameters
NameDescription
TReturn type.

RunOnFrameworkThread(Func<Task>)

Run given function right away if this function has been called from game's Framework.Update thread, or otherwise run on next Framework.Update call.

View Source
Declaration
[Obsolete("Use RunOnTick instead.")]
Task RunOnFrameworkThread(Func<Task> func)
Returns

System.Threading.Tasks.Task: Task representing the pending or already completed function.

Parameters
TypeNameDescription
System.Func<System.Threading.Tasks.Task>funcFunction to call.

RunOnTick<T>(Func<T>, TimeSpan, int, CancellationToken)

Run given function in upcoming Framework.Tick call.

View Source
Declaration
Task<T> RunOnTick<T>(Func<T> func, TimeSpan delay = default, int delayTicks = 0, CancellationToken cancellationToken = default)
Returns

System.Threading.Tasks.Task<<T>>: Task representing the pending function.

Parameters
TypeNameDescription
System.Func<<T>>funcFunction to call.
System.TimeSpandelayWait for given timespan before calling this function.
System.Int32delayTicksCount given number of Framework.Tick calls before calling this function. This takes precedence over delay parameter.
System.Threading.CancellationTokencancellationTokenCancellation token which will prevent the execution of this function if wait conditions are not met.
Type Parameters
NameDescription
TReturn type.

RunOnTick(Action, TimeSpan, int, CancellationToken)

Run given function in upcoming Framework.Tick call.

View Source
Declaration
Task RunOnTick(Action action, TimeSpan delay = default, int delayTicks = 0, CancellationToken cancellationToken = default)
Returns

System.Threading.Tasks.Task: Task representing the pending function.

Parameters
TypeNameDescription
System.ActionactionFunction to call.
System.TimeSpandelayWait for given timespan before calling this function.
System.Int32delayTicksCount given number of Framework.Tick calls before calling this function. This takes precedence over delay parameter.
System.Threading.CancellationTokencancellationTokenCancellation token which will prevent the execution of this function if wait conditions are not met.

RunOnTick<T>(Func<Task<T>>, TimeSpan, int, CancellationToken)

Run given function in upcoming Framework.Tick call.

View Source
Declaration
Task<T> RunOnTick<T>(Func<Task<T>> func, TimeSpan delay = default, int delayTicks = 0, CancellationToken cancellationToken = default)
Returns

System.Threading.Tasks.Task<<T>>: Task representing the pending function.

Parameters
TypeNameDescription
System.Func<System.Threading.Tasks.Task<<T>>>funcFunction to call.
System.TimeSpandelayWait for given timespan before calling this function.
System.Int32delayTicksCount given number of Framework.Tick calls before calling this function. This takes precedence over delay parameter.
System.Threading.CancellationTokencancellationTokenCancellation token which will prevent the execution of this function if wait conditions are not met.
Type Parameters
NameDescription
TReturn type.

RunOnTick(Func<Task>, TimeSpan, int, CancellationToken)

Run given function in upcoming Framework.Tick call.

View Source
Declaration
Task RunOnTick(Func<Task> func, TimeSpan delay = default, int delayTicks = 0, CancellationToken cancellationToken = default)
Returns

System.Threading.Tasks.Task: Task representing the pending function.

Parameters
TypeNameDescription
System.Func<System.Threading.Tasks.Task>funcFunction to call.
System.TimeSpandelayWait for given timespan before calling this function.
System.Int32delayTicksCount given number of Framework.Tick calls before calling this function. This takes precedence over delay parameter.
System.Threading.CancellationTokencancellationTokenCancellation token which will prevent the execution of this function if wait conditions are not met.

Events

Update

Event that gets fired every time the game framework updates.

View Source
Declaration
event IFramework.OnUpdateDelegate Update
Event Type

Dalamud.Plugin.Services.IFramework.OnUpdateDelegate