Fix EQDP bug.

This commit is contained in:
Ottermandias 2024-06-15 12:09:41 +02:00
parent ad0c64d4ac
commit 30b32fdcd2
3 changed files with 4 additions and 12 deletions

View file

@ -38,7 +38,7 @@ public sealed class EqpCache(MetaFileManager manager, ModCollection collection)
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
private EqpEntry GetSingleValue(PrimaryId id, EquipSlot slot)
=> TryGetValue(new EqpIdentifier(id, slot), out var pair) ? pair.Entry : ExpandedEqpFile.GetDefault(manager, id) & Eqp.Mask(slot);
=> TryGetValue(new EqpIdentifier(id, slot), out var pair) ? pair.Entry : ExpandedEqpFile.GetDefault(Manager, id) & Eqp.Mask(slot);
public MetaList.MetaReverter TemporarilySetFile()
=> Manager.TemporarilySetFile(_eqpFile, MetaIndex.Eqp);

View file

@ -104,15 +104,11 @@ public unsafe class ExpandedEqpGmpBase : MetaBaseFile
}
}
public sealed class ExpandedEqpFile : ExpandedEqpGmpBase, IEnumerable<EqpEntry>
public sealed class ExpandedEqpFile(MetaFileManager manager) : ExpandedEqpGmpBase(manager, false), IEnumerable<EqpEntry>
{
public static readonly CharacterUtility.InternalIndex InternalIndex =
CharacterUtility.ReverseIndices[(int)MetaIndex.Eqp];
public ExpandedEqpFile(MetaFileManager manager)
: base(manager, false)
{ }
public EqpEntry this[PrimaryId idx]
{
get => (EqpEntry)GetInternal(idx);
@ -147,15 +143,11 @@ public sealed class ExpandedEqpFile : ExpandedEqpGmpBase, IEnumerable<EqpEntry>
=> GetEnumerator();
}
public sealed class ExpandedGmpFile : ExpandedEqpGmpBase, IEnumerable<GmpEntry>
public sealed class ExpandedGmpFile(MetaFileManager manager) : ExpandedEqpGmpBase(manager, true), IEnumerable<GmpEntry>
{
public static readonly CharacterUtility.InternalIndex InternalIndex =
CharacterUtility.ReverseIndices[(int)MetaIndex.Gmp];
public ExpandedGmpFile(MetaFileManager manager)
: base(manager, true)
{ }
public GmpEntry this[PrimaryId idx]
{
get => new() { Value = GetInternal(idx) };

View file

@ -112,7 +112,7 @@ public sealed class EqdpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFil
ImGui.SameLine();
if (Checkmark("Model##eqdp"u8, "\0"u8, entry.Model, defaultEntry.Model, out var newModel))
{
entry = entry with { Material = newModel };
entry = entry with { Model = newModel };
changes = true;
}