mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 20:24:17 +01:00
Fix best match fullpath returning broken FullPath instead of nullopt.
This commit is contained in:
parent
fe266dca31
commit
f11cefcec1
2 changed files with 15 additions and 6 deletions
|
|
@ -4,6 +4,7 @@ using Newtonsoft.Json.Linq;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Classes;
|
using OtterGui.Classes;
|
||||||
using Penumbra.Api.Enums;
|
using Penumbra.Api.Enums;
|
||||||
|
using Penumbra.GameData;
|
||||||
using Penumbra.GameData.Data;
|
using Penumbra.GameData.Data;
|
||||||
using Penumbra.Meta.Manipulations;
|
using Penumbra.Meta.Manipulations;
|
||||||
using Penumbra.Mods.Settings;
|
using Penumbra.Mods.Settings;
|
||||||
|
|
@ -40,9 +41,13 @@ public sealed class MultiModGroup(Mod mod) : IModGroup, ITexToolsGroup
|
||||||
=> OptionData.Count > 0;
|
=> OptionData.Count > 0;
|
||||||
|
|
||||||
public FullPath? FindBestMatch(Utf8GamePath gamePath)
|
public FullPath? FindBestMatch(Utf8GamePath gamePath)
|
||||||
=> OptionData.OrderByDescending(o => o.Priority)
|
{
|
||||||
.SelectWhere(o => (o.Files.TryGetValue(gamePath, out var file) || o.FileSwaps.TryGetValue(gamePath, out file), file))
|
foreach (var path in OptionData.OrderByDescending(o => o.Priority)
|
||||||
.FirstOrDefault();
|
.SelectWhere(o => (o.Files.TryGetValue(gamePath, out var file) || o.FileSwaps.TryGetValue(gamePath, out file), file)))
|
||||||
|
return path;
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public IModOption? AddOption(string name, string description = "")
|
public IModOption? AddOption(string name, string description = "")
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,13 @@ public sealed class SingleModGroup(Mod mod) : IModGroup, ITexToolsGroup
|
||||||
public readonly List<SingleSubMod> OptionData = [];
|
public readonly List<SingleSubMod> OptionData = [];
|
||||||
|
|
||||||
public FullPath? FindBestMatch(Utf8GamePath gamePath)
|
public FullPath? FindBestMatch(Utf8GamePath gamePath)
|
||||||
=> OptionData
|
{
|
||||||
.SelectWhere(m => (m.Files.TryGetValue(gamePath, out var file) || m.FileSwaps.TryGetValue(gamePath, out file), file))
|
foreach (var path in OptionData
|
||||||
.FirstOrDefault();
|
.SelectWhere(m => (m.Files.TryGetValue(gamePath, out var file) || m.FileSwaps.TryGetValue(gamePath, out file), file)))
|
||||||
|
return path;
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public IModOption AddOption(string name, string description = "")
|
public IModOption AddOption(string name, string description = "")
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue