diff --git a/ARControl/ARControl.csproj b/ARControl/ARControl.csproj
index e3dfdbe..1e8538a 100644
--- a/ARControl/ARControl.csproj
+++ b/ARControl/ARControl.csproj
@@ -24,7 +24,7 @@
-
+
@@ -65,7 +65,6 @@
-
diff --git a/ARControl/AutoRetainerControlPlugin.cs b/ARControl/AutoRetainerControlPlugin.cs
index 8efe99a..9b6efc9 100644
--- a/ARControl/AutoRetainerControlPlugin.cs
+++ b/ARControl/AutoRetainerControlPlugin.cs
@@ -6,6 +6,9 @@ using ARControl.GameData;
using ARControl.Windows;
using AutoRetainerAPI;
using Dalamud.Game.Command;
+using Dalamud.Game.Text;
+using Dalamud.Game.Text.SeStringHandling;
+using Dalamud.Game.Text.SeStringHandling.Payloads;
using Dalamud.Interface;
using Dalamud.Interface.Windowing;
using Dalamud.Plugin;
@@ -51,7 +54,8 @@ public sealed partial class AutoRetainerControlPlugin : IDalamudPlugin
_iconCache = new IconCache(textureProvider);
_ventureResolver = new VentureResolver(_gameCache, _pluginLog);
_configWindow =
- new ConfigWindow(_pluginInterface, _configuration, _gameCache, _clientState, _commandManager, _iconCache, _pluginLog)
+ new ConfigWindow(_pluginInterface, _configuration, _gameCache, _clientState, _commandManager, _iconCache,
+ _pluginLog)
{ IsOpen = true };
_windowSystem.AddWindow(_configWindow);
@@ -161,7 +165,9 @@ public sealed partial class AutoRetainerControlPlugin : IDalamudPlugin
{
QueuedItem = x,
InventoryCount = inventoryManager->GetInventoryItemCount(x.ItemId) +
- (venturesInProgress.TryGetValue(x.ItemId, out int inProgress) ? inProgress : 0),
+ (venturesInProgress.TryGetValue(x.ItemId, out int inProgress)
+ ? inProgress
+ : 0),
})
.Where(x => x.InventoryCount <= x.RequestedCount)
.ToList()
@@ -188,7 +194,25 @@ public sealed partial class AutoRetainerControlPlugin : IDalamudPlugin
else
{
_chatGui.Print(
- $"[ARC] Sending retainer {retainerName} to collect {reward.Quantity}x {venture.Name}.");
+ new SeString(new UIForegroundPayload(579))
+ .Append(SeIconChar.Collectible.ToIconString())
+ .Append(new UIForegroundPayload(0))
+ .Append($" Sending retainer ")
+ .Append(new UIForegroundPayload(1))
+ .Append(retainerName)
+ .Append(new UIForegroundPayload(0))
+ .Append(" to collect ")
+ .Append(new UIForegroundPayload(1))
+ .Append($"{reward.Quantity}x ")
+ .Append(new ItemPayload(venture.ItemId))
+ .Append(venture.Name)
+ .Append(RawPayload.LinkTerminator)
+ .Append(new UIForegroundPayload(0))
+ .Append(" for ")
+ .Append(new UIForegroundPayload(1))
+ .Append($"{list.Name} {list.GetIcon()}")
+ .Append(new UIForegroundPayload(0))
+ .Append("."));
_pluginLog.Information(
$"Setting AR to use venture {venture.RowId}, which should retrieve {reward.Quantity}x {venture.Name}");
@@ -209,13 +233,24 @@ public sealed partial class AutoRetainerControlPlugin : IDalamudPlugin
return venture.RowId;
}
}
-
}
// fallback: managed but no venture found
if (retainer.LastVenture != QuickVentureId)
{
- _chatGui.Print($"[ARC] No tasks left for retainer {retainerName}, sending to Quick Venture.");
+ _chatGui.Print(
+ new SeString(new UIForegroundPayload(579))
+ .Append(SeIconChar.Collectible.ToIconString())
+ .Append(new UIForegroundPayload(0))
+ .Append($" No tasks left for retainer ")
+ .Append(new UIForegroundPayload(1))
+ .Append(retainerName)
+ .Append(new UIForegroundPayload(0))
+ .Append(", sending to ")
+ .Append(new UIForegroundPayload(1))
+ .Append("Quick Venture")
+ .Append(new UIForegroundPayload(0))
+ .Append("."));
_pluginLog.Information($"No tasks left (previous venture = {retainer.LastVenture}), using QC");
if (!dryRun)
@@ -318,7 +353,8 @@ public sealed partial class AutoRetainerControlPlugin : IDalamudPlugin
if (venture == QuickVentureId)
_chatGui.Print($"Next venture for {retainerName} is Quick Venture.");
else if (venture.HasValue)
- _chatGui.Print($"Next venture for {retainerName} is {_gameCache.Ventures.First(x => x.RowId == venture.Value).Name}.");
+ _chatGui.Print(
+ $"Next venture for {retainerName} is {_gameCache.Ventures.First(x => x.RowId == venture.Value).Name}.");
else
_chatGui.Print($"Next venture for {retainerName} is (none).");
}
@@ -345,6 +381,7 @@ public sealed partial class AutoRetainerControlPlugin : IDalamudPlugin
public required Configuration.QueuedItem QueuedItem { get; set; }
public required int InventoryCount { get; set; }
public uint ItemId => QueuedItem.ItemId;
+
public int RequestedCount
{
get => QueuedItem.RemainingQuantity;
diff --git a/ARControl/Windows/ConfigWindow.cs b/ARControl/Windows/ConfigWindow.cs
index 97f3672..ea04b5c 100644
--- a/ARControl/Windows/ConfigWindow.cs
+++ b/ARControl/Windows/ConfigWindow.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using ARControl.GameData;
+using Dalamud.Game.Text;
using Dalamud.Interface;
using Dalamud.Interface.Colors;
using Dalamud.Interface.Components;
@@ -26,7 +27,9 @@ internal sealed class ConfigWindow : Window
private static readonly Vector4 ColorRed = ImGuiColors.DalamudRed;
private static readonly Vector4 ColorGrey = ImGuiColors.DalamudGrey;
private static readonly string[] StockingTypeLabels = { "Collect Once", "Keep in Stock" };
- private static readonly string[] PriorityLabels = { "Collect in order of the list", "Collect item with lowest inventory first" };
+
+ private static readonly string[] PriorityLabels =
+ { "Collect in order of the list", "Collect item with lowest inventory first" };
private readonly DalamudPluginInterface _pluginInterface;
private readonly Configuration _configuration;
@@ -39,12 +42,14 @@ internal sealed class ConfigWindow : Window
private readonly Dictionary _currentEditPopups = new();
private string _searchString = string.Empty;
private TemporaryConfig _newGroup = new() { Name = string.Empty };
+
private TemporaryConfig _newList = new()
{
Name = string.Empty,
ListType = Configuration.ListType.CollectOneTime,
ListPriority = Configuration.ListPriority.InOrder
};
+
private bool _checkPerCharacter = true;
private bool _onlyShowMissing = true;
@@ -56,7 +61,7 @@ internal sealed class ConfigWindow : Window
ICommandManager commandManager,
IconCache iconCache,
IPluginLog pluginLog)
- : base("ARC###ARControlConfig")
+ : base($"ARC {SeIconChar.Collectible.ToIconString()}###ARControlConfig")
{
_pluginInterface = pluginInterface;
_configuration = configuration;
@@ -106,6 +111,7 @@ internal sealed class ConfigWindow : Window
};
ImGui.OpenPopup($"##EditList{list.Id}");
}
+
DrawVentureListEditorPopup(list, ref listToDelete);
ImGui.SameLine();
@@ -118,6 +124,7 @@ internal sealed class ConfigWindow : Window
DrawVentureListItemSelection(list);
ImGui.Unindent(30);
}
+
ImGui.PopID();
}
@@ -233,7 +240,8 @@ internal sealed class ConfigWindow : Window
}
}
- private (bool Save, bool CanSave) DrawVentureListEditor(TemporaryConfig temporaryConfig, Configuration.ItemList? list)
+ private (bool Save, bool CanSave) DrawVentureListEditor(TemporaryConfig temporaryConfig,
+ Configuration.ItemList? list)
{
string listName = temporaryConfig.Name;
bool save = ImGui.InputTextWithHint("", "List Name...", ref listName, 64,
@@ -339,6 +347,7 @@ internal sealed class ConfigWindow : Window
itemToAdd = item;
indexToAdd = i - 1;
}
+
ImGui.EndDisabled();
ImGui.SameLine(0, 0);
@@ -348,6 +357,7 @@ internal sealed class ConfigWindow : Window
itemToAdd = item;
indexToAdd = i + 1;
}
+
ImGui.EndDisabled();
ImGui.SameLine();
@@ -380,8 +390,10 @@ internal sealed class ConfigWindow : Window
list.Items.RemoveAll(q => q.RemainingQuantity <= 0);
Save();
}
+
ImGui.EndDisabled();
}
+
ImGui.Spacing();
}
@@ -443,7 +455,8 @@ internal sealed class ConfigWindow : Window
if (ImGui.BeginTabBar("CharOptions"))
{
- if (character.Type != Configuration.CharacterType.NotManaged && ImGui.BeginTabItem("Venture Lists"))
+ if (character.Type != Configuration.CharacterType.NotManaged &&
+ ImGui.BeginTabItem("Venture Lists"))
{
int groupIndex = 0;
if (character.Type == Configuration.CharacterType.PartOfCharacterGroup)
@@ -461,6 +474,7 @@ internal sealed class ConfigWindow : Window
character.Type = Configuration.CharacterType.PartOfCharacterGroup;
character.CharacterGroupId = groups[groupIndex].Id;
}
+
Save();
}
@@ -470,14 +484,16 @@ internal sealed class ConfigWindow : Window
// ReSharper disable once ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
if (character.ItemListIds == null)
character.ItemListIds = new();
- DrawVentureListSelection(character.LocalContentId.ToString(), character.ItemListIds);
+ DrawVentureListSelection(character.LocalContentId.ToString(),
+ character.ItemListIds);
}
else
{
ImGui.TextWrapped($"Retainers will participate in the following lists:");
ImGui.Indent(30);
- var group = _configuration.CharacterGroups.Single(x => x.Id == groups[groupIndex].Id);
+ var group = _configuration.CharacterGroups.Single(
+ x => x.Id == groups[groupIndex].Id);
var lists = group.ItemListIds
.Where(listId => listId != Guid.Empty)
.Select(listId => _configuration.ItemLists.SingleOrDefault(x => x.Id == listId))
@@ -495,11 +511,14 @@ internal sealed class ConfigWindow : Window
ImGui.Unindent(30);
ImGui.Spacing();
}
+
ImGui.EndTabItem();
}
+
if (ImGui.BeginTabItem("Retainers"))
{
- foreach (var retainer in character.Retainers.Where(x => x.Job > 0).OrderBy(x => x.DisplayOrder))
+ foreach (var retainer in character.Retainers.Where(x => x.Job > 0)
+ .OrderBy(x => x.DisplayOrder))
{
ImGui.BeginDisabled(retainer.Level < MinLevel);
@@ -512,7 +531,8 @@ internal sealed class ConfigWindow : Window
ImGui.SameLine();
}
- if (ImGui.Checkbox($"{retainer.Name}###Retainer{retainer.Name}{retainer.DisplayOrder}",
+ if (ImGui.Checkbox(
+ $"{retainer.Name}###Retainer{retainer.Name}{retainer.DisplayOrder}",
ref managed))
{
retainer.Managed = managed;
@@ -521,8 +541,10 @@ internal sealed class ConfigWindow : Window
ImGui.EndDisabled();
}
+
ImGui.EndTabItem();
}
+
ImGui.EndTabBar();
}
@@ -575,7 +597,9 @@ internal sealed class ConfigWindow : Window
}
}
- private void DrawCharacterGroupEditorPopup(Configuration.CharacterGroup group, out List assignedCharacters, ref Configuration.CharacterGroup? groupToDelete)
+ private void DrawCharacterGroupEditorPopup(Configuration.CharacterGroup group,
+ out List assignedCharacters,
+ ref Configuration.CharacterGroup? groupToDelete)
{
assignedCharacters = _configuration.Characters
.Where(x => x.Type == Configuration.CharacterType.PartOfCharacterGroup &&
@@ -583,7 +607,8 @@ internal sealed class ConfigWindow : Window
.OrderBy(x => x.WorldName)
.ThenBy(x => x.LocalContentId)
.ToList();
- if (_currentEditPopups.TryGetValue(group.Id, out TemporaryConfig? temporaryConfig) && ImGui.BeginPopup($"##EditGroup{group.Id}"))
+ if (_currentEditPopups.TryGetValue(group.Id, out TemporaryConfig? temporaryConfig) &&
+ ImGui.BeginPopup($"##EditGroup{group.Id}"))
{
(bool save, bool canSave) = DrawGroupEditor(temporaryConfig, group);
@@ -607,6 +632,7 @@ internal sealed class ConfigWindow : Window
groupToDelete = group;
ImGui.CloseCurrentPopup();
}
+
ImGui.EndDisabled();
if (assignedCharacters.Count > 0 && ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
@@ -618,11 +644,13 @@ internal sealed class ConfigWindow : Window
ImGui.EndTooltip();
}
}
+
ImGui.EndPopup();
}
}
- private void DrawCharacterGroup(Configuration.CharacterGroup group, List assignedCharacters)
+ private void DrawCharacterGroup(Configuration.CharacterGroup group,
+ List assignedCharacters)
{
string countLabel = assignedCharacters.Count == 0 ? "no characters"
: assignedCharacters.Count == 1 ? "1 character"
@@ -687,7 +715,8 @@ internal sealed class ConfigWindow : Window
}
}
- private (bool Save, bool CanSave) DrawGroupEditor(TemporaryConfig group, Configuration.CharacterGroup? existingGroup)
+ private (bool Save, bool CanSave) DrawGroupEditor(TemporaryConfig group,
+ Configuration.CharacterGroup? existingGroup)
{
string name = group.Name;
bool save = ImGui.InputTextWithHint("", "Group Name...", ref name, 64, ImGuiInputTextFlags.EnterReturnsTrue);
@@ -870,6 +899,7 @@ internal sealed class ConfigWindow : Window
itemToAdd = i;
indexToAdd = i - 1;
}
+
ImGui.EndDisabled();
ImGui.SameLine(0, 0);
@@ -879,6 +909,7 @@ internal sealed class ConfigWindow : Window
itemToAdd = i;
indexToAdd = i + 1;
}
+
ImGui.EndDisabled();
ImGui.SameLine();
@@ -946,6 +977,7 @@ internal sealed class ConfigWindow : Window
ImGui.EndPopup();
}
+
ImGui.EndDisabled();
ImGui.PopID();