diff --git a/ARControl/ARControl.csproj b/ARControl/ARControl.csproj index 17b5692..6033344 100644 --- a/ARControl/ARControl.csproj +++ b/ARControl/ARControl.csproj @@ -1,7 +1,7 @@ net7.0-windows - 2.1 + 2.2 11.0 enable true diff --git a/ARControl/AutoRetainerControlPlugin.cs b/ARControl/AutoRetainerControlPlugin.cs index 02e7a21..da075c8 100644 --- a/ARControl/AutoRetainerControlPlugin.cs +++ b/ARControl/AutoRetainerControlPlugin.cs @@ -55,8 +55,7 @@ public sealed partial class AutoRetainerControlPlugin : IDalamudPlugin _ventureResolver = new VentureResolver(_gameCache, _pluginLog); _configWindow = new ConfigWindow(_pluginInterface, _configuration, _gameCache, _clientState, _commandManager, _iconCache, - _pluginLog) - { IsOpen = true }; + _pluginLog); _windowSystem.AddWindow(_configWindow); ECommonsMain.Init(_pluginInterface, this); @@ -118,7 +117,7 @@ public sealed partial class AutoRetainerControlPlugin : IDalamudPlugin var venturesInProgress = CalculateVenturesInProgress(ch); foreach (var inpr in venturesInProgress) { - _pluginLog.Information($"In Progress: {inpr.Key} → {inpr.Value}"); + _pluginLog.Verbose($"Venture In Progress: ItemId {inpr.Key} for a total amount of {inpr.Value}"); } IReadOnlyList itemListIds; @@ -178,18 +177,23 @@ public sealed partial class AutoRetainerControlPlugin : IDalamudPlugin itemsOnList = itemsOnList.OrderBy(x => x.InventoryCount).ToList().AsReadOnly(); } - _pluginLog.Information($"Found {itemsOnList.Count} items on current list"); + _pluginLog.Debug($"Found {itemsOnList.Count} to-do items on current list"); if (itemsOnList.Count == 0) continue; foreach (var itemOnList in itemsOnList) { - _pluginLog.Information($"Checking venture info for itemId {itemOnList.ItemId}"); + _pluginLog.Debug($"Checking venture info for itemId {itemOnList.ItemId}"); var (venture, reward) = _ventureResolver.ResolveVenture(ch, retainer, itemOnList.ItemId); - if (venture == null || reward == null) + if (venture == null) { - _pluginLog.Information($"Retainer can't complete venture '{venture?.Name}'"); + venture = _gameCache.Ventures.FirstOrDefault(x => x.ItemId == itemOnList.ItemId); + _pluginLog.Debug($"Retainer doesn't know how to gather itemId {itemOnList.ItemId} ({venture?.Name})"); + } + else if (reward == null) + { + _pluginLog.Debug($"Retainer can't complete venture '{venture.Name}'"); } else { @@ -235,7 +239,7 @@ public sealed partial class AutoRetainerControlPlugin : IDalamudPlugin } } - // fallback: managed but no venture found + // fallback: managed but no venture found/ if (retainer.LastVenture != QuickVentureId) { _chatGui.Print( @@ -251,7 +255,7 @@ public sealed partial class AutoRetainerControlPlugin : IDalamudPlugin .Append("Quick Venture") .Append(new UIForegroundPayload(0)) .Append(".")); - _pluginLog.Information($"No tasks left (previous venture = {retainer.LastVenture}), using QC"); + _pluginLog.Information($"No tasks left (previous venture = {retainer.LastVenture}), using QV"); if (!dryRun) { @@ -337,7 +341,7 @@ public sealed partial class AutoRetainerControlPlugin : IDalamudPlugin { if (arguments == "sync") Sync(); - else if (arguments == "d") + else if (arguments.StartsWith("dnv")) { var ch = _configuration.Characters.SingleOrDefault(x => x.LocalContentId == _clientState.LocalContentId); if (ch == null || ch.Type == Configuration.CharacterType.NotManaged || ch.Retainers.Count == 0) @@ -346,7 +350,22 @@ public sealed partial class AutoRetainerControlPlugin : IDalamudPlugin return; } - string retainerName = ch.Retainers.OrderBy(x => x.DisplayOrder).First().Name; + string[] s = arguments.Split(" "); + string? retainerName; + if (s.Length > 1) + retainerName = ch.Retainers.SingleOrDefault(x => x.Name.EqualsIgnoreCase(s[1]))?.Name; + else + retainerName = ch.Retainers.MinBy(x => x.DisplayOrder)?.Name; + + if (retainerName == null) + { + if (s.Length > 1) + _chatGui.PrintError($"Could not find retainer {s[1]}."); + else + _chatGui.PrintError("Could not find retainer."); + return; + } + var venture = GetNextVenture(retainerName, true); if (venture == QuickVentureId) _chatGui.Print($"Next venture for {retainerName} is Quick Venture."); diff --git a/ARControl/GameData/VentureResolver.cs b/ARControl/GameData/VentureResolver.cs index 5b6802a..c16e7e0 100644 --- a/ARControl/GameData/VentureResolver.cs +++ b/ARControl/GameData/VentureResolver.cs @@ -22,7 +22,7 @@ internal sealed class VentureResolver .FirstOrDefault(x => x.ItemId == itemId && x.MatchesJob(retainer.Job)); if (venture == null) { - _pluginLog.Information($"No applicable venture found for itemId {itemId}"); + _pluginLog.Debug($"No applicable venture found for itemId {itemId} as {retainer.Job}"); return (null, null); } @@ -33,7 +33,7 @@ internal sealed class VentureResolver return (null, null); } - _pluginLog.Information( + _pluginLog.Debug( $"Found venture {venture.Name}, row = {venture.RowId}, checking if we have high enough stats"); VentureReward? reward = null; if (venture.CategoryName is "MIN" or "BTN")