Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions DelvCD/Config/ElementListConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Dalamud.Interface;
using Dalamud.Interface.ImGuiNotification;
using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii;
using DelvCD.Helpers;
using DelvCD.UIElements;
using Dalamud.Bindings.ImGui;
Expand Down Expand Up @@ -103,8 +104,8 @@ private unsafe void DrawUIElementTable(Vector2 size, float padX)
continue;
}

ImGui.PushID($"##UIElements_Table_Row_{i}");
using var rowId = ImRaii.PushId($"##UIElements_Table_Row_{i}");

ImGui.TableNextRow(ImGuiTableRowFlags.None, 28);

if (ImGui.TableSetColumnIndex(0))
Expand Down
3 changes: 2 additions & 1 deletion DelvCD/Config/FontConfig.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Dalamud.Interface;
using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii;
using DelvCD.Helpers;
using Dalamud.Bindings.ImGui;
using Newtonsoft.Json;
Expand Down Expand Up @@ -103,7 +104,7 @@ public void DrawConfig(IConfigurable parent, Vector2 size, float padX, float pad

for (int i = 0; i < Fonts.Keys.Count; i++)
{
ImGui.PushID($"##Font_Table_Row_{i}");
using var rowId = ImRaii.PushId($"##Font_Table_Row_{i}");
ImGui.TableNextRow(ImGuiTableRowFlags.None, 28);

string key = Fonts.Keys.ElementAt(i);
Expand Down
33 changes: 18 additions & 15 deletions DelvCD/Config/LabelListConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Dalamud.Interface;
using Dalamud.Interface.ImGuiNotification;
using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii;
using DelvCD.Helpers;
using DelvCD.UIElements;
using Dalamud.Bindings.ImGui;
Expand Down Expand Up @@ -88,7 +89,7 @@ private void DrawLabelTable(Vector2 size, float padX)
int i = 0;
for (; i < Labels.Count; i++)
{
ImGui.PushID($"##Label_Table_Row_{i}");
using var rowId = ImRaii.PushId($"##Label_Table_Row_{i}");
ImGui.TableNextRow(ImGuiTableRowFlags.None, 28);

Label label = Labels[i];
Expand All @@ -112,23 +113,25 @@ private void DrawLabelTable(Vector2 size, float padX)
}
}

ImGui.PushID($"##Label_Table_Row_{i + 1}");
ImGui.TableNextRow(ImGuiTableRowFlags.None, 28);
if (ImGui.TableSetColumnIndex(0))
using (ImRaii.PushId($"##Label_Table_Row_{i + 1}"))
{
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + 1f * _scale);
ImGui.PushItemWidth(ImGui.GetColumnWidth());
ImGui.InputTextWithHint("##LabelInput", "New Label Name", ref _labelInput, 10000);
ImGui.PopItemWidth();
}
ImGui.TableNextRow(ImGuiTableRowFlags.None, 28);
if (ImGui.TableSetColumnIndex(0))
{
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + 1f * _scale);
ImGui.PushItemWidth(ImGui.GetColumnWidth());
ImGui.InputTextWithHint("##LabelInput", "New Label Name", ref _labelInput, 10000);
ImGui.PopItemWidth();
}

if (ImGui.TableSetColumnIndex(1))
{
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + 1f);
DrawHelpers.DrawButton(string.Empty, FontAwesomeIcon.Plus, () => AddLabel(_labelInput), "Create Label", buttonSize);
if (ImGui.TableSetColumnIndex(1))
{
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + 1f);
DrawHelpers.DrawButton(string.Empty, FontAwesomeIcon.Plus, () => AddLabel(_labelInput), "Create Label", buttonSize);

ImGui.SameLine();
DrawHelpers.DrawButton(string.Empty, FontAwesomeIcon.Download, () => ImportLabel(), "Import Label", buttonSize);
ImGui.SameLine();
DrawHelpers.DrawButton(string.Empty, FontAwesomeIcon.Download, () => ImportLabel(), "Import Label", buttonSize);
}
}

ImGui.EndTable();
Expand Down
20 changes: 10 additions & 10 deletions DelvCD/Config/StatusTrigger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@
_dataSource.Status_Stacks = status.Param;
_dataSource.Max_Status_Stacks = trigger.MaxStacks;

