mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 06:20:25 +00:00
Show box/slot offset by 1 when loading as SlotCache
Closes #3229 also revises parsing to not ToString(), and doesn't add a skip if the slot is empty
This commit is contained in:
parent
f2183f985f
commit
16c8a18928
3 changed files with 13 additions and 4 deletions
|
@ -22,10 +22,10 @@ namespace PKHeX.Core
|
|||
(obj, cmd) => obj is SlotCache s && s.Identify().Contains(cmd.PropertyValue) == cmd.Evaluator),
|
||||
|
||||
new MetaFilter(nameof(SlotInfoBox.Box),
|
||||
(obj, cmd) => obj is SlotCache { Source: SlotInfoBox b } && (b.Box.ToString() == cmd.PropertyValue) == cmd.Evaluator),
|
||||
(obj, cmd) => obj is SlotCache { Source: SlotInfoBox b } && int.TryParse(cmd.PropertyValue, out var box) && b.Box == box),
|
||||
|
||||
new MetaFilter(nameof(ISlotInfo.Slot),
|
||||
(obj, cmd) => obj is SlotCache s && (s.Source.Slot.ToString() == cmd.PropertyValue) == cmd.Evaluator),
|
||||
(obj, cmd) => obj is SlotCache s && int.TryParse(cmd.PropertyValue, out var slot) && s.Source.Slot == slot),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ namespace PKHeX.Core
|
|||
{
|
||||
for (int slot = 0; slot < sc; slot++, ctr++)
|
||||
{
|
||||
var ident = new SlotInfoBox(box, slot);
|
||||
var ident = new SlotInfoBox(box + 1, slot + 1);
|
||||
var result = new SlotCache(ident, bd[ctr], sav);
|
||||
db.Add(result);
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ namespace PKHeX.Core
|
|||
if (pk.Species == 0)
|
||||
continue;
|
||||
|
||||
var ident = new SlotInfoParty(index);
|
||||
var ident = new SlotInfoParty(index + 1);
|
||||
var result = new SlotCache(ident, pk, sav);
|
||||
db.Add(result);
|
||||
}
|
||||
|
|
|
@ -241,15 +241,24 @@ namespace PKHeX.WinForms
|
|||
|
||||
private void ProcessSAV(IList<SlotCache> data, IReadOnlyList<StringInstruction> Filters, IReadOnlyList<StringInstruction> Instructions)
|
||||
{
|
||||
if (data.Count == 0)
|
||||
return;
|
||||
|
||||
var filterMeta = Filters.Where(f => BatchFilters.FilterMeta.Any(z => z.IsMatch(f.PropertyName))).ToArray();
|
||||
if (filterMeta.Length != 0)
|
||||
Filters = Filters.Except(filterMeta).ToArray();
|
||||
|
||||
var max = data[0].Entity.MaxSpeciesID;
|
||||
|
||||
for (int i = 0; i < data.Count; i++)
|
||||
{
|
||||
var entry = data[i];
|
||||
var pk = data[i].Entity;
|
||||
|
||||
var spec = pk.Species;
|
||||
if (spec <= 0 || spec > max)
|
||||
continue;
|
||||
|
||||
if (entry.Source is SlotInfoBox info && SAV.GetSlotFlags(info.Box, info.Slot).IsOverwriteProtected())
|
||||
editor.AddSkipped();
|
||||
else if(!BatchEditing.IsFilterMatchMeta(filterMeta, entry))
|
||||
|
|
Loading…
Reference in a new issue