|
9 | 9 |
|
10 | 10 | using FFXIVClientStructs.FFXIV.Client.UI.Agent; |
11 | 11 |
|
12 | | -using Lumina.Excel; |
13 | 12 | using Lumina.Excel.Sheets; |
14 | 13 |
|
15 | 14 | using VariableVixen.TinyCmds.Attributes; |
@@ -46,7 +45,7 @@ public class LocateBestFATECommand: PluginCommand { |
46 | 45 | internal static DalamudLinkPayload findFateByNamePayload = null!; |
47 | 46 | protected override void Initialise() { |
48 | 47 | base.Initialise(); |
49 | | - findFateByNamePayload ??= Plugin.PluginInterface.AddChatLinkHandler(Plugin.FindFateByNamePayloadId, this.findFateByName); |
| 48 | + findFateByNamePayload ??= Plugin.Chat.AddChatLinkHandler(Plugin.FindFateByNamePayloadId, this.findFateByName); |
50 | 49 | } |
51 | 50 | private unsafe void findFateByName(uint linkId, SeString linkText) { |
52 | 51 | if (linkId is not Plugin.FindFateByNamePayloadId) { // ...how? |
@@ -123,13 +122,13 @@ protected override unsafe void Execute(string? command, string rawArguments, Fla |
123 | 122 | ? fates.OrderByDescending(f => f.Level).First().Level |
124 | 123 | : fates.OrderBy(f => f.Level).First().Level; |
125 | 124 | Fate[] filtered = fates.Where(f => f.Level == fateLevel).ToArray(); |
126 | | - IEnumerable<Fate> found = filtered.Where(f => f.State is FateState.Preparation || f.TimeRemaining >= minTime && f.Progress <= maxProgress); |
| 125 | + IEnumerable<Fate> found = filtered.Where(f => f.State is FateState.Preparation || (f.TimeRemaining >= minTime && f.Progress <= maxProgress)); |
127 | 126 | bool adjusted = false; |
128 | 127 | while (!found.Any()) { // nothing was found that matches, so we need to gradually relax the limits until SOMETHING comes up |
129 | 128 | adjusted = true; |
130 | 129 | minTime = minTime >= 30 ? minTime - 30 : 0; |
131 | 130 | maxProgress = (byte)Math.Min(maxProgress + 5, 100); |
132 | | - found = filtered.Where(f => f.State is FateState.Preparation || f.TimeRemaining >= minTime && f.Progress <= maxProgress); |
| 131 | + found = filtered.Where(f => f.State is FateState.Preparation || (f.TimeRemaining >= minTime && f.Progress <= maxProgress)); |
133 | 132 | if (minTime == 0 && maxProgress == 100) // just in case, to avoid infinite thrash loops |
134 | 133 | break; |
135 | 134 | } |
|
0 commit comments