From 6a73b9e6e4fcbdc7a70fa2fbd4cbc929a6dbfbbc Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 11 Nov 2017 22:48:22 -0800 Subject: [PATCH] Update zygarde cells use const numbers, dynamic count for cells possible --- .../Controls/SAV Editor/SAVEditor.Designer.cs | 46 ++++++++-------- .../Controls/SAV Editor/SAVEditor.cs | 4 +- .../Controls/SAV Editor/SAVEditor.resx | 2 +- .../Gen7/SAV_ZygardeCell.Designer.cs | 2 +- .../Save Editors/Gen7/SAV_ZygardeCell.cs | 55 ++++++++++--------- 5 files changed, 56 insertions(+), 53 deletions(-) diff --git a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.Designer.cs b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.Designer.cs index ec6efc306..918005357 100644 --- a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.Designer.cs +++ b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.Designer.cs @@ -31,6 +31,7 @@ private void InitializeComponent() System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SAVEditor)); this.tabBoxMulti = new System.Windows.Forms.TabControl(); this.Tab_Box = new System.Windows.Forms.TabPage(); + this.Box = new PKHeX.WinForms.Controls.BoxEditor(); this.Tab_PartyBattle = new System.Windows.Forms.TabPage(); this.PAN_BattleBox = new System.Windows.Forms.Panel(); this.PB_Locked = new System.Windows.Forms.PictureBox(); @@ -103,14 +104,13 @@ private void InitializeComponent() this.B_OUTPasserby = new System.Windows.Forms.Button(); this.B_CGearSkin = new System.Windows.Forms.Button(); this.B_OpenPokeBeans = new System.Windows.Forms.Button(); - this.B_OpenZygardeCells = new System.Windows.Forms.Button(); + this.B_CellsStickers = new System.Windows.Forms.Button(); this.B_OpenMiscEditor = new System.Windows.Forms.Button(); this.B_OpenHoneyTreeEditor = new System.Windows.Forms.Button(); this.B_OpenFriendSafari = new System.Windows.Forms.Button(); this.B_OpenRTCEditor = new System.Windows.Forms.Button(); this.B_OpenUGSEditor = new System.Windows.Forms.Button(); this.B_Roamer = new System.Windows.Forms.Button(); - this.Box = new PKHeX.WinForms.Controls.BoxEditor(); this.tabBoxMulti.SuspendLayout(); this.Tab_Box.SuspendLayout(); this.Tab_PartyBattle.SuspendLayout(); @@ -175,6 +175,17 @@ private void InitializeComponent() this.Tab_Box.Text = "Box"; this.Tab_Box.UseVisualStyleBackColor = true; // + // Box + // + this.Box.AllowDrop = true; + this.Box.CurrentBox = -1; + this.Box.FlagIllegal = false; + this.Box.Location = new System.Drawing.Point(26, 7); + this.Box.M = null; + this.Box.Name = "Box"; + this.Box.Size = new System.Drawing.Size(251, 185); + this.Box.TabIndex = 1; + // // Tab_PartyBattle // this.Tab_PartyBattle.Controls.Add(this.PAN_BattleBox); @@ -766,7 +777,7 @@ private void InitializeComponent() this.FLP_SAVtools.Controls.Add(this.B_OUTPasserby); this.FLP_SAVtools.Controls.Add(this.B_CGearSkin); this.FLP_SAVtools.Controls.Add(this.B_OpenPokeBeans); - this.FLP_SAVtools.Controls.Add(this.B_OpenZygardeCells); + this.FLP_SAVtools.Controls.Add(this.B_CellsStickers); this.FLP_SAVtools.Controls.Add(this.B_OpenMiscEditor); this.FLP_SAVtools.Controls.Add(this.B_OpenHoneyTreeEditor); this.FLP_SAVtools.Controls.Add(this.B_OpenFriendSafari); @@ -951,15 +962,15 @@ private void InitializeComponent() this.B_OpenPokeBeans.UseVisualStyleBackColor = true; this.B_OpenPokeBeans.Click += new System.EventHandler(this.B_OpenPokeBeans_Click); // - // B_OpenZygardeCells + // B_CellsStickers // - this.B_OpenZygardeCells.Location = new System.Drawing.Point(189, 148); - this.B_OpenZygardeCells.Name = "B_OpenZygardeCells"; - this.B_OpenZygardeCells.Size = new System.Drawing.Size(87, 23); - this.B_OpenZygardeCells.TabIndex = 26; - this.B_OpenZygardeCells.Text = "Zygarde Cells"; - this.B_OpenZygardeCells.UseVisualStyleBackColor = true; - this.B_OpenZygardeCells.Click += new System.EventHandler(this.B_OpenZygardeCells_Click); + this.B_CellsStickers.Location = new System.Drawing.Point(189, 148); + this.B_CellsStickers.Name = "B_CellsStickers"; + this.B_CellsStickers.Size = new System.Drawing.Size(87, 23); + this.B_CellsStickers.TabIndex = 26; + this.B_CellsStickers.Text = "Cells/Stickers"; + this.B_CellsStickers.UseVisualStyleBackColor = true; + this.B_CellsStickers.Click += new System.EventHandler(this.B_CellsStickers_Click); // // B_OpenMiscEditor // @@ -1021,17 +1032,6 @@ private void InitializeComponent() this.B_Roamer.UseVisualStyleBackColor = true; this.B_Roamer.Click += new System.EventHandler(this.B_Roamer_Click); // - // Box - // - this.Box.AllowDrop = true; - this.Box.CurrentBox = -1; - this.Box.FlagIllegal = false; - this.Box.Location = new System.Drawing.Point(26, 7); - this.Box.M = null; - this.Box.Name = "Box"; - this.Box.Size = new System.Drawing.Size(251, 185); - this.Box.TabIndex = 1; - // // SAVEditor // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; @@ -1160,7 +1160,7 @@ private void InitializeComponent() private System.Windows.Forms.Button B_OUTPasserby; private System.Windows.Forms.Button B_CGearSkin; private System.Windows.Forms.Button B_OpenPokeBeans; - private System.Windows.Forms.Button B_OpenZygardeCells; + private System.Windows.Forms.Button B_CellsStickers; private System.Windows.Forms.Button B_OpenMiscEditor; private System.Windows.Forms.Button B_OpenHoneyTreeEditor; private System.Windows.Forms.Button B_OpenFriendSafari; diff --git a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs index e770a1064..0892ea7aa 100644 --- a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs +++ b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs @@ -515,7 +515,7 @@ private void B_SaveBoxBin_Click(object sender, EventArgs e) private void B_OpenPokeblocks_Click(object sender, EventArgs e) => new SAV_PokeBlockORAS(SAV).ShowDialog(); private void B_OpenSuperTraining_Click(object sender, EventArgs e) => new SAV_SuperTrain(SAV).ShowDialog(); private void B_OpenSecretBase_Click(object sender, EventArgs e) => new SAV_SecretBase(SAV).ShowDialog(); - private void B_OpenZygardeCells_Click(object sender, EventArgs e) => new SAV_ZygardeCell(SAV).ShowDialog(); + private void B_CellsStickers_Click(object sender, EventArgs e) => new SAV_ZygardeCell(SAV).ShowDialog(); private void B_LinkInfo_Click(object sender, EventArgs e) => new SAV_Link6(SAV).ShowDialog(); private void B_Roamer_Click(object sender, EventArgs e) => new SAV_Roamer3(SAV).ShowDialog(); private void B_OpenEventFlags_Click(object sender, EventArgs e) @@ -986,7 +986,7 @@ private void ToggleViewSubEditors(SaveFile sav) B_OpenSecretBase.Enabled = sav.HasSecretBase; B_OpenPokepuffs.Enabled = sav.HasPuff; B_OpenPokeBeans.Enabled = sav.Generation == 7; - B_OpenZygardeCells.Enabled = sav.Generation == 7; + B_CellsStickers.Enabled = sav.Generation == 7; B_OUTPasserby.Enabled = sav.HasPSS; B_OpenBoxLayout.Enabled = sav.HasBoxWallpapers; B_OpenWondercards.Enabled = sav.HasWondercards; diff --git a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.resx b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.resx index 9784e19d8..7e8350711 100644 --- a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.resx +++ b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.resx @@ -469,7 +469,7 @@ True - + True diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_ZygardeCell.Designer.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_ZygardeCell.Designer.cs index 36f087325..569545491 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_ZygardeCell.Designer.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_ZygardeCell.Designer.cs @@ -188,7 +188,7 @@ private void InitializeComponent() this.MinimumSize = new System.Drawing.Size(440, 380); this.Name = "SAV_ZygardeCell"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Zygarde Cells"; + this.Text = "Cells/Sticker Editor"; ((System.ComponentModel.ISupportInitialize)(this.dgv)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_Cells)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_Collected)).EndInit(); diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_ZygardeCell.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_ZygardeCell.cs index 0b2ff32e2..2b3b5d059 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_ZygardeCell.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_ZygardeCell.cs @@ -32,6 +32,7 @@ public SAV_ZygardeCell(SaveFile sav) // Populate Grid dgv.Rows.Add(cellcount); + var locations = SAV.SM ? locationsSM : locationsUSUM; for (int i = 0; i < cellcount; i++) { if (cells[i] > 2) @@ -41,12 +42,14 @@ public SAV_ZygardeCell(SaveFile sav) dgv.Rows[i].Cells[1].Value = locations[i]; dgv.Rows[i].Cells[2].Value = states[cells[i]]; } + if (SAV.USUM) + L_Cells.Visible = NUD_Cells.Visible = false; } - private const int cellstotal = 0x142/2; - private const int cellscollected = 0x152/2; - private const int celloffset = 198; - private const int cellcount = 95; + private const int cellstotal = 161; + private const int cellscollected = 169; + private const int celloffset = 0xC6; + private int cellcount => SAV.USUM ? 100 : 95; private readonly string[] states = {"None", "Available", "Received"}; private void B_Save_Click(object sender, EventArgs e) @@ -92,7 +95,7 @@ private void B_GiveAll_Click(object sender, EventArgs e) #region locations -- lazy - private readonly string[] locations = + private readonly string[] locationsSM = { "Verdant Cave - Trial Site", "Ruins of Conflict - Outside", @@ -192,36 +195,36 @@ private void B_GiveAll_Click(object sender, EventArgs e) }; private readonly string[] locationsUSUM = { - "Hau'oli City(Shopping) Salon Outside", - "Hau'oli City(Shopping) MalasadaShop Outside", - "Hau'oli City(Shopping) Ilima's House 2F", + "Hau'oli City (Shopping) Salon Outside", + "Hau'oli City (Shopping) MalasadaShop Outside", + "Hau'oli City (Shopping) Ilima's House 2F", "Malie City Library 1F", - "Hau'oli City(Marina) Outside", + "Hau'oli City (Marina) Outside", "Route 2 SouthEast House", - "Hau'oli City(Shopping) Ilima's House Outside", - "Hau'oli City(Shopping) CityHall", + "Hau'oli City (Shopping) Ilima's House Outside", + "Hau'oli City (Shopping) CityHall", "Heahea City Hotel 3F", "Route 2 BerryField House", "Route 2 BerryField House Outside", "Royal Avenue NorthEast", - "Hau'oli City(Shopping) PokemonCenter Outside", + "Hau'oli City (Shopping) PokemonCenter Outside", "Royal Avenue South", "Hokulani Observatory Room", "Hokulani Observatory InfoDesk", - "Hau'oli City(Shopping) CityHall Outside", + "Hau'oli City (Shopping) CityHall Outside", "Konikoni City Olivia's JewelryShop 2F", "Heahea City Surfboard Outside", "Po Town SouthWest", "*** researching No.21 ***", - "Hau'oli City(Shopping) NorthWest of PoliceStation", - "Hau'oli City(Marina) FerryTerminal Outside", + "Hau'oli City (Shopping) NorthWest of Police Station", + "Hau'oli City (Marina) FerryTerminal Outside", "Route 2 SouthEast House Outside", "Route 2 PokemonCenter Outside", "Heahea City West", "Heahea City Hotel Outside(West)", "Heahea City Hotel Outside(East)", "Heahea City ResearchLab Outside(East)", - "Heahea City ResearchLab Outside(South)", + "Heahea City ResearchLab Outside (South)", "Heahea City GameFreak", "Hokulani Observatory DeadEnd", "Heahea City GameFreak Building 3F", @@ -236,18 +239,18 @@ private void B_GiveAll_Click(object sender, EventArgs e) "Hano Beach", "Hano Resort South", "Hano Resort Lobby", - "Konikoni City Lighthouse(Diglett's Tunnel)", + "Konikoni City Lighthouse (Diglett's Tunnel)", "Royal Dome 1F", "Route 8 AetherBase Outside", "Route 8 FossilRestorationCenter Outside", "Konikoni City West", "Konikoni City Restaurant 1F", "Iki Town SouthWest", - "Hau'oli City(Shopping) Ilima's House SwimPool", + "Hau'oli City (Shopping) Ilima's House SwimPool", "*** researching No.53", "Route 5 South of PokemonCenter", "*** researching No.55", - "Malie City(Outer) RecyclePlant Outside", + "Malie City (Outer) RecyclePlant Outside", "Malie City FerryTerminal Outside", "Malie City ApparelShop Outside", "Malie City Salon Outside", @@ -260,28 +263,28 @@ private void B_GiveAll_Click(object sender, EventArgs e) "Mt.Hokulani", "Mt.Blush PowerPlant", "Route 13", - "Route 14 Front of Megamart(Abandoned)", + "Route 14 Front of Megamart (Abandoned)", "Route 14 North", "Route 15 islet Surfboard Outside", "Route 17 PoliceStation Outside", "Route 17 PoliceStation", "Po Town PokemonCenter Outside", "*** researching No.75", - "Po Town ShadyHouse Outside(East)", + "Po Town ShadyHouse Outside (East)", "Po Town PokemonCenter", "Po Town ShadyHouse 1F", "Route 13 Motel Outside", "Po Town ShadyHouse 2F Outside", "Route 17 South of PoTown", "Ula'ula Meadow", - "Po Town ShadyHouse Outside(West)x3", - "Po Town ShadyHouse Outside(West)x3", - "Po Town ShadyHouse Outside(West)x3", + "Po Town ShadyHouse Outside (West) 1", + "Po Town ShadyHouse Outside (West) 2", + "Po Town ShadyHouse Outside (West) 3", "Seafolk Village SouthEast Wiscash(Mina's Ship) Outside", "Seafolk Village SouthWest Huntail", "Seafolk Village SouthWest Huntail Outside", - "Seafolk Village SouthEast Wiscash(Mina's Ship)", - "Seafolk Village West Wailord(Restaurant)", + "Seafolk Village SouthEast Wiscash (Mina's Ship)", + "Seafolk Village West Wailord (Restaurant)", "Seafolk Village East Gyarados", "Poni Wilds SouthEast", "Ancient Poni Path Hapu's House(Kitchen)",