From bdf3c09c2a597bc94271f488fda2992b75c1d3ca Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 27 Oct 2025 23:33:09 -0500 Subject: [PATCH] Relabel some EventWork blocks, increase size --- .../Saves/Access/SaveBlockAccessor9ZA.cs | 18 +- .../Gen9/SAV_FlagWork9a.Designer.cs | 162 +++++++++--------- .../Save Editors/Gen9/SAV_FlagWork9a.cs | 24 +-- 3 files changed, 103 insertions(+), 101 deletions(-) diff --git a/PKHeX.Core/Saves/Access/SaveBlockAccessor9ZA.cs b/PKHeX.Core/Saves/Access/SaveBlockAccessor9ZA.cs index 9db9c9ad6..a1be50f51 100644 --- a/PKHeX.Core/Saves/Access/SaveBlockAccessor9ZA.cs +++ b/PKHeX.Core/Saves/Access/SaveBlockAccessor9ZA.cs @@ -27,12 +27,12 @@ public sealed class SaveBlockAccessor9ZA(SAV9ZA sav) : SCBlockAccessor public PlayerFashion9a PlayerFashion { get; } = new(sav, Block(sav, KCurrentClothing)); public EventWorkFlagStorage Event { get; } = new(sav, Block(sav, KEventFlag)); - public EventWorkValueStorage Quest { get; } = new(sav, Block(sav, KEventWorkQuest)); - public EventWorkValueStorage Mable { get; } = new(sav, Block(sav, KEventWorkMable)); public EventWorkValueStorage Work { get; } = new(sav, Block(sav, KEventWork)); + public EventWorkValueStorage Quest { get; } = new(sav, Block(sav, KEventWorkQuest)); + public EventWorkValueStorage WorkMable { get; } = new(sav, Block(sav, KEventWorkMable)); + public EventWorkValueStorage CountMable { get; } = new(sav, Block(sav, KEventCountMable)); public EventWorkValueStorage Work1 { get; } = new(sav, Block(sav, KEventWork1)); - public EventWorkValueStorage Work2 { get; } = new(sav, Block(sav, KEventWork2)); - public EventWorkValueStorage Work3 { get; } = new(sav, Block(sav, KEventWork3)); + public EventWorkValueStorage WorkSpawn { get; } = new(sav, Block(sav, KEventWorkSpawn)); public EventWorkFlagStorage Flags { get; } = new(sav, Block(sav, KEventFlagsOther)); private const uint KBox = 0x0d66012c; // Box Data @@ -55,12 +55,14 @@ public sealed class SaveBlockAccessor9ZA(SAV9ZA sav) : SCBlockAccessor private const uint KEventFlag = 0x58505C5E; // event_flag (u64,bool)[2048] private const uint KEventFlagsOther = 0xED6F46E7; // system_flag (u64,bool)[2048] - private const uint KEventWorkQuest = 0xB9B223B9; // quest_work (u64,u64)[1024] private const uint KEventWork = 0xFADA7742; // system_work (u64,u64)[256] + + private const uint KEventWorkQuest = 0xB9B223B9; // quest_work (u64,u64)[1024] - Story Quest Status + private const uint KEventWorkMable = 0x03913534; // momiji_work (u64,u64)[1024] - Mable Tasks Status + private const uint KEventCountMable = 0x8D80EC0F; // momiji_count (u64,u64)[64] - Mable Tasks Counts + private const uint KEventWork1 = 0x2C2C6964; // object 0x400 records? (u64,u64)[64] - private const uint KEventWork2 = 0x8D80EC0F; // object 0x400 records? (u64,u64)[64] - private const uint KEventWorkMable = 0x03913534; // object 0x4000 work-like - private const uint KEventWork3 = 0x53FD0223; // object 0x46500 small values (u64,u64)[18000] + private const uint KEventWorkSpawn = 0x53FD0223; // object 0x46500 small values (u64,u64)[18000] // 7C896A83 0x2000 unused // B25E7EE5 0x400 unused // AF2165F0 0x3000 (u64,u64,value) diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen9/SAV_FlagWork9a.Designer.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen9/SAV_FlagWork9a.Designer.cs index 024d5778a..1d767a9d2 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen9/SAV_FlagWork9a.Designer.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen9/SAV_FlagWork9a.Designer.cs @@ -32,25 +32,25 @@ private void InitializeComponent() B_Save = new System.Windows.Forms.Button(); L_EventFlagWarn = new System.Windows.Forms.Label(); GB_Research = new System.Windows.Forms.TabPage(); - RTB_Diff = new System.Windows.Forms.RichTextBox(); - TB_NewSAV = new System.Windows.Forms.TextBox(); - B_LoadOld = new System.Windows.Forms.Button(); - TB_OldSAV = new System.Windows.Forms.TextBox(); - B_LoadNew = new System.Windows.Forms.Button(); - TC_Features = new System.Windows.Forms.TabControl(); splitContainer1 = new System.Windows.Forms.SplitContainer(); + B_LoadOld = new System.Windows.Forms.Button(); + TB_NewSAV = new System.Windows.Forms.TextBox(); + B_LoadNew = new System.Windows.Forms.Button(); + TB_OldSAV = new System.Windows.Forms.TextBox(); + RTB_Diff = new System.Windows.Forms.RichTextBox(); + TC_Features = new System.Windows.Forms.TabControl(); GB_Research.SuspendLayout(); - TC_Features.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit(); splitContainer1.Panel1.SuspendLayout(); splitContainer1.Panel2.SuspendLayout(); splitContainer1.SuspendLayout(); + TC_Features.SuspendLayout(); SuspendLayout(); // // B_Cancel // B_Cancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; - B_Cancel.Location = new System.Drawing.Point(346, 397); + B_Cancel.Location = new System.Drawing.Point(427, 401); B_Cancel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); B_Cancel.Name = "B_Cancel"; B_Cancel.Size = new System.Drawing.Size(88, 27); @@ -62,7 +62,7 @@ private void InitializeComponent() // B_Save // B_Save.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; - B_Save.Location = new System.Drawing.Point(442, 397); + B_Save.Location = new System.Drawing.Point(523, 401); B_Save.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); B_Save.Name = "B_Save"; B_Save.Size = new System.Drawing.Size(88, 27); @@ -75,7 +75,7 @@ private void InitializeComponent() // L_EventFlagWarn.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; L_EventFlagWarn.ForeColor = System.Drawing.Color.Red; - L_EventFlagWarn.Location = new System.Drawing.Point(13, 392); + L_EventFlagWarn.Location = new System.Drawing.Point(13, 396); L_EventFlagWarn.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); L_EventFlagWarn.Name = "L_EventFlagWarn"; L_EventFlagWarn.Size = new System.Drawing.Size(306, 36); @@ -90,77 +90,11 @@ private void InitializeComponent() GB_Research.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); GB_Research.Name = "GB_Research"; GB_Research.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); - GB_Research.Size = new System.Drawing.Size(517, 347); + GB_Research.Size = new System.Drawing.Size(598, 351); GB_Research.TabIndex = 2; GB_Research.Text = "Research"; GB_Research.UseVisualStyleBackColor = true; // - // RTB_Diff - // - RTB_Diff.Dock = System.Windows.Forms.DockStyle.Fill; - RTB_Diff.Location = new System.Drawing.Point(0, 0); - RTB_Diff.Margin = new System.Windows.Forms.Padding(0); - RTB_Diff.Name = "RTB_Diff"; - RTB_Diff.ReadOnly = true; - RTB_Diff.Size = new System.Drawing.Size(509, 277); - RTB_Diff.TabIndex = 6; - RTB_Diff.Text = ""; - // - // TB_NewSAV - // - TB_NewSAV.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; - TB_NewSAV.Location = new System.Drawing.Point(98, 35); - TB_NewSAV.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - TB_NewSAV.Name = "TB_NewSAV"; - TB_NewSAV.ReadOnly = true; - TB_NewSAV.Size = new System.Drawing.Size(406, 25); - TB_NewSAV.TabIndex = 5; - // - // B_LoadOld - // - B_LoadOld.Location = new System.Drawing.Point(4, 3); - B_LoadOld.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - B_LoadOld.Name = "B_LoadOld"; - B_LoadOld.Size = new System.Drawing.Size(88, 27); - B_LoadOld.TabIndex = 0; - B_LoadOld.Text = "Load Old"; - B_LoadOld.UseVisualStyleBackColor = true; - B_LoadOld.Click += OpenSAV; - // - // TB_OldSAV - // - TB_OldSAV.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; - TB_OldSAV.Location = new System.Drawing.Point(98, 5); - TB_OldSAV.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - TB_OldSAV.Name = "TB_OldSAV"; - TB_OldSAV.ReadOnly = true; - TB_OldSAV.Size = new System.Drawing.Size(406, 25); - TB_OldSAV.TabIndex = 4; - // - // B_LoadNew - // - B_LoadNew.Location = new System.Drawing.Point(4, 33); - B_LoadNew.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - B_LoadNew.Name = "B_LoadNew"; - B_LoadNew.Size = new System.Drawing.Size(88, 27); - B_LoadNew.TabIndex = 1; - B_LoadNew.Text = "Load New"; - B_LoadNew.UseVisualStyleBackColor = true; - B_LoadNew.Click += OpenSAV; - // - // TC_Features - // - TC_Features.AllowDrop = true; - TC_Features.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; - TC_Features.Controls.Add(GB_Research); - TC_Features.Location = new System.Drawing.Point(9, 9); - TC_Features.Margin = new System.Windows.Forms.Padding(0); - TC_Features.Name = "TC_Features"; - TC_Features.Padding = new System.Drawing.Point(0, 0); - TC_Features.SelectedIndex = 0; - TC_Features.Size = new System.Drawing.Size(525, 377); - TC_Features.TabIndex = 42; - // // splitContainer1 // splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; @@ -178,15 +112,81 @@ private void InitializeComponent() // splitContainer1.Panel2 // splitContainer1.Panel2.Controls.Add(RTB_Diff); - splitContainer1.Size = new System.Drawing.Size(509, 341); + splitContainer1.Size = new System.Drawing.Size(590, 345); splitContainer1.SplitterDistance = 60; splitContainer1.TabIndex = 7; // + // B_LoadOld + // + B_LoadOld.Location = new System.Drawing.Point(4, 3); + B_LoadOld.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + B_LoadOld.Name = "B_LoadOld"; + B_LoadOld.Size = new System.Drawing.Size(88, 27); + B_LoadOld.TabIndex = 0; + B_LoadOld.Text = "Load Old"; + B_LoadOld.UseVisualStyleBackColor = true; + B_LoadOld.Click += OpenSAV; + // + // TB_NewSAV + // + TB_NewSAV.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + TB_NewSAV.Location = new System.Drawing.Point(98, 35); + TB_NewSAV.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + TB_NewSAV.Name = "TB_NewSAV"; + TB_NewSAV.ReadOnly = true; + TB_NewSAV.Size = new System.Drawing.Size(487, 25); + TB_NewSAV.TabIndex = 5; + // + // B_LoadNew + // + B_LoadNew.Location = new System.Drawing.Point(4, 33); + B_LoadNew.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + B_LoadNew.Name = "B_LoadNew"; + B_LoadNew.Size = new System.Drawing.Size(88, 27); + B_LoadNew.TabIndex = 1; + B_LoadNew.Text = "Load New"; + B_LoadNew.UseVisualStyleBackColor = true; + B_LoadNew.Click += OpenSAV; + // + // TB_OldSAV + // + TB_OldSAV.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + TB_OldSAV.Location = new System.Drawing.Point(98, 5); + TB_OldSAV.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + TB_OldSAV.Name = "TB_OldSAV"; + TB_OldSAV.ReadOnly = true; + TB_OldSAV.Size = new System.Drawing.Size(487, 25); + TB_OldSAV.TabIndex = 4; + // + // RTB_Diff + // + RTB_Diff.Dock = System.Windows.Forms.DockStyle.Fill; + RTB_Diff.Location = new System.Drawing.Point(0, 0); + RTB_Diff.Margin = new System.Windows.Forms.Padding(0); + RTB_Diff.Name = "RTB_Diff"; + RTB_Diff.ReadOnly = true; + RTB_Diff.Size = new System.Drawing.Size(590, 281); + RTB_Diff.TabIndex = 6; + RTB_Diff.Text = ""; + // + // TC_Features + // + TC_Features.AllowDrop = true; + TC_Features.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + TC_Features.Controls.Add(GB_Research); + TC_Features.Location = new System.Drawing.Point(9, 9); + TC_Features.Margin = new System.Windows.Forms.Padding(0); + TC_Features.Name = "TC_Features"; + TC_Features.Padding = new System.Drawing.Point(0, 0); + TC_Features.SelectedIndex = 0; + TC_Features.Size = new System.Drawing.Size(606, 381); + TC_Features.TabIndex = 42; + // // SAV_FlagWork9a // AllowDrop = true; AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; - ClientSize = new System.Drawing.Size(543, 437); + ClientSize = new System.Drawing.Size(624, 441); Controls.Add(TC_Features); Controls.Add(L_EventFlagWarn); Controls.Add(B_Save); @@ -196,17 +196,17 @@ private void InitializeComponent() MaximizeBox = false; MaximumSize = new System.Drawing.Size(779, 917); MinimizeBox = false; - MinimumSize = new System.Drawing.Size(546, 456); + MinimumSize = new System.Drawing.Size(640, 480); Name = "SAV_FlagWork9a"; StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; Text = "Event Flag Editor"; GB_Research.ResumeLayout(false); - TC_Features.ResumeLayout(false); splitContainer1.Panel1.ResumeLayout(false); splitContainer1.Panel1.PerformLayout(); splitContainer1.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)splitContainer1).EndInit(); splitContainer1.ResumeLayout(false); + TC_Features.ResumeLayout(false); ResumeLayout(false); } diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen9/SAV_FlagWork9a.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen9/SAV_FlagWork9a.cs index 5e7cd995c..a598443f7 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen9/SAV_FlagWork9a.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen9/SAV_FlagWork9a.cs @@ -17,22 +17,22 @@ public SAV_FlagWork9a(SAV9ZA sav) { InitializeComponent(); - var path = Path.Combine(Main.Settings.Advanced.PathBlockKeyList, $"{nameof(SAV9ZA)}.txt"); + var path = Path.Combine(Main.Settings.Advanced.PathBlockKeyList, $"{sav.GetType().Name}_flagwork.txt"); if (File.Exists(path)) SCBlockMetadata.AddExtraKeyNames64(Lookup, File.ReadLines(path)); // Create grids for each block Grids = [ - EventWorkGrid64.CreateFlags(GetTab(nameof(sav.Blocks.Event)), sav.Blocks.Event, Lookup), - EventWorkGrid64.CreateValues(GetTab(nameof(sav.Blocks.Quest)), sav.Blocks.Quest, Lookup), - EventWorkGrid64.CreateValues(GetTab(nameof(sav.Blocks.Mable)), sav.Blocks.Mable, Lookup), - EventWorkGrid64.CreateFlags(GetTab(nameof(sav.Blocks.Flags)), sav.Blocks.Flags, Lookup), + EventWorkGrid64.CreateFlags(GetTab(nameof(sav.Blocks.Event)), sav.Blocks.Event, Lookup), EventWorkGrid64.CreateValues(GetTab(nameof(sav.Blocks.Work)), sav.Blocks.Work, Lookup), + EventWorkGrid64.CreateValues(GetTab(nameof(sav.Blocks.Quest)), sav.Blocks.Quest, Lookup), + EventWorkGrid64.CreateValues(GetTab(nameof(sav.Blocks.WorkMable)), sav.Blocks.WorkMable, Lookup), + EventWorkGrid64.CreateValues(GetTab(nameof(sav.Blocks.CountMable)), sav.Blocks.CountMable, Lookup), + EventWorkGrid64.CreateValues(GetTab(nameof(sav.Blocks.Work1)), sav.Blocks.Work1, Lookup), - EventWorkGrid64.CreateValues(GetTab(nameof(sav.Blocks.Work2)), sav.Blocks.Work2, Lookup), - EventWorkGrid64.CreateValues(GetTab(nameof(sav.Blocks.Work3)), sav.Blocks.Work3, Lookup), + EventWorkGrid64.CreateValues(GetTab(nameof(sav.Blocks.WorkSpawn)), sav.Blocks.WorkSpawn, Lookup), ]; // Translate headings @@ -101,15 +101,15 @@ private void DiffSaves(string fileUpdated, string filePrevious) } List result = []; - AppendDiff(result, updated.Blocks.Event, previous.Blocks.Event); AppendDiff(result, updated.Blocks.Flags, previous.Blocks.Flags); + AppendDiff(result, updated.Blocks.Event, previous.Blocks.Event); + AppendDiff(result, updated.Blocks.Work, previous.Blocks.Work); AppendDiff(result, updated.Blocks.Quest, previous.Blocks.Quest); - AppendDiff(result, updated.Blocks.Mable, previous.Blocks.Mable); - AppendDiff(result, updated.Blocks.Work, previous.Blocks.Work); + AppendDiff(result, updated.Blocks.WorkMable, previous.Blocks.WorkMable); + AppendDiff(result, updated.Blocks.CountMable, previous.Blocks.CountMable); AppendDiff(result, updated.Blocks.Work1, previous.Blocks.Work1); - AppendDiff(result, updated.Blocks.Work2, previous.Blocks.Work2); - AppendDiff(result, updated.Blocks.Work3, previous.Blocks.Work3); + AppendDiff(result, updated.Blocks.WorkSpawn, previous.Blocks.WorkSpawn); if (result.Count == 0) result.Add("No differences found.");