if (_dataSource.Max_Status_Stacks > 0) {
_dataSource.Icon = (uint)(trigger.Icon + _dataSource.Status_Stacks - 1);
if (_dataSource.Max_Status_Stacks > 0) {
_dataSource.Icon = (uint)(trigger.Icon + _dataSource.Status_Stacks - 1);
}
else
else
{
_dataSource.Icon = trigger.Icon;
}
Expand Down Expand Up @@ -155,7 +155,7 @@
ImGui.Combo("Trigger Source", ref Unsafe.As<TriggerSource, int>(ref TriggerSource), _sourceOptions, _sourceOptions.Length);

// Don't display the trigger source type option if the TriggerSource is set to Player, since player will always be friendly.
if( this.TriggerSource is not TriggerSource.Player) {
if( this.TriggerSource is not TriggerSource.Player) {
ImGui.Combo("Trigger Source Type", ref Unsafe.As<TriggerSourceType, int>(ref this.TriggerSourceType), _sourceTypeOptions, _sourceTypeOptions.Length);
}

Expand Down Expand Up @@ -188,12 +188,12 @@
Vector2 iconPos = ImGui.GetWindowPos() + new Vector2(width - 100 * _scale, 20 * _scale);
DrawHelpers.DrawIcon(
TriggerData[0].Icon,
iconPos,
new Vector2(40 * _scale, 54 * _scale),
false,
0,
false,
1f,
iconPos,
new Vector2(40 * _scale, 54 * _scale),
false,
0,
false,
1f,
drawList
);
}
Expand Down Expand Up @@ -291,7 +291,7 @@
if (actor is IPlayerCharacter) { return friendly; }

if (actor is IBattleNpc npc) {
if (npc.BattleNpcKind == BattleNpcSubKind.Pet || npc.BattleNpcKind == BattleNpcSubKind.Buddy) { return friendly; }

Check failure on line 294 in DelvCD/Config/StatusTrigger.cs

View workflow job for this annotation

GitHub Actions / Build against Latest Dalamud

'BattleNpcSubKind' does not contain a definition for 'Buddy'

Check failure on line 294 in DelvCD/Config/StatusTrigger.cs

View workflow job for this annotation

GitHub Actions / Build against Latest Dalamud

'BattleNpcSubKind' does not contain a definition for 'Buddy'

// For enemy trigger checks, the 'friendly' variable will be set to false, so we want to negate that first.
return !friendly == Utils.IsHostile((ICharacter)actor);
Expand Down
13 changes: 8 additions & 5 deletions DelvCD/Config/Styles/StyleConditions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Dalamud.Interface;
using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii;
using DelvCD.Helpers;
using DelvCD.Helpers.DataSources;
using Dalamud.Bindings.ImGui;
Expand Down Expand Up @@ -196,16 +197,18 @@ public void DrawConfig(IConfigurable parent, Vector2 size, float padX, float pad

for (int i = 0; i < Conditions.Count; i++)
{
ImGui.PushID($"##Conditions_Table_Row_{i}");
using var rowId = ImRaii.PushId($"##Conditions_Table_Row_{i}");
ImGui.TableNextRow(ImGuiTableRowFlags.None, 28);

DrawStyleConditionRow(i);
}

ImGui.PushID($"##Conditions_Table_Row_{Conditions.Count}");
ImGui.TableNextRow(ImGuiTableRowFlags.None, 28);
ImGui.TableSetColumnIndex(5);
DrawHelpers.DrawButton(string.Empty, FontAwesomeIcon.Plus, () => Conditions.Add(new StyleCondition<T>(_defaultStyle)), "New Condition", buttonSize);
using (ImRaii.PushId($"##Conditions_Table_Row_{Conditions.Count}"))
{
ImGui.TableNextRow(ImGuiTableRowFlags.None, 28);
ImGui.TableSetColumnIndex(5);
DrawHelpers.DrawButton(string.Empty, FontAwesomeIcon.Plus, () => Conditions.Add(new StyleCondition<T>(_defaultStyle)), "New Condition", buttonSize);
}

ImGui.EndTable();
}
Expand Down
17 changes: 10 additions & 7 deletions DelvCD/Config/TriggerConfig.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Dalamud.Interface;
using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii;
using DelvCD.Helpers;
using Dalamud.Bindings.ImGui;
using Newtonsoft.Json;
Expand Down Expand Up @@ -147,18 +148,20 @@ public void DrawConfig(IConfigurable parent, Vector2 size, float padX, float pad

for (int i = 0; i < TriggerOptions.Count; i++)
{
ImGui.PushID($"##Conditions_Table_Row_{i}");
using var rowId = ImRaii.PushId($"##Conditions_Table_Row_{i}");
ImGui.TableNextRow(ImGuiTableRowFlags.None, 28);

DrawTriggerRow(i);
}

ImGui.PushID($"##Conditions_Table_Row_{TriggerOptions.Count}");
ImGui.TableNextRow(ImGuiTableRowFlags.None, 28);
ImGui.TableSetColumnIndex(3);
DrawHelpers.DrawButton(string.Empty, FontAwesomeIcon.Plus, () => AddTrigger(), "New Trigger", buttonSize);
ImGui.SameLine();
DrawHelpers.DrawButton(string.Empty, FontAwesomeIcon.Download, () => ImportTrigger(), "Import Trigger", buttonSize);
using (ImRaii.PushId($"##Conditions_Table_Row_{TriggerOptions.Count}"))
{
ImGui.TableNextRow(ImGuiTableRowFlags.None, 28);
ImGui.TableSetColumnIndex(3);
DrawHelpers.DrawButton(string.Empty, FontAwesomeIcon.Plus, () => AddTrigger(), "New Trigger", buttonSize);
ImGui.SameLine();
DrawHelpers.DrawButton(string.Empty, FontAwesomeIcon.Download, () => ImportTrigger(), "Import Trigger", buttonSize);
}

ImGui.EndTable();

Expand Down
Loading