Skip to content

Commit

Permalink
finalize edit window
Browse files Browse the repository at this point in the history
Signed-off-by: Mira <koenari@koenari.de>
  • Loading branch information
Koenari committed Dec 29, 2024
1 parent e18bffb commit b8419c4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
26 changes: 15 additions & 11 deletions HimbeertoniRaidTool/UI/EditWindows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
using HimbeertoniRaidTool.Plugin.Connectors;
using HimbeertoniRaidTool.Plugin.DataManagement;
using HimbeertoniRaidTool.Plugin.Localization;
using HimbeertoniRaidTool.Plugin.Modules;
using ImGuiNET;
using Lumina.Excel.Sheets;
using Action = System.Action;
using EnumExtensions = HimbeertoniRaidTool.Common.Data.EnumExtensions;

namespace HimbeertoniRaidTool.Plugin.UI;

Expand Down Expand Up @@ -505,7 +505,9 @@ private void DrawGeneralSection()
ImGui.TableNextColumn();
ImGui.Text($"{DataCopy.TimeStamp}");
ImGui.TableNextColumn();
ImGui.SetNextItemWidth(60 * ScaleFactor);
ImGui.Text(GeneralLoc.EditGearSetUi_txt_job);
ImGui.TableNextColumn();
ImGui.SetNextItemWidth(70 * ScaleFactor);
ImGui.BeginDisabled(_providedJob is not null);
ImGuiHelper.Combo("##JobSelection", ref _job);
ImGui.EndDisabled();
Expand Down Expand Up @@ -612,31 +614,33 @@ private void DrawReplaceSection()
var bisSets = connector.GetBiSList(_job);
if (!bisSets.Any()) continue;
ImGui.Text(string.Format(GeneralLoc.EditGearSetUi_text_getCuratedBis, service.FriendlyName()));
foreach ((string etroId, string name) in bisSets)
foreach ((string externalId, string name) in bisSets)
{
ImGui.SameLine();
if (ImGuiHelper.Button($"{name}##BIS#{etroId}", $"{etroId}"))
if (ImGuiHelper.Button($"{name}##BIS#{externalId}", $"{externalId}"))
{
if (Factory.DataManager.GearDb.Search(gearSet => gearSet?.ExternalId == etroId,
out var newSet))
if (Factory.DataManager.GearDb.Search(
gearSet => gearSet?.ExternalId == externalId && gearSet.ManagedBy == service,
out var newSet))
{
ReplaceOriginal(newSet);
return;
continue;
}
ReplaceOriginal(new GearSet(GearSetManager.Etro, name)
ReplaceOriginal(new GearSet(service, name)
{
ExternalId = etroId,
ExternalId = externalId,
});
connector.RequestGearSetUpdate(DataCopy);
return;
continue;
}
}
}

ImGui.Text("Replace with: ");
ImGui.SameLine();
ImGui.SetNextItemWidth(100 * ScaleFactor);
ImGuiHelper.Combo("##manager", ref _curSetManager, null, val => val != GearSetManager.Hrt);
ImGuiHelper.Combo("##manager", ref _curSetManager, EnumExtensions.FriendlyName,
val => val != GearSetManager.Hrt);
ImGui.SetNextItemWidth(200 * ScaleFactor);
ImGui.SameLine();
if (ImGui.InputText("ID/Url", ref _externalIdInput, 255))
Expand Down
2 changes: 1 addition & 1 deletion lib/HimbeertoniRaidTool.Common

0 comments on commit b8419c4

Please sign in to comment.