Skip to content

Commit

Permalink
[improve] input character name from cross world party
Browse files Browse the repository at this point in the history
  • Loading branch information
Garume committed Nov 23, 2024
1 parent 19c9948 commit 0be5bce
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using ECommons.Hooks;
using ECommons.ImGuiMethods;
using ECommons.MathHelpers;
using ECommons.PartyFunctions;
using FFXIVClientStructs.FFXIV.Client.Game;
using ImGuiNET;
using Splatoon;
Expand Down Expand Up @@ -296,9 +297,10 @@ public override void OnSettingsDraw()
ImGui.SetNextItemWidth(150);
if (ImGui.BeginCombo("##partysel", "Select from party"))
{
foreach (var x in FakeParty.Get())
if (ImGui.Selectable(x.Name.ToString()))
C.PairCharacterName = x.Name.ToString();
foreach (var x in FakeParty.Get().Select(x => x.Name.ToString())
.Union(UniversalParty.Members.Select(x => x.Name)).ToHashSet())
if (ImGui.Selectable(x))
C.PairCharacterName = x;
ImGui.EndCombo();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using ECommons.ImGuiMethods;
using ECommons.Logging;
using ECommons.MathHelpers;
using ECommons.PartyFunctions;
using FFXIVClientStructs.FFXIV.Client.Game;
using ImGuiNET;
using Splatoon;
Expand Down Expand Up @@ -134,9 +135,10 @@ private bool DrawPriorityList()
ImGui.SetNextItemWidth(150);
if (ImGui.BeginCombo("##partysel", "Select from party"))
{
foreach (var x in FakeParty.Get())
if (ImGui.Selectable(x.Name.ToString()))
C.Priority[i] = x.Name.ToString();
foreach (var x in FakeParty.Get().Select(x => x.Name.ToString())
.Union(UniversalParty.Members.Select(x => x.Name)).ToHashSet())
if (ImGui.Selectable(x))
C.Priority[i] = x;
ImGui.EndCombo();
}

Expand Down Expand Up @@ -588,4 +590,4 @@ public static bool HasDoom(this IPlayerCharacter p)
{
return p.StatusList.Any(x => x.StatusId == 2976);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using ECommons.Hooks.ActionEffectTypes;
using ECommons.ImGuiMethods;
using ECommons.MathHelpers;
using ECommons.PartyFunctions;
using FFXIVClientStructs.FFXIV.Client.Game;
using ImGuiNET;
using Splatoon;
Expand Down Expand Up @@ -91,7 +92,7 @@ public override void OnStartingCast(uint source, uint castId)
}
}
}

public override void OnDirectorUpdate(DirectorUpdateCategory category)
{
if (!C.ShouldCheckOnStart)
Expand All @@ -100,7 +101,7 @@ public override void OnDirectorUpdate(DirectorUpdateCategory category)
(category == DirectorUpdateCategory.Recommence && Controller.Phase == 2))
SelfTest();
}

