Compare commits

...

No commits in common. "149d1b806d2fb94b1aece1b55449d460563bc0f1" and "main" have entirely different histories.

7 changed files with 68 additions and 41 deletions

View File

@ -1,49 +1,59 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5-windows</TargetFramework> <TargetFramework>net7-windows</TargetFramework>
<Version>1.2.1</Version> <Version>1.2.7</Version>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ProduceReferenceAssembly>false</ProduceReferenceAssembly> <ProduceReferenceAssembly>false</ProduceReferenceAssembly>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<DalamudLibPath>$(AppData)\XIVLauncher\addon\Hooks\dev</DalamudLibPath>
</PropertyGroup>
<PropertyGroup Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'">
<DalamudLibPath>$(DALAMUD_HOME)</DalamudLibPath>
</PropertyGroup>
<PropertyGroup Condition="'$(IsCI)' == 'true'">
<DalamudLibPath>$(HOME)/dalamud</DalamudLibPath>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Dalamud"> <Reference Include="Dalamud">
<HintPath>$(AppData)\XIVLauncher\addon\Hooks\dev\Dalamud.dll</HintPath> <HintPath>$(DalamudLibPath)\Dalamud.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="FFXIVClientStructs"> <Reference Include="FFXIVClientStructs">
<HintPath>$(AppData)\XIVLauncher\addon\Hooks\dev\FFXIVClientStructs.dll</HintPath> <HintPath>$(DalamudLibPath)\FFXIVClientStructs.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="ImGui.NET"> <Reference Include="ImGui.NET">
<HintPath>$(AppData)\XIVLauncher\addon\Hooks\dev\ImGui.NET.dll</HintPath> <HintPath>$(DalamudLibPath)\ImGui.NET.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="ImGuiScene"> <Reference Include="ImGuiScene">
<HintPath>$(AppData)\XIVLauncher\addon\Hooks\dev\ImGuiScene.dll</HintPath> <HintPath>$(DalamudLibPath)\ImGuiScene.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="Lumina"> <Reference Include="Lumina">
<HintPath>$(AppData)\XIVLauncher\addon\Hooks\dev\Lumina.dll</HintPath> <HintPath>$(DalamudLibPath)\Lumina.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="Lumina.Excel"> <Reference Include="Lumina.Excel">
<HintPath>$(AppData)\XIVLauncher\addon\Hooks\dev\Lumina.Excel.dll</HintPath> <HintPath>$(DalamudLibPath)\Lumina.Excel.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="DalamudPackager" Version="2.1.2"/> <PackageReference Include="DalamudPackager" Version="2.1.12"/>
<PackageReference Include="XivCommon" Version="3.0.1"/> <PackageReference Include="XivCommon" Version="9.0.0"/>
</ItemGroup>
<ItemGroup>
<Content Include="..\icon.png" Link="images/icon.png" CopyToOutputDirectory="PreserveNewest" Visible="false"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,4 +1,4 @@
author: ascclemens author: Anna
name: Better Party Finder name: Better Party Finder
punchline: Use advanced Party Finder filter presets. punchline: Use advanced Party Finder filter presets.
description: |- description: |-
@ -12,3 +12,4 @@ description: |-
- Remove PFs above maximum item level - Remove PFs above maximum item level
- Filter on item level range - Filter on item level range
- Filter on multiple jobs and slots (ex. MCH + GNB available) - Filter on multiple jobs and slots (ex. MCH + GNB available)
repo_url: https://git.anna.lgbt/anna/BetterPartyFinder

View File

