Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: Only draw collapsible header if rotation has settings at all.
Browse files Browse the repository at this point in the history
  • Loading branch information
RiotNOR committed May 16, 2023
1 parent 02ab8f0 commit 54b902c
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions RotationSolver/UI/RotationConfigWindow_Rotation.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using Dalamud.Interface.Colors;
using Dalamud.Utility;

using ImGuiNET;

using RotationSolver.Data;
using RotationSolver.Helpers;
using RotationSolver.Localization;
Expand Down Expand Up @@ -68,18 +70,30 @@ private static void DrawRotations(CustomRotationGroup[] rotations)

internal static void DrawRotationRole(ICustomRotation rotation, bool canAddButton)
{
DrawTargetHostileTYpe(rotation);
if (ImGui.CollapsingHeader($"{rotation.JobIDs[0]} rotation settings##Settings"))
DrawTargetHostileType(rotation);

if (rotation.Configs.Configs.Count != 0)
{
if (ImGui.CollapsingHeader($"{rotation.JobIDs[0]} rotation settings##Settings"))
{
ImGui.Indent();

DrawSpecialRoleSettings(rotation.Job.GetJobRole(), rotation.JobIDs[0]);
rotation.Configs.Draw(canAddButton);

ImGui.Unindent();

ImGui.Spacing();
}
}
else
{
ImGui.Indent();
DrawSpecialRoleSettings(rotation.Job.GetJobRole(), rotation.JobIDs[0]);
rotation.Configs.Draw(canAddButton);
ImGui.Unindent();
ImGui.Spacing();
}
}

private static void DrawTargetHostileTYpe(ICustomRotation rotation)
private static void DrawTargetHostileType(ICustomRotation rotation)
{
var isAllTargetAsHostile = (int)DataCenter.GetTargetHostileType(rotation.Job);
ImGui.SetNextItemWidth(300);
Expand Down

0 comments on commit 54b902c

Please sign in to comment.