private void SelfTest()
{
Svc.Chat.PrintChat(new XivChatEntry
Expand Down Expand Up @@ -327,7 +328,7 @@ private bool DrawPriorityList()
ImGui.SameLine();
ImGuiEx.Spacing();
if (ImGui.Button("Perform test")) SelfTest();

ImGui.PushID("prio");
for (var i = 0; i < C.Priority.Length; i++)
{
Expand All @@ -340,9 +341,10 @@ private bool DrawPriorityList()
ImGui.SetNextItemWidth(150);
if (ImGui.BeginCombo("##partysel", "Select from party"))
{
foreach (var x in FakeParty.Get())
if (ImGui.Selectable(x.Name.ToString()))
C.Priority[i] = x.Name.ToString();
foreach (var x in FakeParty.Get().Select(x => x.Name.ToString())
.Union(UniversalParty.Members.Select(x => x.Name)).ToHashSet())
if (ImGui.Selectable(x))
C.Priority[i] = x;
ImGui.EndCombo();
}

Expand Down Expand Up @@ -371,12 +373,12 @@ public override void OnSettingsDraw()
if (C.PrioritizeWest)
C.PrioritizeSecondRedBallDiagonal = false;
ImGui.Unindent();

ImGui.Text("Spread Settings");
ImGui.Indent();
DrawPriorityList();
ImGui.Unindent();

if (ImGuiEx.CollapsingHeader("Debug"))
{
ImGui.Text($"State: {_state}");
Expand Down Expand Up @@ -446,4 +448,4 @@ private class Config : IEzConfig
public string[] Priority = ["", "", "", "", "", "", "", ""];
public bool ShouldCheckOnStart;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using ECommons.ImGuiMethods;
using ECommons.Logging;
using ECommons.MathHelpers;
using ECommons.PartyFunctions;
using FFXIVClientStructs.FFXIV.Client.Game;
using ImGuiNET;
using Splatoon;
Expand Down Expand Up @@ -260,9 +261,10 @@ public override void OnSettingsDraw()
ImGui.SetNextItemWidth(150);
if (ImGui.BeginCombo("##partysel", "Select from party"))
{
foreach (var x in FakeParty.Get())
if (ImGui.Selectable(x.Name.ToString()))
C.CharacterNames[i] = x.Name.ToString();
foreach (var x in FakeParty.Get().Select(x => x.Name.ToString())
.Union(UniversalParty.Members.Select(x => x.Name)).ToHashSet())
if (ImGui.Selectable(x))
C.CharacterNames[i] = x;
ImGui.EndCombo();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Runtime.CompilerServices;
using ECommons.PartyFunctions;

namespace SplatoonScriptsOfficial.Duties.Endwalker.The_Omega_Protocol;
internal class BSOD_Adjuster :SplatoonScript
Expand Down Expand Up @@ -259,13 +260,10 @@ private bool DrawPrioList(int num)
ImGui.SetNextItemWidth(150);
if(ImGui.BeginCombo("##partysel", "Select from party"))
{
foreach(var x in FakeParty.Get())
{
if(ImGui.Selectable(x.Name.ToString()))
{
prio[i] = x.Name.ToString();
}
}
foreach (var x in FakeParty.Get().Select(x => x.Name.ToString())
.Union(UniversalParty.Members.Select(x => x.Name)).ToHashSet())
if (ImGui.Selectable(x))
prio[i] = x;
ImGui.EndCombo();
}
ImGui.PopID();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using ECommons.PartyFunctions;

namespace SplatoonScriptsOfficial.Duties.Endwalker.The_Omega_Protocol;
internal unsafe class Cosmo_Meteor_Adjuster :SplatoonScript
Expand Down Expand Up @@ -278,13 +279,10 @@ private bool DrawPrioList(int num)
ImGui.SetNextItemWidth(150);
if(ImGui.BeginCombo("##partysel", "Select from party"))
{
foreach(var x in FakeParty.Get())
{
if(ImGui.Selectable(x.Name.ToString()))
{
prio[i] = x.Name.ToString();
}
}
foreach (var x in FakeParty.Get().Select(x => x.Name.ToString())
.Union(UniversalParty.Members.Select(x => x.Name)).ToHashSet())
if (ImGui.Selectable(x))
prio[i] = x;
ImGui.EndCombo();
}
ImGui.PopID();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Numerics;
using ECommons.PartyFunctions;

namespace SplatoonScriptsOfficial.Duties.Endwalker.The_Omega_Protocol;

Expand Down Expand Up @@ -322,13 +323,10 @@ private bool DrawPrioList(int num)
ImGui.SetNextItemWidth(150);
if(ImGui.BeginCombo("##partysel", "Select from party"))
{
foreach(var x in FakeParty.Get())
{
if(ImGui.Selectable(x.Name.ToString()))
{
prio[i] = x.Name.ToString();
}
}
foreach (var x in FakeParty.Get().Select(x => x.Name.ToString())
.Union(UniversalParty.Members.Select(x => x.Name)).ToHashSet())
if (ImGui.Selectable(x))
prio[i] = x;
ImGui.EndCombo();
}
ImGui.PopID();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -655,13 +655,10 @@ private bool DrawPrioList(int num)
ImGui.SetNextItemWidth(150);
if(ImGui.BeginCombo("##partysel", "Select from party"))
{
foreach(var x in FakeParty.Get())
{
if(ImGui.Selectable(x.Name.ToString()))
{
prio[i] = x.Name.ToString();
}
}
foreach (var x in FakeParty.Get().Select(x => x.Name.ToString())
.Union(UniversalParty.Members.Select(x => x.Name)).ToHashSet())
if (ImGui.Selectable(x))
prio[i] = x;
ImGui.EndCombo();
}
ImGui.PopID();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using ECommons.PartyFunctions;
using PluginLog = ECommons.Logging.PluginLog;

namespace SplatoonScriptsOfficial.Duties.Endwalker.The_Omega_Protocol
Expand Down Expand Up @@ -537,7 +538,10 @@ public override void OnSettingsDraw()
ImGui.SetNextItemWidth(120f);
if (ImGui.BeginCombo("##partysel", "Select from party"))
{
FakeParty.Get().Each((x) => { if (ImGui.Selectable(x.Name.ToString())) Conf.Swappers.Add(x.Name.ToString()); });
foreach (var x in FakeParty.Get().Select(x => x.Name.ToString())
.Union(UniversalParty.Members.Select(x => x.Name)).ToHashSet())
if (ImGui.Selectable(x))
Conf.Swappers.Add(x);
ImGui.EndCombo();
}
ImGui.ColorEdit4("Primary tower color", ref Conf.TowerColor1, ImGuiColorEditFlags.NoInputs);
Expand Down

0 comments on commit 0be5bce

Please sign in to comment.