diff --git a/PKHeX/Resources/text/other/const_sm.txt b/PKHeX/Resources/text/other/const_sm.txt index 16ab90951..15a41e926 100644 --- a/PKHeX/Resources/text/other/const_sm.txt +++ b/PKHeX/Resources/text/other/const_sm.txt @@ -1,3 +1,4 @@ +148 Starter 00:Rowlet,01:Litten,02:Popplio 432 Tapu Koku 03:Battleable,04:Defeated,05:Captured 433 Tapu Lele 01:Battleable,02:Defeated,03:Captured 434 Tapu Bulu 01:Battleable,02:Defeated,03:Captured diff --git a/PKHeX/Subforms/Save Editors/SAV_EventFlags.Designer.cs b/PKHeX/Subforms/Save Editors/SAV_EventFlags.Designer.cs index 0461296ad..a2a0f2c77 100644 --- a/PKHeX/Subforms/Save Editors/SAV_EventFlags.Designer.cs +++ b/PKHeX/Subforms/Save Editors/SAV_EventFlags.Designer.cs @@ -32,7 +32,7 @@ private void InitializeComponent() this.c_CustomFlag = new System.Windows.Forms.CheckBox(); this.B_Cancel = new System.Windows.Forms.Button(); this.GB_FlagStatus = new System.Windows.Forms.GroupBox(); - this.nud = new System.Windows.Forms.NumericUpDown(); + this.NUD_Flag = new System.Windows.Forms.NumericUpDown(); this.CHK_CustomFlag = new System.Windows.Forms.Label(); this.L_Value = new System.Windows.Forms.Label(); this.CB_Stats = new System.Windows.Forms.ComboBox(); @@ -54,7 +54,7 @@ private void InitializeComponent() this.TLP_Const = new System.Windows.Forms.TableLayoutPanel(); this.L_EventFlagWarn = new System.Windows.Forms.Label(); this.GB_FlagStatus.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.nud)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.NUD_Flag)).BeginInit(); this.GB_Researcher.SuspendLayout(); this.GB_Flags.SuspendLayout(); this.GB_Constants.SuspendLayout(); @@ -85,7 +85,7 @@ private void InitializeComponent() // GB_FlagStatus // this.GB_FlagStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.GB_FlagStatus.Controls.Add(this.nud); + this.GB_FlagStatus.Controls.Add(this.NUD_Flag); this.GB_FlagStatus.Controls.Add(this.CHK_CustomFlag); this.GB_FlagStatus.Controls.Add(this.L_Value); this.GB_FlagStatus.Controls.Add(this.CB_Stats); @@ -99,19 +99,19 @@ private void InitializeComponent() this.GB_FlagStatus.TabStop = false; this.GB_FlagStatus.Text = "Check Status"; // - // nud + // NUD_Flag // - this.nud.Location = new System.Drawing.Point(87, 12); - this.nud.Maximum = new decimal(new int[] { + this.NUD_Flag.Location = new System.Drawing.Point(87, 12); + this.NUD_Flag.Maximum = new decimal(new int[] { 3072, 0, 0, 0}); - this.nud.Name = "nud"; - this.nud.Size = new System.Drawing.Size(45, 20); - this.nud.TabIndex = 9; - this.nud.ValueChanged += new System.EventHandler(this.changeCustomFlag); - this.nud.KeyUp += new System.Windows.Forms.KeyEventHandler(this.changeCustomFlag); + this.NUD_Flag.Name = "NUD_Flag"; + this.NUD_Flag.Size = new System.Drawing.Size(45, 20); + this.NUD_Flag.TabIndex = 9; + this.NUD_Flag.ValueChanged += new System.EventHandler(this.changeCustomFlag); + this.NUD_Flag.KeyUp += new System.Windows.Forms.KeyEventHandler(this.changeCustomFlag); // // CHK_CustomFlag // @@ -317,7 +317,7 @@ private void InitializeComponent() this.TLP_Const.ColumnCount = 3; this.TLP_Const.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.TLP_Const.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.TLP_Const.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.TLP_Const.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 200F)); this.TLP_Const.Location = new System.Drawing.Point(6, 19); this.TLP_Const.Name = "TLP_Const"; this.TLP_Const.RowCount = 1; @@ -360,7 +360,7 @@ private void InitializeComponent() this.Text = "Event Flag Editor"; this.GB_FlagStatus.ResumeLayout(false); this.GB_FlagStatus.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.nud)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.NUD_Flag)).EndInit(); this.GB_Researcher.ResumeLayout(false); this.GB_Researcher.PerformLayout(); this.GB_Flags.ResumeLayout(false); @@ -375,7 +375,7 @@ private void InitializeComponent() private System.Windows.Forms.Button B_Cancel; private System.Windows.Forms.GroupBox GB_FlagStatus; private System.Windows.Forms.Label CHK_CustomFlag; - private System.Windows.Forms.NumericUpDown nud; + private System.Windows.Forms.NumericUpDown NUD_Flag; private System.Windows.Forms.Button B_Save; private System.Windows.Forms.GroupBox GB_Researcher; private System.Windows.Forms.Label L_UnSet; diff --git a/PKHeX/Subforms/Save Editors/SAV_EventFlags.cs b/PKHeX/Subforms/Save Editors/SAV_EventFlags.cs index 6af939fd8..3d099cb71 100644 --- a/PKHeX/Subforms/Save Editors/SAV_EventFlags.cs +++ b/PKHeX/Subforms/Save Editors/SAV_EventFlags.cs @@ -41,8 +41,8 @@ public SAV_EventFlags() CB_Stats.SelectedIndex = 0; - nud.Maximum = flags.Length - 1; - nud.Text = "0"; + NUD_Flag.Maximum = flags.Length - 1; + NUD_Flag.Text = "0"; } private readonly SaveFile SAV = Main.SAV.Clone(); @@ -83,7 +83,7 @@ private void HandleSpecialFlags() { if (SAV.SM) // Ensure magearna event flag has magic constant { - BitConverter.GetBytes((ulong)(flags[3100] ? MagearnaConst : 0)).CopyTo(SAV.Data, ((SAV7)SAV).QRSaveData + 0x168); + BitConverter.GetBytes(flags[3100] ? MagearnaConst : 0).CopyTo(SAV.Data, ((SAV7)SAV).QRSaveData + 0x168); } } @@ -183,10 +183,7 @@ private void addConstList(string[] list) continue; num.Add(n); desc.Add(split[1]); - if (split.Length == 3) - enums.Add(split[2]); - else - enums.Add(""); + enums.Add(split.Length == 3 ? split[2] : ""); } catch { } } if (num.Count == 0) @@ -221,10 +218,10 @@ private void addConstList(string[] list) foreach (var entry in enums[i].Split(',')) { var spl = entry.Split(':'); - map.Add(new { Text = spl[1], Value = (int)Convert.ToInt32(spl[0])}); + map.Add(new { Text = spl[1], Value = Convert.ToInt32(spl[0])}); } } - var cb = new ComboBox() + var cb = new ComboBox { ValueMember = "Value", DisplayMember = "Text", @@ -232,16 +229,16 @@ private void addConstList(string[] list) Width = 80, Name = constCBTag + num[i].ToString("0000"), DropDownStyle = ComboBoxStyle.DropDownList, - BindingContext = this.BindingContext, - DataSource = map + BindingContext = BindingContext, + DataSource = map, + SelectedIndex = 0 }; - cb.SelectedIndex = 0; cb.SelectedValueChanged += toggleConst; mtb.TextChanged += toggleConst; TLP_Const.Controls.Add(lbl, 0, i); TLP_Const.Controls.Add(cb, 1, i); TLP_Const.Controls.Add(mtb, 2, i); - if (map.Any(val => val.Value == (int)Constants[num[i]])) + if (map.Any(val => val.Value == Constants[num[i]])) { cb.SelectedValue = (int)Constants[num[i]]; } @@ -262,8 +259,8 @@ private void changeCustomBool(object sender, EventArgs e) if (editing) return; editing = true; - flags[(int)nud.Value] = c_CustomFlag.Checked; - CheckBox c = TLP_Flags.Controls[flagTag + nud.Value.ToString("0000")] as CheckBox; + flags[(int)NUD_Flag.Value] = c_CustomFlag.Checked; + CheckBox c = TLP_Flags.Controls[flagTag + NUD_Flag.Value.ToString("0000")] as CheckBox; if (c != null) { c.Checked = c_CustomFlag.Checked; @@ -272,17 +269,17 @@ private void changeCustomBool(object sender, EventArgs e) } private void changeCustomFlag(object sender, EventArgs e) { - int flag = (int)nud.Value; + int flag = (int)NUD_Flag.Value; if (flag >= flags.Length) { c_CustomFlag.Checked = false; c_CustomFlag.Enabled = false; - nud.BackColor = Color.Red; + NUD_Flag.BackColor = Color.Red; } else { c_CustomFlag.Enabled = true; - nud.ResetBackColor(); + NUD_Flag.ResetBackColor(); c_CustomFlag.Checked = flags[flag]; } } @@ -297,7 +294,7 @@ private void toggleFlag(object sender, EventArgs e) editing = true; int flagnum = getControlNum((CheckBox) sender); flags[flagnum] = ((CheckBox)sender).Checked; - if (nud.Value == flagnum) + if (NUD_Flag.Value == flagnum) c_CustomFlag.Checked = flags[flagnum]; editing = false; }