@ -25,7 +25,7 @@ namespace BetterPartyFinder {
SeString msg = "Party description: "; SeString msg = "Party description: ";
msg.Payloads.AddRange(listing.Description.Payloads); msg.Payloads.AddRange(listing.Description.Payloads);
this.Plugin.ChatGui.PrintChat(new XivChatEntry { this.Plugin.ChatGui.Print(new XivChatEntry {
Name = "Better Party Finder", Name = "Better Party Finder",
Type = XivChatType.SystemMessage, Type = XivChatType.SystemMessage,
Message = msg, Message = msg,

View File

@ -1,37 +1,33 @@
using Dalamud.Data; using Dalamud.IoC;
using Dalamud.Game.ClientState;
using Dalamud.Game.Command;
using Dalamud.Game.Gui;
using Dalamud.Game.Gui.PartyFinder;
using Dalamud.IoC;
using Dalamud.Plugin; using Dalamud.Plugin;
using Dalamud.Plugin.Services;
using XivCommon; using XivCommon;
namespace BetterPartyFinder { namespace BetterPartyFinder {
// ReSharper disable once ClassNeverInstantiated.Global // ReSharper disable once ClassNeverInstantiated.Global
public class Plugin : IDalamudPlugin { public class Plugin : IDalamudPlugin {
public string Name => "Better Party Finder"; internal static string Name => "Better Party Finder";
[PluginService] [PluginService]
internal DalamudPluginInterface Interface { get; init; } = null!; internal DalamudPluginInterface Interface { get; init; } = null!;
[PluginService] [PluginService]
internal ChatGui ChatGui { get; init; } = null!; internal IChatGui ChatGui { get; init; } = null!;
[PluginService] [PluginService]
internal ClientState ClientState { get; init; } = null!; internal IClientState ClientState { get; init; } = null!;
[PluginService] [PluginService]
internal CommandManager CommandManager { get; init; } = null!; internal ICommandManager CommandManager { get; init; } = null!;
[PluginService] [PluginService]
internal DataManager DataManager { get; init; } = null!; internal IDataManager DataManager { get; init; } = null!;
[PluginService] [PluginService]
internal GameGui GameGui { get; init; } = null!; internal IGameGui GameGui { get; init; } = null!;
[PluginService] [PluginService]
internal PartyFinderGui PartyFinderGui { get; init; } = null!; internal IPartyFinderGui PartyFinderGui { get; init; } = null!;
internal Configuration Config { get; } internal Configuration Config { get; }
private Filter Filter { get; } private Filter Filter { get; }
@ -44,7 +40,7 @@ namespace BetterPartyFinder {
this.Config = Configuration.Load(this) ?? new Configuration(); this.Config = Configuration.Load(this) ?? new Configuration();
this.Config.Initialise(this); this.Config.Initialise(this);
this.Common = new XivCommonBase(Hooks.PartyFinder); this.Common = new XivCommonBase(this.Interface, Hooks.PartyFinder);
this.Filter = new Filter(this); this.Filter = new Filter(this);
this.JoinHandler = new JoinHandler(this); this.JoinHandler = new JoinHandler(this);
this.Ui = new PluginUi(this); this.Ui = new PluginUi(this);

View File

@ -2,10 +2,11 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Numerics; using System.Numerics;
using Dalamud.Data;
using Dalamud.Game.Gui.PartyFinder.Types; using Dalamud.Game.Gui.PartyFinder.Types;
using Dalamud.Game.Text.SeStringHandling; using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Interface; using Dalamud.Interface;
using Dalamud.Interface.Utility;
using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Component.GUI; using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET; using ImGuiNET;
using Lumina.Excel.GeneratedSheets; using Lumina.Excel.GeneratedSheets;
@ -88,7 +89,7 @@ namespace BetterPartyFinder {
private void DrawSettingsWindow() { private void DrawSettingsWindow() {
ImGui.SetNextWindowSize(new Vector2(-1f, -1f), ImGuiCond.FirstUseEver); ImGui.SetNextWindowSize(new Vector2(-1f, -1f), ImGuiCond.FirstUseEver);
if (!this.SettingsVisible || !ImGui.Begin($"{this.Plugin.Name} settings", ref this._settingsVisible)) { if (!this.SettingsVisible || !ImGui.Begin($"{Plugin.Name} settings", ref this._settingsVisible)) {
return; return;
} }
@ -141,7 +142,7 @@ namespace BetterPartyFinder {
return; return;
} }
if (!ImGui.Begin(this.Plugin.Name, ref this._visible, ImGuiWindowFlags.NoDocking)) { if (!ImGui.Begin(Plugin.Name, ref this._visible, ImGuiWindowFlags.NoDocking)) {
if (ImGui.IsWindowCollapsed() && addon != null && addon->IsVisible) { if (ImGui.IsWindowCollapsed() && addon != null && addon->IsVisible) {
// wait until addon is initialised to show // wait until addon is initialised to show
var rootNode = addon->RootNode; var rootNode = addon->RootNode;
@ -362,7 +363,7 @@ namespace BetterPartyFinder {
if (ImGui.BeginChild("duty-selection", new Vector2(-1f, -1f))) { if (ImGui.BeginChild("duty-selection", new Vector2(-1f, -1f))) {
var duties = this.Plugin.DataManager.GetExcelSheet<ContentFinderCondition>()! var duties = this.Plugin.DataManager.GetExcelSheet<ContentFinderCondition>()!
.Where(cf => cf.Unknown29) .Where(cf => cf.Unknown30)
.Where(cf => AllowedContentTypes.Contains(cf.ContentType.Row)); .Where(cf => AllowedContentTypes.Contains(cf.ContentType.Row));
var searchQuery = this.DutySearchQuery.Trim(); var searchQuery = this.DutySearchQuery.Trim();
@ -678,7 +679,7 @@ namespace BetterPartyFinder {
} }
internal static class UiCategoryExt { internal static class UiCategoryExt {
internal static string? Name(this UiCategory category, DataManager data) { internal static string? Name(this UiCategory category, IDataManager data) {
var ct = data.GetExcelSheet<ContentType>()!; var ct = data.GetExcelSheet<ContentType>()!;
var addon = data.GetExcelSheet<Addon>()!; var addon = data.GetExcelSheet<Addon>()!;
@ -702,7 +703,7 @@ namespace BetterPartyFinder {
}; };
} }
internal static bool ListingMatches(this UiCategory category, DataManager data, PartyFinderListing listing) { internal static bool ListingMatches(this UiCategory category, IDataManager data, PartyFinderListing listing) {
var cr = data.GetExcelSheet<ContentRoulette>()!; var cr = data.GetExcelSheet<ContentRoulette>()!;
var isDuty = listing.Category == DutyCategory.Duty; var isDuty = listing.Category == DutyCategory.Duty;
@ -712,13 +713,13 @@ namespace BetterPartyFinder {
return category switch { return category switch {
UiCategory.None => isOther && isDuty && listing.RawDuty == 0, UiCategory.None => isOther && isDuty && listing.RawDuty == 0,
UiCategory.DutyRoulette => listing.DutyType == DutyType.Roulette && isDuty && (!cr.GetRow(listing.RawDuty)?.Unknown10 ?? false), UiCategory.DutyRoulette => listing.DutyType == DutyType.Roulette && isDuty && (!cr.GetRow(listing.RawDuty)?.IsPvP ?? false),
UiCategory.Dungeons => isNormalDuty && listing.Duty.Value.ContentType.Row == (uint) ContentType2.Dungeons, UiCategory.Dungeons => isNormalDuty && listing.Duty.Value.ContentType.Row == (uint) ContentType2.Dungeons,
UiCategory.Guildhests => isNormalDuty && listing.Duty.Value.ContentType.Row == (uint) ContentType2.Guildhests, UiCategory.Guildhests => isNormalDuty && listing.Duty.Value.ContentType.Row == (uint) ContentType2.Guildhests,
UiCategory.Trials => isNormalDuty && !listing.Duty.Value.HighEndDuty && listing.Duty.Value.ContentType.Row == (uint) ContentType2.Trials, UiCategory.Trials => isNormalDuty && !listing.Duty.Value.HighEndDuty && listing.Duty.Value.ContentType.Row == (uint) ContentType2.Trials,
UiCategory.Raids => isNormalDuty && !listing.Duty.Value.HighEndDuty && listing.Duty.Value.ContentType.Row == (uint) ContentType2.Raids, UiCategory.Raids => isNormalDuty && !listing.Duty.Value.HighEndDuty && listing.Duty.Value.ContentType.Row == (uint) ContentType2.Raids,
UiCategory.HighEndDuty => isNormalDuty && listing.Duty.Value.HighEndDuty, UiCategory.HighEndDuty => isNormalDuty && listing.Duty.Value.HighEndDuty,
UiCategory.Pvp => listing.DutyType == DutyType.Roulette && isDuty && (cr.GetRow(listing.RawDuty)?.Unknown10 ?? false) UiCategory.Pvp => listing.DutyType == DutyType.Roulette && isDuty && (cr.GetRow(listing.RawDuty)?.IsPvP ?? false)
|| isNormalDuty && listing.Duty.Value.ContentType.Row == (uint) ContentType2.Pvp, || isNormalDuty && listing.Duty.Value.ContentType.Row == (uint) ContentType2.Pvp,
UiCategory.QuestBattles => isOther && listing.Category == DutyCategory.QuestBattles, UiCategory.QuestBattles => isOther && listing.Category == DutyCategory.QuestBattles,
UiCategory.Fates => isOther && listing.Category == DutyCategory.Fates, UiCategory.Fates => isOther && listing.Category == DutyCategory.Fates,

View File

@ -1,15 +1,15 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
using Dalamud.Data;
using Dalamud.Game.ClientState.Objects.SubKinds; using Dalamud.Game.ClientState.Objects.SubKinds;
using Dalamud.Plugin.Services;
using Lumina.Excel.GeneratedSheets; using Lumina.Excel.GeneratedSheets;
namespace BetterPartyFinder { namespace BetterPartyFinder {
public static class Util { public static class Util {
internal static uint MaxItemLevel { get; private set; } internal static uint MaxItemLevel { get; private set; }
internal static void CalculateMaxItemLevel(DataManager data) { internal static void CalculateMaxItemLevel(IDataManager data) {
if (MaxItemLevel > 0) { if (MaxItemLevel > 0) {
return; return;
} }
@ -28,7 +28,7 @@ namespace BetterPartyFinder {
return CultureInfo.InvariantCulture.CompareInfo.IndexOf(haystack, needle, CompareOptions.IgnoreCase) >= 0; return CultureInfo.InvariantCulture.CompareInfo.IndexOf(haystack, needle, CompareOptions.IgnoreCase) >= 0;
} }
internal static IEnumerable<World> WorldsOnDataCentre(DataManager data, PlayerCharacter character) { internal static IEnumerable<World> WorldsOnDataCentre(IDataManager data, PlayerCharacter character) {
var dcRow = character.HomeWorld.GameData.DataCenter.Row; var dcRow = character.HomeWorld.GameData.DataCenter.Row;
return data.GetExcelSheet<World>()! return data.GetExcelSheet<World>()!
.Where(world => world.IsPublic && world.DataCenter.Row == dcRow); .Where(world => world.IsPublic && world.DataCenter.Row == dcRow);

View File

@ -0,0 +1,19 @@
{
"version": 1,
"dependencies": {
"net7.0-windows7.0": {
"DalamudPackager": {
"type": "Direct",
"requested": "[2.1.12, )",
"resolved": "2.1.12",
"contentHash": "Sc0PVxvgg4NQjcI8n10/VfUQBAS4O+Fw2pZrAqBdRMbthYGeogzu5+xmIGCGmsEZ/ukMOBuAqiNiB5qA3MRalg=="
},
"XivCommon": {
"type": "Direct",
"requested": "[9.0.0, )",
"resolved": "9.0.0",
"contentHash": "avaBp3FmSCi/PiQhntCeBDYOHejdyTWmFtz4pRBVQQ8vHkmRx+YTk1la9dkYBMlXxRXKckEdH1iI1Fu61JlE7w=="
}
}
}
}