Class UiBuilder
This class represents the Dalamud UI that is drawn on top of the game. It can be used to draw custom windows and overlays.
Assembly: Dalamud.dll
View Source
public sealed class UiBuilder : IDisposable, IUiBuilder
Implements:
System.IDisposable
, Dalamud.Interface.IUiBuilder
Properties
DefaultFontSizePt
Gets the default Dalamud font size in points.
View Source
public static float DefaultFontSizePt { get; }
DefaultFontSizePx
Gets the default Dalamud font size in pixels.
View Source
public static float DefaultFontSizePx { get; }
DefaultFont
Gets the default Dalamud font - supporting all game languages and icons.
<strong>Accessing this static property outside of Dalamud.Interface.UiBuilder.Draw is dangerous and not supported.</strong>
View Source
public static ImFontPtr DefaultFont { get; }
IconFont
Gets the default Dalamud icon font based on FontAwesome 5 Free solid.
<strong>Accessing this static property outside of Dalamud.Interface.UiBuilder.Draw is dangerous and not supported.</strong>
View Source
public static ImFontPtr IconFont { get; }
MonoFont
Gets the default Dalamud monospaced font based on Inconsolata Regular.
<strong>Accessing this static property outside of Dalamud.Interface.UiBuilder.Draw is dangerous and not supported.</strong>
View Source
public static ImFontPtr MonoFont { get; }
DefaultFontSpec
Gets the default font specifications.
View Source
public IFontSpec DefaultFontSpec { get; }
DefaultFontHandle
Gets the handle to the default Dalamud font - supporting all game languages and icons.
View Source
public IFontHandle DefaultFontHandle { get; }
IconFontHandle
Gets the default Dalamud icon font based on FontAwesome 5 Free solid.
View Source
public IFontHandle IconFontHandle { get; }
IconFontFixedWidthHandle
Gets the default Dalamud icon font based on FontAwesome 5 free solid with a fixed width and vertically centered glyphs.
View Source
public IFontHandle IconFontFixedWidthHandle { get; }
MonoFontHandle
Gets the default Dalamud monospaced font based on Inconsolata Regular.
View Source
public IFontHandle MonoFontHandle { get; }
Device
Gets the game's active Direct3D device.
View Source
public Device Device { get; }
WindowHandlePtr
Gets the game's main window handle.
View Source
public nint WindowHandlePtr { get; }
DisableAutomaticUiHide
Gets or sets a value indicating whether this plugin should hide its UI automatically when the game's UI is hidden.
View Source
public bool DisableAutomaticUiHide { get; set; }
DisableUserUiHide
Gets or sets a value indicating whether this plugin should hide its UI automatically when the user toggles the UI.
View Source
public bool DisableUserUiHide { get; set; }
DisableCutsceneUiHide
Gets or sets a value indicating whether this plugin should hide its UI automatically during cutscenes.
View Source
public bool DisableCutsceneUiHide { get; set; }
DisableGposeUiHide
Gets or sets a value indicating whether this plugin should hide its UI automatically while gpose is active.
View Source
public bool DisableGposeUiHide { get; set; }
OverrideGameCursor
Gets or sets a value indicating whether or not the game's cursor should be overridden with the ImGui cursor.
View Source
public bool OverrideGameCursor { get; set; }
FrameCount
Gets the count of Draw calls made since plugin creation.
View Source
public ulong FrameCount { get; }
CutsceneActive
Gets a value indicating whether or not a cutscene is playing.
View Source
public bool CutsceneActive { get; }
ShouldModifyUi
Gets a value indicating whether this plugin should modify the game's interface at this time.
View Source
public bool ShouldModifyUi { get; }
UiPrepared
Gets a value indicating whether UI functions can be used.
View Source
public bool UiPrepared { get; }
FontAtlas
Gets the plugin-private font atlas.
View Source
public IFontAtlas FontAtlas { get; }
ShouldUseReducedMotion
Gets a value indicating whether or not to use "reduced motion". This usually means that you should use less intrusive animations, or disable them entirely.
View Source
public bool ShouldUseReducedMotion { get; }
Methods
LoadUld(string)
Loads an ULD file that can load textures containing multiple icons in a single texture.
View Source
public UldWrapper LoadUld(string uldPath)
Returns
Dalamud.Interface.UldWrapper: A wrapper around said ULD file.
Parameters
Type | Name | Description |
---|---|---|
System.String | uldPath | The path of the requested ULD file. |
WaitForUi()
Waits for UI to become available for use.
View Source
public Task WaitForUi()
Returns
System.Threading.Tasks.Task
: A task that completes when the game's Present has been called at least once.### RunWhenUiPrepared<T>(Func<T>, bool)
Waits for UI to become available for use.
View Source
public Task<T> RunWhenUiPrepared<T>(Func<T> func, bool runInFrameworkThread = false)
Returns
System.Threading.Tasks.Task<<T>>
: A task that completes when the game's Present has been called at least once.
Parameters
Type | Name | Description |
---|---|---|
System.Func<<T>> | func | Function to call. |
System.Boolean | runInFrameworkThread | Specifies whether to call the function from the framework thread. |
Type Parameters
Name | Description |
---|---|
T | Return type. |
RunWhenUiPrepared<T>(Func<Task<T>>, bool)
Waits for UI to become available for use.
View Source
public Task<T> RunWhenUiPrepared<T>(Func<Task<T>> func, bool runInFrameworkThread = false)
Returns
System.Threading.Tasks.Task<<T>>
: A task that completes when the game's Present has been called at least once.
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.Threading.Tasks.Task<<T>>> | func | Function to call. |
System.Boolean | runInFrameworkThread | Specifies whether to call the function from the framework thread. |
Type Parameters
Name | Description |
---|---|
T | Return type. |
CreateFontAtlas(FontAtlasAutoRebuildMode, bool, string?)
Creates an isolated Dalamud.Interface.ManagedFontAtlas.IFontAtlas.
View Source
public IFontAtlas CreateFontAtlas(FontAtlasAutoRebuildMode autoRebuildMode, bool isGlobalScaled = true, string? debugName = null)
Returns
Dalamud.Interface.ManagedFontAtlas.IFontAtlas: A new instance of Dalamud.Interface.ManagedFontAtlas.IFontAtlas.
Parameters
Type | Name | Description |
---|---|---|
Dalamud.Interface.ManagedFontAtlas.FontAtlasAutoRebuildMode | autoRebuildMode | Specify when and how to rebuild this atlas. |
System.Boolean | isGlobalScaled | Whether the fonts in the atlas is global scaled. |
System.String | debugName | Name for debugging purposes. |
Events
Draw
The event that gets called when Dalamud is ready to draw your windows or overlays. When it is called, you can use static ImGui calls.
View Source
public event Action? Draw
Event Type
System.Action
ResizeBuffers
The event that is called when the game's DirectX device is requesting you to resize your buffers.
View Source
public event Action? ResizeBuffers
Event Type
System.Action
OpenConfigUi
Event that is fired when the plugin should open its configuration interface.
View Source
public event Action? OpenConfigUi
Event Type
System.Action
OpenMainUi
Event that is fired when the plugin should open its main interface.
View Source
public event Action? OpenMainUi
Event Type
System.Action
ShowUi
Gets or sets an action that is called when plugin UI or interface modifications are supposed to be shown. These may be fired consecutively.
View Source
public event Action? ShowUi
Event Type
System.Action
HideUi
Gets or sets an action that is called when plugin UI or interface modifications are supposed to be hidden. These may be fired consecutively.
View Source
public event Action? HideUi
Event Type
System.Action
Implements
System.IDisposable
- Dalamud.Interface.IUiBuilder