From 0be5bce7e0199a2678d42147f524c32ed566c8a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=AC=E3=83=AB=E3=83=A0?= Date: Sun, 24 Nov 2024 01:23:29 +0900 Subject: [PATCH] [improve] input character name from cross world party --- .../P2 Sanctity Of The Ward First.cs | 8 +++++--- .../P5 Death of the Heavens.cs | 10 ++++++---- .../Dragonsong's Reprise/P6 Wroth Flames.cs | 20 ++++++++++--------- .../P6 Wyrmsbreath First.cs | 8 +++++--- .../The Omega Protocol/BSOD Adjuster.cs | 12 +++++------ .../Cosmo Meteor Adjuster.cs | 12 +++++------ .../Oversampled Wave Cannon.cs | 12 +++++------ .../The Omega Protocol/Party Synergy.cs | 11 ++++------ .../The Omega Protocol/Program Loop.cs | 6 +++++- 9 files changed, 51 insertions(+), 48 deletions(-) diff --git a/SplatoonScripts/Duties/Endwalker/Dragonsong's Reprise/P2 Sanctity Of The Ward First.cs b/SplatoonScripts/Duties/Endwalker/Dragonsong's Reprise/P2 Sanctity Of The Ward First.cs index d7c7f23f..f86d2d68 100644 --- a/SplatoonScripts/Duties/Endwalker/Dragonsong's Reprise/P2 Sanctity Of The Ward First.cs +++ b/SplatoonScripts/Duties/Endwalker/Dragonsong's Reprise/P2 Sanctity Of The Ward First.cs @@ -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; @@ -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(); } diff --git a/SplatoonScripts/Duties/Endwalker/Dragonsong's Reprise/P5 Death of the Heavens.cs b/SplatoonScripts/Duties/Endwalker/Dragonsong's Reprise/P5 Death of the Heavens.cs index 4a8f2c5e..be13c79e 100644 --- a/SplatoonScripts/Duties/Endwalker/Dragonsong's Reprise/P5 Death of the Heavens.cs +++ b/SplatoonScripts/Duties/Endwalker/Dragonsong's Reprise/P5 Death of the Heavens.cs @@ -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; @@ -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(); } @@ -588,4 +590,4 @@ public static bool HasDoom(this IPlayerCharacter p) { return p.StatusList.Any(x => x.StatusId == 2976); } -} +} \ No newline at end of file diff --git a/SplatoonScripts/Duties/Endwalker/Dragonsong's Reprise/P6 Wroth Flames.cs b/SplatoonScripts/Duties/Endwalker/Dragonsong's Reprise/P6 Wroth Flames.cs index ec7ada76..f00b6ea7 100644 --- a/SplatoonScripts/Duties/Endwalker/Dragonsong's Reprise/P6 Wroth Flames.cs +++ b/SplatoonScripts/Duties/Endwalker/Dragonsong's Reprise/P6 Wroth Flames.cs @@ -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; @@ -91,7 +92,7 @@ public override void OnStartingCast(uint source, uint castId) } } } - + public override void OnDirectorUpdate(DirectorUpdateCategory category) { if (!C.ShouldCheckOnStart) @@ -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 @@ -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++) { @@ -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(); } @@ -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}"); @@ -446,4 +448,4 @@ private class Config : IEzConfig public string[] Priority = ["", "", "", "", "", "", "", ""]; public bool ShouldCheckOnStart; } -} +} \ No newline at end of file diff --git a/SplatoonScripts/Duties/Endwalker/Dragonsong's Reprise/P6 Wyrmsbreath First.cs b/SplatoonScripts/Duties/Endwalker/Dragonsong's Reprise/P6 Wyrmsbreath First.cs index 5e351ef2..67bd9148 100644 --- a/SplatoonScripts/Duties/Endwalker/Dragonsong's Reprise/P6 Wyrmsbreath First.cs +++ b/SplatoonScripts/Duties/Endwalker/Dragonsong's Reprise/P6 Wyrmsbreath First.cs @@ -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; @@ -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(); } diff --git a/SplatoonScripts/Duties/Endwalker/The Omega Protocol/BSOD Adjuster.cs b/SplatoonScripts/Duties/Endwalker/The Omega Protocol/BSOD Adjuster.cs index 6c9b3149..73605fe8 100644 --- a/SplatoonScripts/Duties/Endwalker/The Omega Protocol/BSOD Adjuster.cs +++ b/SplatoonScripts/Duties/Endwalker/The Omega Protocol/BSOD Adjuster.cs @@ -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 @@ -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(); diff --git a/SplatoonScripts/Duties/Endwalker/The Omega Protocol/Cosmo Meteor Adjuster.cs b/SplatoonScripts/Duties/Endwalker/The Omega Protocol/Cosmo Meteor Adjuster.cs index 2ab02d3c..6db85899 100644 --- a/SplatoonScripts/Duties/Endwalker/The Omega Protocol/Cosmo Meteor Adjuster.cs +++ b/SplatoonScripts/Duties/Endwalker/The Omega Protocol/Cosmo Meteor Adjuster.cs @@ -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 @@ -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(); diff --git a/SplatoonScripts/Duties/Endwalker/The Omega Protocol/Oversampled Wave Cannon.cs b/SplatoonScripts/Duties/Endwalker/The Omega Protocol/Oversampled Wave Cannon.cs index ad6e2d08..cf3ba5cb 100644 --- a/SplatoonScripts/Duties/Endwalker/The Omega Protocol/Oversampled Wave Cannon.cs +++ b/SplatoonScripts/Duties/Endwalker/The Omega Protocol/Oversampled Wave Cannon.cs @@ -19,6 +19,7 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Numerics; +using ECommons.PartyFunctions; namespace SplatoonScriptsOfficial.Duties.Endwalker.The_Omega_Protocol; @@ -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(); diff --git a/SplatoonScripts/Duties/Endwalker/The Omega Protocol/Party Synergy.cs b/SplatoonScripts/Duties/Endwalker/The Omega Protocol/Party Synergy.cs index b21b0703..07a808f5 100644 --- a/SplatoonScripts/Duties/Endwalker/The Omega Protocol/Party Synergy.cs +++ b/SplatoonScripts/Duties/Endwalker/The Omega Protocol/Party Synergy.cs @@ -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(); diff --git a/SplatoonScripts/Duties/Endwalker/The Omega Protocol/Program Loop.cs b/SplatoonScripts/Duties/Endwalker/The Omega Protocol/Program Loop.cs index b6d488b9..9aa1e409 100644 --- a/SplatoonScripts/Duties/Endwalker/The Omega Protocol/Program Loop.cs +++ b/SplatoonScripts/Duties/Endwalker/The Omega Protocol/Program Loop.cs @@ -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 @@ -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);