mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-23 08:17:47 +01:00
feat: add SetWindowPosRelativeMainViewport to ImGuiHelpers
This commit is contained in:
parent
633fe68046
commit
3076e13920
1 changed files with 16 additions and 0 deletions
|
|
@ -37,10 +37,26 @@ namespace Dalamud.Interface
|
||||||
public static void ScaledRelativeSameLine(float offset, float spacing = -1.0f) =>
|
public static void ScaledRelativeSameLine(float offset, float spacing = -1.0f) =>
|
||||||
ImGui.SameLine(ImGui.GetCursorPosX() + (offset * GlobalScale));
|
ImGui.SameLine(ImGui.GetCursorPosX() + (offset * GlobalScale));
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set the position of the next window relative to the main viewport.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="position">The position of the next window.</param>
|
||||||
|
/// <param name="condition">When to set the position.</param>
|
||||||
|
/// <param name="pivot">The pivot to set the position around.</param>
|
||||||
public static void SetNextWindowPosRelativeMainViewport(
|
public static void SetNextWindowPosRelativeMainViewport(
|
||||||
Vector2 position, ImGuiCond condition = ImGuiCond.None, Vector2 pivot = default)
|
Vector2 position, ImGuiCond condition = ImGuiCond.None, Vector2 pivot = default)
|
||||||
=> ImGui.SetNextWindowPos(position + MainViewport.Pos, condition, pivot);
|
=> ImGui.SetNextWindowPos(position + MainViewport.Pos, condition, pivot);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set the position of a window relative to the main viewport.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name">The name/ID of the window.</param>
|
||||||
|
/// <param name="position">The position of the window.</param>
|
||||||
|
/// <param name="condition">When to set the position.</param>
|
||||||
|
public static void SetWindowPosRelativeMainViewport(
|
||||||
|
string name, Vector2 position, ImGuiCond condition = ImGuiCond.None)
|
||||||
|
=> ImGui.SetWindowPos(position + MainViewport.Pos, condition);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get data needed for each new frame.
|
/// Get data needed for each new frame.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue