diff --git a/Dalamud/Interface/ImGuiHelpers.cs b/Dalamud/Interface/ImGuiHelpers.cs index 90d8d6cfb..54e9fab30 100644 --- a/Dalamud/Interface/ImGuiHelpers.cs +++ b/Dalamud/Interface/ImGuiHelpers.cs @@ -37,10 +37,26 @@ namespace Dalamud.Interface public static void ScaledRelativeSameLine(float offset, float spacing = -1.0f) => ImGui.SameLine(ImGui.GetCursorPosX() + (offset * GlobalScale)); + /// + /// Set the position of the next window relative to the main viewport. + /// + /// The position of the next window. + /// When to set the position. + /// The pivot to set the position around. public static void SetNextWindowPosRelativeMainViewport( Vector2 position, ImGuiCond condition = ImGuiCond.None, Vector2 pivot = default) => ImGui.SetNextWindowPos(position + MainViewport.Pos, condition, pivot); + /// + /// Set the position of a window relative to the main viewport. + /// + /// The name/ID of the window. + /// The position of the window. + /// When to set the position. + public static void SetWindowPosRelativeMainViewport( + string name, Vector2 position, ImGuiCond condition = ImGuiCond.None) + => ImGui.SetWindowPos(position + MainViewport.Pos, condition); + /// /// Get data needed for each new frame. ///