Interface IFramework
This class represents the Framework of the native game client and grants access to various subsystems.
Assembly: Dalamud.dll
View Source
public interface IFramework
Properties
LastUpdate
Gets the last time that the Framework Update event was triggered.
View Source
DateTime LastUpdate { get; }
LastUpdateUTC
Gets the last time in UTC that the Framework Update event was triggered.
View Source
DateTime LastUpdateUTC { get; }
UpdateDelta
Gets the delta between the last Framework Update and the currently executing one.
View Source
TimeSpan UpdateDelta { get; }
IsInFrameworkUpdateThread
Gets a value indicating whether currently executing code is running in the game's framework update thread.
View Source
bool IsInFrameworkUpdateThread { get; }
IsFrameworkUnloading
Gets a value indicating whether game Framework is unloading.
View Source
bool IsFrameworkUnloading { get; }
Methods
GetTaskFactory()
Gets a System.Threading.Tasks.TaskFactory
that runs tasks during Framework Update event.
View Source
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
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
Type | Name | Description |
---|---|---|
System.Int64 | numTicks | Number of ticks to delay. |
System.Threading.CancellationToken | cancellationToken | The 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
Task Run(Action action, CancellationToken cancellationToken = default)
Returns
System.Threading.Tasks.Task
: Task representing the pending or already completed function.
Parameters
Type | Name | Description |
---|---|---|
System.Action | action | Function to call. |
System.Threading.CancellationToken | cancellationToken | The 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
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
Type | Name | Description |
---|---|---|
System.Func<<T>> | action | Function to call. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Type Parameters
Name | Description |
---|---|
T | Return 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
Task Run(Func<Task> action, CancellationToken cancellationToken = default)
Returns
System.Threading.Tasks.Task
: Task representing the pending or already completed function.
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.Threading.Tasks.Task> | action | Function to call. |
System.Threading.CancellationToken | cancellationToken | The 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
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
Type | Name | Description |
---|---|---|
System.Func<System.Threading.Tasks.Task<<T>>> | action | Function to call. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Type Parameters
Name | Description |
---|---|
T | Return 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
Task<T> RunOnFrameworkThread<T>(Func<T> func)
Returns
System.Threading.Tasks.Task<<T>>
: Task representing the pending or already completed function.
Parameters
Type | Name | Description |
---|---|---|
System.Func<<T>> | func | Function to call. |
Type Parameters
Name | Description |
---|---|
T | Return 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
Task RunOnFrameworkThread(Action action)
Returns
System.Threading.Tasks.Task
: Task representing the pending or already completed function.
Parameters
Type | Name | Description |
---|---|---|
System.Action | action | Function 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
[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
Type | Name | Description |
---|---|---|
System.Func<System.Threading.Tasks.Task<<T>>> | func | Function to call. |
Type Parameters
Name | Description |
---|---|
T | Return 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
[Obsolete("Use RunOnTick instead.")]
Task RunOnFrameworkThread(Func<Task> func)
Returns
System.Threading.Tasks.Task
: Task representing the pending or already completed function.
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.Threading.Tasks.Task> | func | Function to call. |
RunOnTick<T>(Func<T>, TimeSpan, int, CancellationToken)
Run given function in upcoming Framework.Tick call.
View Source
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
Type | Name | Description |
---|---|---|
System.Func<<T>> | func | Function to call. |
System.TimeSpan | delay | Wait for given timespan before calling this function. |
System.Int32 | delayTicks | Count given number of Framework.Tick calls before calling this function. This takes precedence over delay parameter. |
System.Threading.CancellationToken | cancellationToken | Cancellation token which will prevent the execution of this function if wait conditions are not met. |
Type Parameters
Name | Description |
---|---|
T | Return type. |
RunOnTick(Action, TimeSpan, int, CancellationToken)
Run given function in upcoming Framework.Tick call.
View Source
Task RunOnTick(Action action, TimeSpan delay = default, int delayTicks = 0, CancellationToken cancellationToken = default)
Returns
System.Threading.Tasks.Task
: Task representing the pending function.
Parameters
Type | Name | Description |
---|---|---|
System.Action | action | Function to call. |
System.TimeSpan | delay | Wait for given timespan before calling this function. |
System.Int32 | delayTicks | Count given number of Framework.Tick calls before calling this function. This takes precedence over delay parameter. |
System.Threading.CancellationToken | cancellationToken | Cancellation 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
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
Type | Name | Description |
---|---|---|
System.Func<System.Threading.Tasks.Task<<T>>> | func | Function to call. |
System.TimeSpan | delay | Wait for given timespan before calling this function. |
System.Int32 | delayTicks | Count given number of Framework.Tick calls before calling this function. This takes precedence over delay parameter. |
System.Threading.CancellationToken | cancellationToken | Cancellation token which will prevent the execution of this function if wait conditions are not met. |
Type Parameters
Name | Description |
---|---|
T | Return type. |
RunOnTick(Func<Task>, TimeSpan, int, CancellationToken)
Run given function in upcoming Framework.Tick call.
View Source
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
Type | Name | Description |
---|---|---|
System.Func<System.Threading.Tasks.Task> | func | Function to call. |
System.TimeSpan | delay | Wait for given timespan before calling this function. |
System.Int32 | delayTicks | Count given number of Framework.Tick calls before calling this function. This takes precedence over delay parameter. |
System.Threading.CancellationToken | cancellationToken | Cancellation 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
event IFramework.OnUpdateDelegate Update