Minor clean

Remove unused usings from bag refactor
remove unnecessary suppression (resharper fixed the ConstantExpected trickle up)
fix gen6/7 timestamp previous offset (has been broken for 6.5 years) 1b028198ad (diff-7e597cadc592f504e9105ba631f99ef9e1fe27ea9becbe191c15c00daa3272f2L211)
This commit is contained in:
Kurt 2026-02-08 01:22:21 -06:00
parent dd1b55cb6a
commit 09d7fd9e31
16 changed files with 6 additions and 20 deletions

View File

@ -65,13 +65,11 @@ public static int GetLanguageIndex(string lang)
/// </summary>
public static string[] GetStrings(string ident, string lang, [ConstantExpected] string type = "text")
{
#pragma warning disable CA1857
string[] data = Util.GetStringList(ident, lang, type);
if (data.Length == 0)
data = Util.GetStringList(ident, DefaultLanguage, type);
return data;
#pragma warning restore CA1857
}
}

View File

@ -1,7 +1,6 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
#pragma warning disable CA1857
namespace PKHeX.Core;

View File

@ -4,7 +4,6 @@
using static PKHeX.Core.EncounterUtil;
using static PKHeX.Core.GameVersion;
using static PKHeX.Core.AbilityPermission;
#pragma warning disable CA1857
namespace PKHeX.Core;

View File

@ -436,7 +436,7 @@ public override PB8 ConvertToPKM(ITrainerInfo tr, EncounterCriteria criteria)
OriginalTrainerGender = OTGender < 2 ? OTGender : tr.Gender,
HandlingTrainerName = hasOT ? tr.OT : string.Empty,
HandlingTrainerGender = hasOT ? tr.Gender : default,
HandlingTrainerLanguage = (byte)(hasOT ? language : default),
HandlingTrainerLanguage = (byte)(hasOT ? language : 0),
CurrentHandler = hasOT ? (byte)1 : (byte)0,
OriginalTrainerFriendship = pi.BaseFriendship,

View File

@ -437,7 +437,7 @@ public override PK8 ConvertToPKM(ITrainerInfo tr, EncounterCriteria criteria)
OriginalTrainerGender = OTGender < 2 ? OTGender : tr.Gender,
HandlingTrainerName = hasOT ? tr.OT : string.Empty,
HandlingTrainerGender = hasOT ? tr.Gender : default,
HandlingTrainerLanguage = (byte)(hasOT ? language : default),
HandlingTrainerLanguage = (byte)(hasOT ? language : 0),
CurrentHandler = hasOT ? (byte)1 : (byte)0,
OriginalTrainerFriendship = pi.BaseFriendship,

View File

@ -2,7 +2,6 @@
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using static System.Buffers.Binary.BinaryPrimitives;
#pragma warning disable CA1857
namespace PKHeX.Core;

View File

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using static System.Buffers.Binary.BinaryPrimitives;
namespace PKHeX.Core;

View File

@ -1,6 +1,5 @@
using System;
using System.Buffers;
using System.Collections.Generic;
using static System.Buffers.Binary.BinaryPrimitives;
namespace PKHeX.Core;

View File

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using static System.Buffers.Binary.BinaryPrimitives;
namespace PKHeX.Core;

View File

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using static System.Buffers.Binary.BinaryPrimitives;

View File

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using static System.Buffers.Binary.BinaryPrimitives;
namespace PKHeX.Core;

View File

@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
#pragma warning disable CA1857
namespace PKHeX.Core;

View File

@ -3,7 +3,6 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using static System.Buffers.Binary.BinaryPrimitives;
#pragma warning disable CA1857
namespace PKHeX.Core;
@ -45,7 +44,7 @@ public ulong TimeStampCurrent
/// </summary>
public ulong TimeStampPrevious
{
get => ReadUInt64LittleEndian(Data[BlockInfoOffset..]);
set => WriteUInt64LittleEndian(Data[BlockInfoOffset..], value);
get => ReadUInt64LittleEndian(Data[(BlockInfoOffset + 8)..]);
set => WriteUInt64LittleEndian(Data[(BlockInfoOffset + 8)..], value);
}
}

View File

@ -2,7 +2,6 @@
using System.Collections.Concurrent;
using System.Diagnostics.CodeAnalysis;
using System.Resources;
#pragma warning disable CA1857
namespace PKHeX.Core;

View File

@ -517,7 +517,7 @@ private async void B_Search_Click(object sender, EventArgs e)
bool wordFilter = ParseSettings.Settings.WordFilter.CheckWordFilter;
if (wordFilter && legalSearch && WinFormsUtil.Prompt(MessageBoxButtons.YesNo, MsgDBSearchLegalityWordfilter) == DialogResult.No)
ParseSettings.Settings.WordFilter.CheckWordFilter = false;
var results = await Task.Run(() => search.ToList()).ConfigureAwait(true);
var results = await Task.Run(search.ToList).ConfigureAwait(true);
ParseSettings.Settings.WordFilter.CheckWordFilter = wordFilter;
if (results.Count == 0)

View File

@ -471,7 +471,7 @@ private async void B_Search_Click(object sender, EventArgs e)
return;
}
var results = await Task.Run(() => search.ToList(), token).ConfigureAwait(true);
var results = await Task.Run(search.ToList, token).ConfigureAwait(true);
if (token.IsCancellationRequested)
{
EncounterMovesetGenerator.ResetFilters();