From 8b08f263e51bfe06d1111c48a3939746121b60b2 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 8 Mar 2026 23:40:56 -0500 Subject: [PATCH] Minor tweaks Remove GameSync/SecureValue from SAV tab (still lives in Block Data) Remove inaccessible items from FRLG/E key items --- .../Editing/Bulk/Base/BatchEditingBase.cs | 6 +- .../Editing/Saves/BoxManip/BoxManipBase.cs | 13 +-- .../Editing/Saves/BoxManip/BoxManipClear.cs | 4 +- .../Saves/BoxManip/BoxManipClearComplex.cs | 4 +- .../Saves/BoxManip/BoxManipClearDuplicate.cs | 2 +- .../Editing/Saves/BoxManip/BoxManipModify.cs | 4 +- .../Saves/BoxManip/BoxManipModifyComplex.cs | 2 +- .../Editing/Saves/BoxManip/BoxManipSort.cs | 2 +- .../Saves/BoxManip/BoxManipSortComplex.cs | 4 +- PKHeX.Core/Items/ItemStorage3E.cs | 4 +- PKHeX.Core/Items/ItemStorage3FRLG.cs | 6 +- PKHeX.Core/Saves/SAV_BEEF.cs | 3 + .../Controls/EntitySearchControl.cs | 4 +- .../Controls/SAV Editor/SAVEditor.Designer.cs | 84 ------------------- .../Controls/SAV Editor/SAVEditor.cs | 48 +---------- PKHeX.WinForms/MainWindow/Main.cs | 2 +- PKHeX.WinForms/Resources/text/lang_de.txt | 3 - PKHeX.WinForms/Resources/text/lang_en.txt | 3 - PKHeX.WinForms/Resources/text/lang_es-419.txt | 3 - PKHeX.WinForms/Resources/text/lang_es.txt | 3 - PKHeX.WinForms/Resources/text/lang_fr.txt | 3 - PKHeX.WinForms/Resources/text/lang_it.txt | 3 - PKHeX.WinForms/Resources/text/lang_ja.txt | 3 - PKHeX.WinForms/Resources/text/lang_ko.txt | 3 - .../Resources/text/lang_zh-Hans.txt | 3 - .../Resources/text/lang_zh-Hant.txt | 3 - PKHeX.WinForms/Subforms/EntitySearchSetup.cs | 3 +- 27 files changed, 30 insertions(+), 195 deletions(-) diff --git a/PKHeX.Core/Editing/Bulk/Base/BatchEditingBase.cs b/PKHeX.Core/Editing/Bulk/Base/BatchEditingBase.cs index 728a22e8a..39031f146 100644 --- a/PKHeX.Core/Editing/Bulk/Base/BatchEditingBase.cs +++ b/PKHeX.Core/Editing/Bulk/Base/BatchEditingBase.cs @@ -205,10 +205,10 @@ public ModifyResult TryModify(TObject entity, IEnumerable fil return result; } - private static Dictionary.AlternateLookup>[] GetPropertyDictionaries(IReadOnlyList types, int expectedMax) + private static Dictionary.AlternateLookup>[] GetPropertyDictionaries(ReadOnlySpan types, int expectedMax) { - var result = new Dictionary.AlternateLookup>[types.Count]; - for (int i = 0; i < types.Count; i++) + var result = new Dictionary.AlternateLookup>[types.Length]; + for (int i = 0; i < types.Length; i++) result[i] = GetPropertyDictionary(types[i], ReflectUtil.GetAllPropertyInfoPublic, expectedMax).GetAlternateLookup>(); return result; } diff --git a/PKHeX.Core/Editing/Saves/BoxManip/BoxManipBase.cs b/PKHeX.Core/Editing/Saves/BoxManip/BoxManipBase.cs index 02f9ab73d..e6741ef78 100644 --- a/PKHeX.Core/Editing/Saves/BoxManip/BoxManipBase.cs +++ b/PKHeX.Core/Editing/Saves/BoxManip/BoxManipBase.cs @@ -1,21 +1,12 @@ -using System; +using System; namespace PKHeX.Core; /// /// Base class for defining a manipulation of box data. /// -public abstract class BoxManipBase : IBoxManip +public abstract record BoxManipBase(BoxManipType Type, Func Usable) : IBoxManip { - public BoxManipType Type { get; } - public Func Usable { get; } - - protected BoxManipBase(BoxManipType type, Func usable) - { - Type = type; - Usable = usable; - } - public abstract string GetPrompt(bool all); public abstract string GetFail(bool all); public abstract string GetSuccess(bool all); diff --git a/PKHeX.Core/Editing/Saves/BoxManip/BoxManipClear.cs b/PKHeX.Core/Editing/Saves/BoxManip/BoxManipClear.cs index 4539c7488..e439a26ef 100644 --- a/PKHeX.Core/Editing/Saves/BoxManip/BoxManipClear.cs +++ b/PKHeX.Core/Editing/Saves/BoxManip/BoxManipClear.cs @@ -5,7 +5,7 @@ namespace PKHeX.Core; /// /// Clears contents of boxes by deleting all that satisfy a criteria. /// -public sealed class BoxManipClear(BoxManipType Type, Func criteria, Func Usable) : BoxManipBase(Type, Usable) +public sealed record BoxManipClear(BoxManipType Type, Func Criteria, Func Usable) : BoxManipBase(Type, Usable) { public BoxManipClear(BoxManipType Type, Func Criteria) : this(Type, Criteria, _ => true) { } @@ -18,6 +18,6 @@ public override int Execute(SaveFile sav, BoxManipParam param) var (start, stop, reverse) = param; return sav.ClearBoxes(start, stop, Method); - bool Method(PKM p) => reverse ^ criteria(p); + bool Method(PKM p) => reverse ^ Criteria(p); } } diff --git a/PKHeX.Core/Editing/Saves/BoxManip/BoxManipClearComplex.cs b/PKHeX.Core/Editing/Saves/BoxManip/BoxManipClearComplex.cs index 370c057f2..ddff389cb 100644 --- a/PKHeX.Core/Editing/Saves/BoxManip/BoxManipClearComplex.cs +++ b/PKHeX.Core/Editing/Saves/BoxManip/BoxManipClearComplex.cs @@ -5,7 +5,7 @@ namespace PKHeX.Core; /// /// Clears contents of boxes by deleting all that satisfy a criteria based on a . /// -public sealed class BoxManipClearComplex(BoxManipType Type, Func criteria, Func Usable) : BoxManipBase(Type, Usable) +public sealed record BoxManipClearComplex(BoxManipType Type, Func Criteria, Func Usable) : BoxManipBase(Type, Usable) { public BoxManipClearComplex(BoxManipType Type, Func Criteria) : this(Type, Criteria, _ => true) { } @@ -18,6 +18,6 @@ public override int Execute(SaveFile sav, BoxManipParam param) var (start, stop, reverse) = param; return sav.ClearBoxes(start, stop, Method); - bool Method(PKM p) => reverse ^ criteria(p, sav); + bool Method(PKM p) => reverse ^ Criteria(p, sav); } } diff --git a/PKHeX.Core/Editing/Saves/BoxManip/BoxManipClearDuplicate.cs b/PKHeX.Core/Editing/Saves/BoxManip/BoxManipClearDuplicate.cs index 5817e21ed..78c0c2a03 100644 --- a/PKHeX.Core/Editing/Saves/BoxManip/BoxManipClearDuplicate.cs +++ b/PKHeX.Core/Editing/Saves/BoxManip/BoxManipClearDuplicate.cs @@ -7,7 +7,7 @@ namespace PKHeX.Core; /// Clears contents of boxes by deleting all but the first duplicate detected. /// /// Base type of the "is duplicate" hash for the duplicate detection. -public sealed class BoxManipClearDuplicate : BoxManipBase +public sealed record BoxManipClearDuplicate : BoxManipBase { private readonly HashSet HashSet = []; private readonly Func Criteria; diff --git a/PKHeX.Core/Editing/Saves/BoxManip/BoxManipModify.cs b/PKHeX.Core/Editing/Saves/BoxManip/BoxManipModify.cs index e725ed15e..47b147003 100644 --- a/PKHeX.Core/Editing/Saves/BoxManip/BoxManipModify.cs +++ b/PKHeX.Core/Editing/Saves/BoxManip/BoxManipModify.cs @@ -5,8 +5,8 @@ namespace PKHeX.Core; /// /// Modifies contents of boxes by using an to change data. /// -public sealed class BoxManipModify(BoxManipType type, Action Action, Func Usable) - : BoxManipBase(type, Usable) +public sealed record BoxManipModify(BoxManipType Type, Action Action, Func Usable) + : BoxManipBase(Type, Usable) { public BoxManipModify(BoxManipType type, Action Action) : this(type, Action, _ => true) { } diff --git a/PKHeX.Core/Editing/Saves/BoxManip/BoxManipModifyComplex.cs b/PKHeX.Core/Editing/Saves/BoxManip/BoxManipModifyComplex.cs index 7e4b2ad79..f33f897ef 100644 --- a/PKHeX.Core/Editing/Saves/BoxManip/BoxManipModifyComplex.cs +++ b/PKHeX.Core/Editing/Saves/BoxManip/BoxManipModifyComplex.cs @@ -5,7 +5,7 @@ namespace PKHeX.Core; /// /// Modifies contents of boxes by using an (referencing a Save File) to change data. /// -public sealed class BoxManipModifyComplex(BoxManipType Type, Action Action, Func Usable) +public sealed record BoxManipModifyComplex(BoxManipType Type, Action Action, Func Usable) : BoxManipBase(Type, Usable) { public BoxManipModifyComplex(BoxManipType Type, Action Action) : this(Type, Action, _ => true) { } diff --git a/PKHeX.Core/Editing/Saves/BoxManip/BoxManipSort.cs b/PKHeX.Core/Editing/Saves/BoxManip/BoxManipSort.cs index 5295d5cf2..007c46cda 100644 --- a/PKHeX.Core/Editing/Saves/BoxManip/BoxManipSort.cs +++ b/PKHeX.Core/Editing/Saves/BoxManip/BoxManipSort.cs @@ -6,7 +6,7 @@ namespace PKHeX.Core; /// /// Sorts contents of boxes by using a Sorter to determine the order. /// -public sealed class BoxManipSort(BoxManipType Type, Func, IEnumerable> Sorter, Func Usable) : BoxManipBase(Type, Usable) +public sealed record BoxManipSort(BoxManipType Type, Func, IEnumerable> Sorter, Func Usable) : BoxManipBase(Type, Usable) { public BoxManipSort(BoxManipType Type, Func, IEnumerable> Sorter) : this(Type, Sorter, _ => true) { } diff --git a/PKHeX.Core/Editing/Saves/BoxManip/BoxManipSortComplex.cs b/PKHeX.Core/Editing/Saves/BoxManip/BoxManipSortComplex.cs index b1050a6aa..8166703e4 100644 --- a/PKHeX.Core/Editing/Saves/BoxManip/BoxManipSortComplex.cs +++ b/PKHeX.Core/Editing/Saves/BoxManip/BoxManipSortComplex.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; namespace PKHeX.Core; @@ -6,7 +6,7 @@ namespace PKHeX.Core; /// /// Sorts contents of boxes by using a (referencing a Save File) to determine the order. /// -public sealed class BoxManipSortComplex : BoxManipBase +public sealed record BoxManipSortComplex : BoxManipBase { private readonly Func, SaveFile, int, IEnumerable> Sorter; public BoxManipSortComplex(BoxManipType type, Func, SaveFile, IEnumerable> sorter) : this(type, sorter, _ => true) { } diff --git a/PKHeX.Core/Items/ItemStorage3E.cs b/PKHeX.Core/Items/ItemStorage3E.cs index 8ef732ea5..665de9807 100644 --- a/PKHeX.Core/Items/ItemStorage3E.cs +++ b/PKHeX.Core/Items/ItemStorage3E.cs @@ -13,9 +13,9 @@ public sealed class ItemStorage3E : IItemStorage public static ReadOnlySpan Key => [ // R/S - 259, 260, 261, 262, 263, 264, 265, 266, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 259, 260, 261, 262, 263, 264, 265, 266, 268, 269, 270, 271, 272, 273, 274, 275, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, // FR/LG - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 372, // E 375, 376, ]; diff --git a/PKHeX.Core/Items/ItemStorage3FRLG.cs b/PKHeX.Core/Items/ItemStorage3FRLG.cs index 52924360b..114d05929 100644 --- a/PKHeX.Core/Items/ItemStorage3FRLG.cs +++ b/PKHeX.Core/Items/ItemStorage3FRLG.cs @@ -13,7 +13,7 @@ public sealed class ItemStorage3FRLG : IItemStorage public static ReadOnlySpan Key => [ // R/S - 259, 260, 261, 262, 263, 264, 265, 266, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 260, 261, 262, 263, 264, 265, // FR/LG 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, ]; @@ -55,7 +55,7 @@ public sealed class ItemStorage3FRLG_VC : IItemStorage // TODO VC RSE: delete me // Unobtainable 044, // Berry Juice - + // TODO RSE VC: Remove these 046, 047, // Shoal Salt, Shoal Shell 048, 049, 050, 051, // Shards @@ -71,7 +71,7 @@ public sealed class ItemStorage3FRLG_VC : IItemStorage // TODO VC RSE: delete me 173, // Lansat Berry (Event) 174, // Starf Berry (Event) 175, // Enigma Berry (Event) - + // TODO RSE VC: Remove these 179, // BrightPowder 180, // White Herb diff --git a/PKHeX.Core/Saves/SAV_BEEF.cs b/PKHeX.Core/Saves/SAV_BEEF.cs index 6038d8bb0..bde4a9a3a 100644 --- a/PKHeX.Core/Saves/SAV_BEEF.cs +++ b/PKHeX.Core/Saves/SAV_BEEF.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq; using static System.Buffers.Binary.BinaryPrimitives; @@ -33,6 +34,7 @@ protected SAV_BEEF([ConstantExpected] int size, [ConstantExpected] int biOffset) /// /// Timestamp that the save file was last saved at (Secure Value) /// + [TypeConverter(typeof(TypeConverterU64))] public ulong TimeStampCurrent { get => ReadUInt64LittleEndian(Data[BlockInfoOffset..]); @@ -42,6 +44,7 @@ public ulong TimeStampCurrent /// /// Timestamp that the save file was saved at prior to the (Secure Value) /// + [TypeConverter(typeof(TypeConverterU64))] public ulong TimeStampPrevious { get => ReadUInt64LittleEndian(Data[(BlockInfoOffset + 8)..]); diff --git a/PKHeX.WinForms/Controls/EntitySearchControl.cs b/PKHeX.WinForms/Controls/EntitySearchControl.cs index 95231bbb4..7ce092587 100644 --- a/PKHeX.WinForms/Controls/EntitySearchControl.cs +++ b/PKHeX.WinForms/Controls/EntitySearchControl.cs @@ -11,7 +11,7 @@ namespace PKHeX.WinForms.Controls; public partial class EntitySearchControl : UserControl { private EntityContext SaveContext { get; set; } = Latest.Context; - + public EntitySearchControl() => InitializeComponent(); /// @@ -107,7 +107,7 @@ public void InitializeSelections(SaveFile sav, bool showContext = true) } L_Format.Visible = CB_FormatComparator.Visible = CB_Format.Visible = showContext; } - + /// /// Sets the localized text for the format "Any" option. /// diff --git a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.Designer.cs b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.Designer.cs index d7ee2243c..82c530ba8 100644 --- a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.Designer.cs +++ b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.Designer.cs @@ -111,12 +111,6 @@ private void InitializeComponent() B_ConvertKorean = new System.Windows.Forms.Button(); CB_SaveSlot = new System.Windows.Forms.ComboBox(); L_SaveSlot = new System.Windows.Forms.Label(); - L_Secure2 = new System.Windows.Forms.Label(); - TB_Secure2 = new System.Windows.Forms.TextBox(); - L_Secure1 = new System.Windows.Forms.Label(); - TB_Secure1 = new System.Windows.Forms.TextBox(); - L_GameSync = new System.Windows.Forms.Label(); - TB_GameSync = new System.Windows.Forms.TextBox(); tabBoxMulti.SuspendLayout(); Tab_Box.SuspendLayout(); PopoutMenu.SuspendLayout(); @@ -410,12 +404,6 @@ private void InitializeComponent() Tab_SAV.Controls.Add(FLP_SAVToolsMisc); Tab_SAV.Controls.Add(CB_SaveSlot); Tab_SAV.Controls.Add(L_SaveSlot); - Tab_SAV.Controls.Add(L_Secure2); - Tab_SAV.Controls.Add(TB_Secure2); - Tab_SAV.Controls.Add(L_Secure1); - Tab_SAV.Controls.Add(TB_Secure1); - Tab_SAV.Controls.Add(L_GameSync); - Tab_SAV.Controls.Add(TB_GameSync); Tab_SAV.Location = new System.Drawing.Point(4, 26); Tab_SAV.Name = "Tab_SAV"; Tab_SAV.Size = new System.Drawing.Size(441, 333); @@ -1040,72 +1028,6 @@ private void InitializeComponent() L_SaveSlot.Text = "Save Slot:"; L_SaveSlot.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // - // L_Secure2 - // - L_Secure2.Location = new System.Drawing.Point(32, 112); - L_Secure2.Name = "L_Secure2"; - L_Secure2.Size = new System.Drawing.Size(120, 24); - L_Secure2.TabIndex = 18; - L_Secure2.Text = "Secure Value 2:"; - L_Secure2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // TB_Secure2 - // - TB_Secure2.Enabled = false; - TB_Secure2.Font = new System.Drawing.Font("Courier New", 8.25F); - TB_Secure2.Location = new System.Drawing.Point(152, 112); - TB_Secure2.MaxLength = 16; - TB_Secure2.MinimumSize = new System.Drawing.Size(120, 24); - TB_Secure2.Name = "TB_Secure2"; - TB_Secure2.PlaceholderText = "0000000000000000"; - TB_Secure2.Size = new System.Drawing.Size(120, 24); - TB_Secure2.TabIndex = 17; - TB_Secure2.Validated += UpdateStringSeed; - // - // L_Secure1 - // - L_Secure1.Location = new System.Drawing.Point(32, 88); - L_Secure1.Name = "L_Secure1"; - L_Secure1.Size = new System.Drawing.Size(120, 24); - L_Secure1.TabIndex = 16; - L_Secure1.Text = "Secure Value 1:"; - L_Secure1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // TB_Secure1 - // - TB_Secure1.Enabled = false; - TB_Secure1.Font = new System.Drawing.Font("Courier New", 8.25F); - TB_Secure1.Location = new System.Drawing.Point(152, 88); - TB_Secure1.MaxLength = 16; - TB_Secure1.MinimumSize = new System.Drawing.Size(120, 24); - TB_Secure1.Name = "TB_Secure1"; - TB_Secure1.PlaceholderText = "0000000000000000"; - TB_Secure1.Size = new System.Drawing.Size(120, 24); - TB_Secure1.TabIndex = 15; - TB_Secure1.Validated += UpdateStringSeed; - // - // L_GameSync - // - L_GameSync.Location = new System.Drawing.Point(32, 64); - L_GameSync.Name = "L_GameSync"; - L_GameSync.Size = new System.Drawing.Size(120, 24); - L_GameSync.TabIndex = 11; - L_GameSync.Text = "Game Sync ID:"; - L_GameSync.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // TB_GameSync - // - TB_GameSync.Enabled = false; - TB_GameSync.Font = new System.Drawing.Font("Courier New", 8.25F); - TB_GameSync.Location = new System.Drawing.Point(152, 64); - TB_GameSync.MaxLength = 16; - TB_GameSync.MinimumSize = new System.Drawing.Size(120, 24); - TB_GameSync.Name = "TB_GameSync"; - TB_GameSync.PlaceholderText = "0000000000000000"; - TB_GameSync.Size = new System.Drawing.Size(120, 24); - TB_GameSync.TabIndex = 10; - TB_GameSync.Validated += UpdateStringSeed; - // // SAVEditor // AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; @@ -1152,13 +1074,7 @@ private void InitializeComponent() private System.Windows.Forms.TabPage Tab_SAV; private System.Windows.Forms.ComboBox CB_SaveSlot; private System.Windows.Forms.Label L_SaveSlot; - private System.Windows.Forms.Label L_Secure2; - private System.Windows.Forms.TextBox TB_Secure2; - private System.Windows.Forms.Label L_Secure1; - private System.Windows.Forms.TextBox TB_Secure1; private System.Windows.Forms.Button B_JPEG; - private System.Windows.Forms.Label L_GameSync; - private System.Windows.Forms.TextBox TB_GameSync; private System.Windows.Forms.Button B_SaveBoxBin; private System.Windows.Forms.Button B_VerifyCHK; private System.Windows.Forms.FlowLayoutPanel FLP_SAVtools; diff --git a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs index 609e56d71..69dcad124 100644 --- a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs +++ b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs @@ -38,12 +38,6 @@ public void SetEditEnvironment(SaveDataEditor value) public bool HaX; public bool ModifyPKM { private get; set; } - public bool HideSecretDetails - { - private get; - set => ToggleSecrets(SAV, field = value); - } - public ToolStripMenuItem Menu_Redo { get; set; } = null!; public ToolStripMenuItem Menu_Undo { get; set; } = null!; private bool FieldsLoaded; @@ -511,8 +505,7 @@ private void OpenBoxViewer() z.BringToFront(); return; } - var form = new SAV_BoxViewer(this, M, Box.CurrentBox); - form.Owner = FindForm(); + var form = new SAV_BoxViewer(this, M, Box.CurrentBox) { Owner = FindForm() }; form.Show(); } @@ -579,21 +572,6 @@ private void UpdateStringSeed(object sender, EventArgs e) if (GetCurrentDaycare() is { } s) SetDaycareSeed(s, filterText); } - else if (tb == TB_GameSync && SAV is IGameSync sync) - { - var value = filterText.PadLeft(sync.GameSyncIDSize, '0'); - sync.GameSyncID = value; - SAV.State.Edited = true; - } - else if (SAV is ISecureValueStorage s) - { - var value = Convert.ToUInt64(filterText, 16); - if (tb == TB_Secure1) - s.TimeStampCurrent = value; - else if (tb == TB_Secure2) - s.TimeStampPrevious = value; - SAV.State.Edited = true; - } } private void SetDaycareSeed(IDaycareStorage daycare, string filterText) @@ -1357,7 +1335,6 @@ private void ToggleViewSubEditors(SaveFile sav) private void ToggleViewMisc(SaveFile sav) { // Generational Interface - ToggleSecrets(sav, HideSecretDetails); B_VerifyCHK.Visible = SAV.State.Exportable; Menu_ExportBAK.Visible = SAV.State.Exportable && SAV.Metadata.FilePath is not null; @@ -1374,27 +1351,6 @@ private void ToggleViewMisc(SaveFile sav) { L_SaveSlot.Visible = CB_SaveSlot.Visible = false; } - - if (sav is ISecureValueStorage s) - { - TB_Secure1.Text = s.TimeStampCurrent.ToString("X16"); - TB_Secure2.Text = s.TimeStampPrevious.ToString("X16"); - } - - if (sav is IGameSync sync) - { - var gsid = sync.GameSyncID; - TB_GameSync.Enabled = !string.IsNullOrEmpty(gsid); - TB_GameSync.MaxLength = sync.GameSyncIDSize; - TB_GameSync.Text = (string.IsNullOrEmpty(gsid) ? 0.ToString() : gsid).PadLeft(sync.GameSyncIDSize, '0'); - } - } - - private void ToggleSecrets(SaveFile sav, bool hide) - { - var shouldShow = sav.State.Exportable && !hide; - TB_Secure1.Visible = TB_Secure2.Visible = L_Secure1.Visible = L_Secure2.Visible = shouldShow && sav is ISecureValueStorage; - TB_GameSync.Visible = L_GameSync.Visible = shouldShow && sav is IGameSync; } // DragDrop @@ -1615,7 +1571,7 @@ private void B_SearchBox_Click(object sender, EventArgs e) return; } } - if (_searchForm is null || !_searchForm.IsSameSaveFile(SAV)) + if (_searchForm?.IsSameSaveFile(SAV) != true) _searchForm = CreateSearcher(SAV, EditEnv.PKMEditor); // Set the searcher Position immediately to the right of this parent form, and vertically aligned tops of forms. diff --git a/PKHeX.WinForms/MainWindow/Main.cs b/PKHeX.WinForms/MainWindow/Main.cs index 19433488a..f0b489897 100644 --- a/PKHeX.WinForms/MainWindow/Main.cs +++ b/PKHeX.WinForms/MainWindow/Main.cs @@ -362,7 +362,7 @@ private void ReloadProgramSettings(PKHeXSettings settings, bool skipCore = false C_SAV.ModifyPKM = PKME_Tabs.ModifyPKM = settings.SlotWrite.SetUpdatePKM; C_SAV.FlagIllegal = settings.Display.FlagIllegal; C_SAV.M.Hover.GlowHover = settings.Hover.HoverSlotGlowEdges; - PKME_Tabs.HideSecretValues = C_SAV.HideSecretDetails = settings.Privacy.HideSecretDetails; + PKME_Tabs.HideSecretValues = settings.Privacy.HideSecretDetails; WinFormsUtil.DetectSaveFileOnFileOpen = settings.Startup.TryDetectRecentSave; SelectablePictureBox.FocusBorderDeflate = GenderToggle.FocusBorderDeflate = settings.Display.FocusBorderDeflate; diff --git a/PKHeX.WinForms/Resources/text/lang_de.txt b/PKHeX.WinForms/Resources/text/lang_de.txt index 641201ed6..3165aebf5 100644 --- a/PKHeX.WinForms/Resources/text/lang_de.txt +++ b/PKHeX.WinForms/Resources/text/lang_de.txt @@ -471,7 +471,6 @@ Main.L_DC2=2: Main.L_DynamaxLevel=Dynamax Level: Main.L_ExtraBytes=Extra Bytes: Main.L_FormArgument=Form Argument: -Main.L_GameSync=Spielsynchro ID: Main.L_HeartGauge=Crypto-Meter: Main.L_Height=Höhe: Main.L_HomeTracker=HOME Tracker: @@ -485,8 +484,6 @@ Main.L_PokeStarFame=Fame: Main.L_ReadOnlyOther=Dieser Tab ist nur lesbar. Main.L_SaveSlot=Speicher Slot: Main.L_Scale=Scale: -Main.L_Secure1=Secure Value 1: -Main.L_Secure2=Secure Value 2: Main.L_ShadowID=Crypto ID: Main.L_Spirit7b=Spirit: Main.L_TeraTypeOriginal=Original Tera Typ: diff --git a/PKHeX.WinForms/Resources/text/lang_en.txt b/PKHeX.WinForms/Resources/text/lang_en.txt index 98e153d80..149d36f17 100644 --- a/PKHeX.WinForms/Resources/text/lang_en.txt +++ b/PKHeX.WinForms/Resources/text/lang_en.txt @@ -471,7 +471,6 @@ Main.L_DC2=2: Main.L_DynamaxLevel=Dynamax Level: Main.L_ExtraBytes=Extra Bytes: Main.L_FormArgument=Form Argument: -Main.L_GameSync=Game Sync ID: Main.L_HeartGauge=Heart Gauge: Main.L_Height=Height: Main.L_HomeTracker=HOME Tracker: @@ -485,8 +484,6 @@ Main.L_PokeStarFame=Fame: Main.L_ReadOnlyOther=This tab is read only. Main.L_SaveSlot=Save Slot: Main.L_Scale=Scale: -Main.L_Secure1=Secure Value 1: -Main.L_Secure2=Secure Value 2: Main.L_ShadowID=Shadow ID: Main.L_Spirit7b=Spirit: Main.L_TeraTypeOriginal=Original Tera Type: diff --git a/PKHeX.WinForms/Resources/text/lang_es-419.txt b/PKHeX.WinForms/Resources/text/lang_es-419.txt index 09b254a0d..c06e0e21d 100644 --- a/PKHeX.WinForms/Resources/text/lang_es-419.txt +++ b/PKHeX.WinForms/Resources/text/lang_es-419.txt @@ -471,7 +471,6 @@ Main.L_DC2=2: Main.L_DynamaxLevel=Nivel Dinamax: Main.L_ExtraBytes=Bytes extras: Main.L_FormArgument=Forma: -Main.L_GameSync=ID de Sincronización: Main.L_HeartGauge=Medidor de Corazón: Main.L_Height=Altura: Main.L_HomeTracker=Rastreador HOME: @@ -485,8 +484,6 @@ Main.L_PokeStarFame=Fame: Main.L_ReadOnlyOther=Sólo lectura. Main.L_SaveSlot=Ranura de guardado: Main.L_Scale=Escala: -Main.L_Secure1=Valor seguro 1: -Main.L_Secure2=Valor seguro 2: Main.L_ShadowID=ID Oscuro: Main.L_Spirit7b=Spirit: Main.L_TeraTypeOriginal=Teratipo original: diff --git a/PKHeX.WinForms/Resources/text/lang_es.txt b/PKHeX.WinForms/Resources/text/lang_es.txt index 4b08bf633..9f4d9ca35 100644 --- a/PKHeX.WinForms/Resources/text/lang_es.txt +++ b/PKHeX.WinForms/Resources/text/lang_es.txt @@ -471,7 +471,6 @@ Main.L_DC2=2: Main.L_DynamaxLevel=Nivel Dinamax: Main.L_ExtraBytes=Bytes extras: Main.L_FormArgument=Forma: -Main.L_GameSync=ID de Sincronización: Main.L_HeartGauge=Medidor de Corazón: Main.L_Height=Altura: Main.L_HomeTracker=Rastreador HOME: @@ -485,8 +484,6 @@ Main.L_PokeStarFame=Salón: Main.L_ReadOnlyOther=Sólo lectura. Main.L_SaveSlot=Ranura de guardado: Main.L_Scale=Escala: -Main.L_Secure1=Valor seguro 1: -Main.L_Secure2=Valor seguro 2: Main.L_ShadowID=ID Oscuro: Main.L_Spirit7b=Espíritu: Main.L_TeraTypeOriginal=Teratipo original: diff --git a/PKHeX.WinForms/Resources/text/lang_fr.txt b/PKHeX.WinForms/Resources/text/lang_fr.txt index 58415a1cb..6cdf1c9cf 100644 --- a/PKHeX.WinForms/Resources/text/lang_fr.txt +++ b/PKHeX.WinForms/Resources/text/lang_fr.txt @@ -471,7 +471,6 @@ Main.L_DC2=2 : Main.L_DynamaxLevel=Niveau Dynamax : Main.L_ExtraBytes=Octets supplé. : Main.L_FormArgument=Argument de forme : -Main.L_GameSync=ID de synchronisation de jeu : Main.L_HeartGauge=Jauge cœur : Main.L_Height=Taille : Main.L_HomeTracker=Tracker HOME : @@ -485,8 +484,6 @@ Main.L_PokeStarFame=Prestige : Main.L_ReadOnlyOther=Cet onglet est en lecture seule. Main.L_SaveSlot=Sauvegarde : Main.L_Scale=Échelle : -Main.L_Secure1=Valeur sécurité 1 : -Main.L_Secure2=Valeur sécurité 2 : Main.L_ShadowID=ID Obscur : Main.L_Spirit7b=Esprit : Main.L_TeraTypeOriginal=Type Téra d'origine : diff --git a/PKHeX.WinForms/Resources/text/lang_it.txt b/PKHeX.WinForms/Resources/text/lang_it.txt index 696d45c18..45fd1e88d 100644 --- a/PKHeX.WinForms/Resources/text/lang_it.txt +++ b/PKHeX.WinForms/Resources/text/lang_it.txt @@ -471,7 +471,6 @@ Main.L_DC2=2: Main.L_DynamaxLevel=Livello Dynamax: Main.L_ExtraBytes=Byte Extra: Main.L_FormArgument=Form Argument: -Main.L_GameSync=Game Sync ID: Main.L_HeartGauge=Cuore: Main.L_Height=Altezza: Main.L_HomeTracker=Monitoraggio HOME: @@ -485,8 +484,6 @@ Main.L_PokeStarFame=Fame: Main.L_ReadOnlyOther=Questa sezione è di sola lettura. Main.L_SaveSlot=Slot Salvataggio: Main.L_Scale=Scala: -Main.L_Secure1=Secure Value 1: -Main.L_Secure2=Secure Value 2: Main.L_ShadowID=ID Ombra: Main.L_Spirit7b=Spirit: Main.L_TeraTypeOriginal=Teratipo originale: diff --git a/PKHeX.WinForms/Resources/text/lang_ja.txt b/PKHeX.WinForms/Resources/text/lang_ja.txt index c34838ae8..a7c8317e3 100644 --- a/PKHeX.WinForms/Resources/text/lang_ja.txt +++ b/PKHeX.WinForms/Resources/text/lang_ja.txt @@ -471,7 +471,6 @@ Main.L_DC2=2: Main.L_DynamaxLevel=ダイマックスレベル: Main.L_ExtraBytes=追加バイト Main.L_FormArgument=フォルム変数 -Main.L_GameSync=ゲームシンク ID: Main.L_HeartGauge=リライブゲージ Main.L_Height=高さ Main.L_HomeTracker=HOME Tracker @@ -485,8 +484,6 @@ Main.L_PokeStarFame=Fame: Main.L_ReadOnlyOther=このタブは読み取り専用です Main.L_SaveSlot=セーブスロット: Main.L_Scale=サイズ -Main.L_Secure1=Secure Value 1: -Main.L_Secure2=Secure Value 2: Main.L_ShadowID=ダークポケモンID Main.L_Spirit7b=Spirit: Main.L_TeraTypeOriginal=元のテラスタイプ diff --git a/PKHeX.WinForms/Resources/text/lang_ko.txt b/PKHeX.WinForms/Resources/text/lang_ko.txt index 7bd081368..a63d68d04 100644 --- a/PKHeX.WinForms/Resources/text/lang_ko.txt +++ b/PKHeX.WinForms/Resources/text/lang_ko.txt @@ -471,7 +471,6 @@ Main.L_DC2=2: Main.L_DynamaxLevel=다이맥스 레벨: Main.L_ExtraBytes=추가 바이트: Main.L_FormArgument=Form Argument: -Main.L_GameSync=게임싱크 ID: Main.L_HeartGauge=배부름 게이지: Main.L_Height=키: Main.L_HomeTracker=HOME Tracker: @@ -485,8 +484,6 @@ Main.L_PokeStarFame=Fame: Main.L_ReadOnlyOther=이 탭은 읽기 전용입니다. Main.L_SaveSlot=세이브 슬롯: Main.L_Scale=Scale: -Main.L_Secure1=보안 값 1: -Main.L_Secure2=보안 값 2: Main.L_ShadowID=다크 ID: Main.L_Spirit7b=Spirit: Main.L_TeraTypeOriginal=Original Tera Type: diff --git a/PKHeX.WinForms/Resources/text/lang_zh-Hans.txt b/PKHeX.WinForms/Resources/text/lang_zh-Hans.txt index c851d67e2..188af222a 100644 --- a/PKHeX.WinForms/Resources/text/lang_zh-Hans.txt +++ b/PKHeX.WinForms/Resources/text/lang_zh-Hans.txt @@ -471,7 +471,6 @@ Main.L_DC2=2: Main.L_DynamaxLevel=极巨等级: Main.L_ExtraBytes=额外字节: Main.L_FormArgument=形态参数: -Main.L_GameSync=游戏同步ID: Main.L_HeartGauge=净化计: Main.L_Height=身高: Main.L_HomeTracker=HOME追踪: @@ -485,8 +484,6 @@ Main.L_PokeStarFame=名声: Main.L_ReadOnlyOther=此选项卡不可编辑。 Main.L_SaveSlot=存档槽: Main.L_Scale=大小: -Main.L_Secure1=安全值 1: -Main.L_Secure2=安全值 2: Main.L_ShadowID=黑暗ID: Main.L_Spirit7b=心情: Main.L_TeraTypeOriginal=原始太晶属性: diff --git a/PKHeX.WinForms/Resources/text/lang_zh-Hant.txt b/PKHeX.WinForms/Resources/text/lang_zh-Hant.txt index b31320e80..91f30b54a 100644 --- a/PKHeX.WinForms/Resources/text/lang_zh-Hant.txt +++ b/PKHeX.WinForms/Resources/text/lang_zh-Hant.txt @@ -471,7 +471,6 @@ Main.L_DC2=2: Main.L_DynamaxLevel=極巨化等級: Main.L_ExtraBytes=額外位元組: Main.L_FormArgument=形態參數: -Main.L_GameSync=遊戲同步ID: Main.L_HeartGauge=心靈計: Main.L_Height=身高: Main.L_HomeTracker=HOME追蹤碼: @@ -485,8 +484,6 @@ Main.L_PokeStarFame=Fame: Main.L_ReadOnlyOther=此選項卡不可編輯。 Main.L_SaveSlot=儲存資料槽: Main.L_Scale=尺寸: -Main.L_Secure1=安保值 1: -Main.L_Secure2=安保值 2: Main.L_ShadowID=黑暗ID: Main.L_Spirit7b=Spirit: Main.L_TeraTypeOriginal=原始太晶屬性: diff --git a/PKHeX.WinForms/Subforms/EntitySearchSetup.cs b/PKHeX.WinForms/Subforms/EntitySearchSetup.cs index 1e8bc150f..4318dde56 100644 --- a/PKHeX.WinForms/Subforms/EntitySearchSetup.cs +++ b/PKHeX.WinForms/Subforms/EntitySearchSetup.cs @@ -84,7 +84,6 @@ protected override void OnFormClosing(FormClosingEventArgs e) Hide(); return; } - CurrentSave = null; SearchFilter = null; base.OnFormClosing(e); } @@ -137,7 +136,7 @@ private void B_Add_Click(object? sender, EventArgs e) tb.AppendText(s); } - public bool IsSameSaveFile(SaveFile sav) => CurrentSave is not null && CurrentSave == sav; + public bool IsSameSaveFile(SaveFile sav) => CurrentSave == sav; public void ForceReset() {