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

Commit

Permalink
fix: fixed the searching issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Aug 21, 2023
1 parent 89c875a commit a7e8788
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
1 change: 1 addition & 0 deletions Resources/AnimationLockTime.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
"3614": 0.6,
"3615": 0.1,
"3625": 0.6,
"3629": 0.6,
"4262": 0.6,
"4401": 0.6,
"4402": 0.6,
Expand Down
3 changes: 2 additions & 1 deletion Resources/BeneficialPositions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"0": [],
"641": [],
"837": []
"837": [],
"613": []
}
3 changes: 3 additions & 0 deletions Resources/NoHostileNames.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@
],
"837": [
""
],
"613": [
""
]
}
12 changes: 4 additions & 8 deletions RotationSolver/UI/RotationConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1671,8 +1671,7 @@ private static void DrawStatusList(string name, HashSet<uint> statuses, Status[]

foreach (var status in statuses.Select(a => Service.GetSheet<Status>().GetRow(a))
.Where(a => a != null)
.OrderByDescending(s => Math.Min(Similarity(s.Name, _statusSearching)
, Similarity(s.RowId.ToString(), _statusSearching))))
.OrderByDescending(s => Similarity(s.Name + " " + s.RowId.ToString(), _statusSearching)))
{
void Delete() => removeId = status.RowId;

Expand Down Expand Up @@ -1715,8 +1714,7 @@ internal static void StatusPopUp(string popupId, Status[] allStatus, ref string
var index = 0;

var searchingKey = searching;
foreach (var status in allStatus.OrderByDescending(s => Math.Min(Similarity(s.Name, searchingKey)
, Similarity(s.RowId.ToString(), searchingKey))))
foreach (var status in allStatus.OrderByDescending(s => Similarity(s.Name + " " + s.RowId.ToString(), searchingKey)))
{
if (IconSet.GetTexture(status.Icon, out var texture, notLoadId))
{
Expand Down Expand Up @@ -1794,8 +1792,7 @@ private static void DrawActionsList(string name, HashSet<uint> actions)

if (ImGui.BeginChild("Rotation Solver Add action", new Vector2(-1, 400 * _scale)))
{
foreach (var action in AllActions.OrderByDescending(s => Math.Min(Similarity(s.Name, _actionSearching)
, Similarity(s.RowId.ToString(), _actionSearching))))
foreach (var action in AllActions.OrderByDescending(s =>Similarity(s.Name + " " + s.RowId.ToString(), _actionSearching)))
{
var selected = ImGui.Selectable($"{action.Name} ({action.RowId})");
if (ImGui.IsItemHovered())
Expand Down Expand Up @@ -1825,8 +1822,7 @@ private static void DrawActionsList(string name, HashSet<uint> actions)

foreach (var action in actions.Select(a => Service.GetSheet<GAction>().GetRow(a))
.Where(a => a != null)
.OrderByDescending(s => Math.Min(Similarity(s.Name, _actionSearching)
, Similarity(s.RowId.ToString(), _actionSearching))))
.OrderByDescending(s => Similarity(s.Name + " " + s.RowId.ToString(), _actionSearching)))
{
void Reset() => removeId = action.RowId;

Expand Down
2 changes: 0 additions & 2 deletions RotationSolver/UI/RotationConfigWindow_Config.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using Dalamud.Game.ClientState.Keys;
using Dalamud.Interface.Colors;
using ECommons.ImGuiMethods;
using ImGuiNET;
using RotationSolver.Basic.Configuration;
using RotationSolver.Localization;
using RotationSolver.UI.SearchableConfigs;
using RotationSolver.UI.SearchableSettings;
using System.Net.NetworkInformation;

namespace RotationSolver.UI;

Expand Down

0 comments on commit a7e8788

Please sign in to comment.