Class Framework
This class represents the Framework of the native game client and grants access to various subsystems.
Inheritance
Inherited Members
Namespace: Dalamud.Game
Assembly: Dalamud.dll
Syntax
public sealed class Framework : IDisposable, IServiceType
Properties
| Improve this Doc View SourceAddress
Gets a raw pointer to the instance of Client::Framework.
Declaration
public FrameworkAddressResolver Address { get; }
Property Value
| Type | Description |
|---|---|
| FrameworkAddressResolver |
IsFrameworkUnloading
Gets a value indicating whether game Framework is unloading.
Declaration
public bool IsFrameworkUnloading { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsInFrameworkUpdateThread
Gets a value indicating whether currently executing code is running in the game's framework update thread.
Declaration
public bool IsInFrameworkUpdateThread { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
LastUpdate
Gets the last time that the Framework Update event was triggered.
Declaration
public DateTime LastUpdate { get; }
Property Value
| Type | Description |
|---|---|
| System.DateTime |
LastUpdateUTC
Gets the last time in UTC that the Framework Update event was triggered.
Declaration
public DateTime LastUpdateUTC { get; }
Property Value
| Type | Description |
|---|---|
| System.DateTime |
StatsEnabled
Gets or sets a value indicating whether the collection of stats is enabled.
Declaration
public static bool StatsEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
StatsHistory
Gets the stats history mapping.
Declaration
public static Dictionary<string, List<double>> StatsHistory { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.Dictionary<System.String, System.Collections.Generic.List<System.Double>> |
UpdateDelta
Gets the delta between the last Framework Update and the currently executing one.
Declaration
public TimeSpan UpdateDelta { get; }
Property Value
| Type | Description |
|---|---|
| System.TimeSpan |
Methods
| Improve this Doc View SourceRunOnFrameworkThread(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.
Declaration
public Task RunOnFrameworkThread(Action action)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Action | action | Function to call. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | Task representing the pending or already completed function. |
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.
Declaration
public Task RunOnFrameworkThread(Func<Task> func)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<System.Threading.Tasks.Task> | func | Function to call. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | Task representing the pending or already completed function. |
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.
Declaration
public Task<T> RunOnFrameworkThread<T>(Func<T> func)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<T> | func | Function to call. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<T> | Task representing the pending or already completed function. |
Type Parameters
| Name | Description |
|---|---|
| T | Return type. |
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.
Declaration
public Task<T> RunOnFrameworkThread<T>(Func<Task<T>> func)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<System.Threading.Tasks.Task<T>> | func | Function to call. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<T> | Task representing the pending or already completed function. |
Type Parameters
| Name | Description |
|---|---|
| T | Return type. |
RunOnTick(Action, TimeSpan, Int32, CancellationToken)
Run given function in upcoming Framework.Tick call.
Declaration
public Task RunOnTick(Action action, TimeSpan delay = default(TimeSpan), int delayTicks = 0, CancellationToken cancellationToken = default(CancellationToken))
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. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | Task representing the pending function. |
RunOnTick(Func<Task>, TimeSpan, Int32, CancellationToken)
Run given function in upcoming Framework.Tick call.
Declaration
public Task RunOnTick(Func<Task> func, TimeSpan delay = default(TimeSpan), int delayTicks = 0, CancellationToken cancellationToken = default(CancellationToken))
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. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | Task representing the pending function. |
RunOnTick<T>(Func<T>, TimeSpan, Int32, CancellationToken)
Run given function in upcoming Framework.Tick call.
Declaration
public Task<T> RunOnTick<T>(Func<T> func, TimeSpan delay = default(TimeSpan), int delayTicks = 0, CancellationToken cancellationToken = default(CancellationToken))
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. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<T> | Task representing the pending function. |
Type Parameters
| Name | Description |
|---|---|
| T | Return type. |
RunOnTick<T>(Func<Task<T>>, TimeSpan, Int32, CancellationToken)
Run given function in upcoming Framework.Tick call.
Declaration
public Task<T> RunOnTick<T>(Func<Task<T>> func, TimeSpan delay = default(TimeSpan), int delayTicks = 0, CancellationToken cancellationToken = default(CancellationToken))
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. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<T> | Task representing the pending function. |
Type Parameters
| Name | Description |
|---|---|
| T | Return type. |
Events
| Improve this Doc View SourceUpdate
Event that gets fired every time the game framework updates.
Declaration
public event Framework.OnUpdateDelegate Update
Event Type
| Type | Description |
|---|---|
| Framework.OnUpdateDelegate |
Explicit Interface Implementations
| Improve this Doc View SourceIDisposable.Dispose()
Dispose of managed and unmanaged resources.
Declaration
void IDisposable.Dispose()