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

Commit

Permalink
fix: fixed string match.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jul 23, 2023
1 parent b69f6df commit 8939b24
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Resources/AnimationLockTime.json
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@
"20258": 0.1,
"20304": 0.6,
"20542": 2.1,
"20640": 2.1,
"20710": 0.1,
"20715": 0.6,
"20727": 0.6,
Expand Down Expand Up @@ -444,6 +445,7 @@
"23317": 2.1,
"23915": 0.1,
"24222": 2.1,
"24235": 2.1,
"24283": 0.1,
"24284": 0.1,
"24285": 0.6,
Expand Down Expand Up @@ -578,6 +580,7 @@
"29401": 2.5,
"29709": 0.1,
"31323": 2.1,
"31338": 2.1,
"33041": 2.1,
"33336": 0.1,
"33337": 0.1,
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/RotationSolver.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

<ItemGroup>
<PackageReference Include="DalamudPackager" Version="2.1.11" />
<PackageReference Include="String.Similarity" Version="3.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 4 additions & 2 deletions RotationSolver/UI/ImGuiHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Dalamud.Interface.Components;
using Dalamud.Utility;
using ECommons.DalamudServices;
using F23.StringSimilarity;
using FFXIVClientStructs.FFXIV.Client.Game;
using FFXIVClientStructs.Havok;
using Newtonsoft.Json.Linq;
Expand Down Expand Up @@ -377,7 +378,8 @@ internal static void SearchItems<T>(ref string searchTxt, IEnumerable<T> actions
if (!string.IsNullOrWhiteSpace(searchTxt))
{
var src = searchTxt;
actions = actions.OrderBy(a => !getName(a).Contains(src)).ToArray();
var l = new Levenshtein();
actions = actions.OrderBy(a => l.Distance(getName(a), src)).ToArray();
}

if (ImGui.BeginChild($"##ActionsCandidateList", new Vector2(200, 400), true))
Expand All @@ -400,7 +402,7 @@ internal static void SearchItems<T>(ref string searchTxt, IEnumerable<T> actions
if (getDesc != null && ImGui.IsItemHovered())
{
var desc = getDesc(item);
ImGuiHelper.ShowTooltip(desc);
ShowTooltip(desc);
}
}
ImGui.EndChild();
Expand Down

0 comments on commit 8939b24

Please sign in to comment.