diff --git a/PKHeX.Core/Saves/Substructures/Gen5/BattleSubway5.cs b/PKHeX.Core/Saves/Substructures/Gen5/BattleSubway5.cs index e64d3fdcb..5da9ea2a5 100644 --- a/PKHeX.Core/Saves/Substructures/Gen5/BattleSubway5.cs +++ b/PKHeX.Core/Saves/Substructures/Gen5/BattleSubway5.cs @@ -1,125 +1,40 @@ using System; using static System.Buffers.Binary.BinaryPrimitives; -namespace PKHeX.Core +namespace PKHeX.Core; + +public sealed class BattleSubway5 : SaveBlock { - public sealed class BattleSubway5 : SaveBlock - { - public BattleSubway5(SAV5BW sav, int offset) : base(sav) => Offset = offset; - public BattleSubway5(SAV5B2W2 sav, int offset) : base(sav) => Offset = offset; + public BattleSubway5(SAV5BW sav, int offset) : base(sav) => Offset = offset; + public BattleSubway5(SAV5B2W2 sav, int offset) : base(sav) => Offset = offset; - public int BP - { - get => ReadUInt16LittleEndian(Data.AsSpan(Offset)); - set => WriteUInt16LittleEndian(Data.AsSpan(Offset), (ushort)value); - } + private Span Raw => Data.AsSpan(Offset); - // Normal - public int SinglePast - { - get => ReadUInt16LittleEndian(Data.AsSpan(Offset + 0x08)); - set => WriteUInt16LittleEndian(Data.AsSpan(Offset + 0x08), (ushort)value); - } + public int BP { get => ReadUInt16LittleEndian(Raw); set => WriteUInt16LittleEndian(Raw, (ushort)value); } + public int Flags { get => Raw[0x04]; set => Raw[0x04] = (byte)value; } + public bool Flag0 { get => ((Flags >> 0) & 1) != 0; set => Flags = (Flags & ~(1 << 0)) | ((value ? 1 : 0) << 0); } + public bool Flag1 { get => ((Flags >> 1) & 1) != 0; set => Flags = (Flags & ~(1 << 1)) | ((value ? 1 : 0) << 1); } + public bool Flag2 { get => ((Flags >> 2) & 1) != 0; set => Flags = (Flags & ~(1 << 2)) | ((value ? 1 : 0) << 2); } + public bool Flag3 { get => ((Flags >> 3) & 1) != 0; set => Flags = (Flags & ~(1 << 3)) | ((value ? 1 : 0) << 3); } + public bool SuperSingle { get => ((Flags >> 4) & 1) != 0; set => Flags = (Flags & ~(1 << 4)) | ((value ? 1 : 0) << 4); } + public bool SuperDouble { get => ((Flags >> 5) & 1) != 0; set => Flags = (Flags & ~(1 << 5)) | ((value ? 1 : 0) << 5); } + public bool SuperMulti { get => ((Flags >> 6) & 1) != 0; set => Flags = (Flags & ~(1 << 6)) | ((value ? 1 : 0) << 6); } + public bool Flag7 { get => ((Flags >> 7) & 1) != 0; set => Flags = (Flags & ~(1 << 7)) | ((value ? 1 : 0) << 7); } - public int SingleRecord - { - get => ReadUInt16LittleEndian(Data.AsSpan(Offset + 0x1A)); - set => WriteUInt16LittleEndian(Data.AsSpan(Offset + 0x1A), (ushort)value); - } - - public int DoublePast - { - get => ReadUInt16LittleEndian(Data.AsSpan(Offset + 0x0A)); - set => WriteUInt16LittleEndian(Data.AsSpan(Offset + 0x0A), (ushort)value); - } - - public int DoubleRecord - { - get => ReadUInt16LittleEndian(Data.AsSpan(Offset + 0x1C)); - set => WriteUInt16LittleEndian(Data.AsSpan(Offset + 0x1C), (ushort)value); - } - - public int MultiNPCPast - { - get => ReadUInt16LittleEndian(Data.AsSpan(Offset + 0x0C)); - set => WriteUInt16LittleEndian(Data.AsSpan(Offset + 0x0C), (ushort)value); - } - - public int MultiNPCRecord - { - get => ReadUInt16LittleEndian(Data.AsSpan(Offset + 0x1E)); - set => WriteUInt16LittleEndian(Data.AsSpan(Offset + 0x1E), (ushort)value); - } - - public int MultiFriendsPast - { - get => ReadUInt16LittleEndian(Data.AsSpan(Offset + 0x0E)); - set => WriteUInt16LittleEndian(Data.AsSpan(Offset + 0x0E), (ushort)value); - } - - public int MultiFriendsRecord - { - get => ReadUInt16LittleEndian(Data.AsSpan(Offset + 0x20)); - set => WriteUInt16LittleEndian(Data.AsSpan(Offset + 0x20), (ushort)value); - } - - // Super Check - public int SuperCheck - { - get => Data[Offset + 0x04]; - set => Data[Offset + 0x04] = (byte)value; - } - - // Super - public int SuperSinglePast - { - get => ReadUInt16LittleEndian(Data.AsSpan(Offset + 0x12)); - set => WriteUInt16LittleEndian(Data.AsSpan(Offset + 0x12), (ushort)value); - } - - public int SuperSingleRecord - { - get => ReadUInt16LittleEndian(Data.AsSpan(Offset + 0x24)); - set => WriteUInt16LittleEndian(Data.AsSpan(Offset + 0x24), (ushort)value); - } - - public int SuperDoublePast - { - get => ReadUInt16LittleEndian(Data.AsSpan(Offset + 0x14)); - set => WriteUInt16LittleEndian(Data.AsSpan(Offset + 0x14), (ushort)value); - } - - public int SuperDoubleRecord - { - get => ReadUInt16LittleEndian(Data.AsSpan(Offset + 0x26)); - set => WriteUInt16LittleEndian(Data.AsSpan(Offset + 0x26), (ushort)value); - } - - public int SuperMultiNPCPast - { - get => ReadUInt16LittleEndian(Data.AsSpan(Offset + 0x16)); - set => WriteUInt16LittleEndian(Data.AsSpan(Offset + 0x16), (ushort)value); - } - - public int SuperMultiNPCRecord - { - get => ReadUInt16LittleEndian(Data.AsSpan(Offset + 0x28)); - set => WriteUInt16LittleEndian(Data.AsSpan(Offset + 0x28), (ushort)value); - } - - public int SuperMultiFriendsPast - { - get => ReadUInt16LittleEndian(Data.AsSpan(Offset + 0x18)); - set => WriteUInt16LittleEndian(Data.AsSpan(Offset + 0x18), (ushort)value); - } - - public int SuperMultiFriendsRecord - { - get => ReadUInt16LittleEndian(Data.AsSpan(Offset + 0x2A)); - set => WriteUInt16LittleEndian(Data.AsSpan(Offset + 0x2A), (ushort)value); - } - - // TODO: Wifi?? - - } -} \ No newline at end of file + public int SinglePast { get => ReadUInt16LittleEndian(Raw[0x08..]); set => WriteUInt16LittleEndian(Raw[0x08..], (ushort)value); } + public int DoublePast { get => ReadUInt16LittleEndian(Raw[0x0A..]); set => WriteUInt16LittleEndian(Raw[0x0A..], (ushort)value); } + public int MultiNPCPast { get => ReadUInt16LittleEndian(Raw[0x0C..]); set => WriteUInt16LittleEndian(Raw[0x0C..], (ushort)value); } + public int MultiFriendsPast { get => ReadUInt16LittleEndian(Raw[0x0E..]); set => WriteUInt16LittleEndian(Raw[0x0E..], (ushort)value); } + public int SuperSinglePast { get => ReadUInt16LittleEndian(Raw[0x12..]); set => WriteUInt16LittleEndian(Raw[0x12..], (ushort)value); } + public int SuperDoublePast { get => ReadUInt16LittleEndian(Raw[0x14..]); set => WriteUInt16LittleEndian(Raw[0x14..], (ushort)value); } + public int SuperMultiNPCPast { get => ReadUInt16LittleEndian(Raw[0x16..]); set => WriteUInt16LittleEndian(Raw[0x16..], (ushort)value); } + public int SuperMultiFriendsPast { get => ReadUInt16LittleEndian(Raw[0x18..]); set => WriteUInt16LittleEndian(Raw[0x18..], (ushort)value); } + public int SingleRecord { get => ReadUInt16LittleEndian(Raw[0x1A..]); set => WriteUInt16LittleEndian(Raw[0x1A..], (ushort)value); } + public int DoubleRecord { get => ReadUInt16LittleEndian(Raw[0x1C..]); set => WriteUInt16LittleEndian(Raw[0x1C..], (ushort)value); } + public int MultiNPCRecord { get => ReadUInt16LittleEndian(Raw[0x1E..]); set => WriteUInt16LittleEndian(Raw[0x1E..], (ushort)value); } + public int MultiFriendsRecord { get => ReadUInt16LittleEndian(Raw[0x20..]); set => WriteUInt16LittleEndian(Raw[0x20..], (ushort)value); } + public int SuperSingleRecord { get => ReadUInt16LittleEndian(Raw[0x24..]); set => WriteUInt16LittleEndian(Raw[0x24..], (ushort)value); } + public int SuperDoubleRecord { get => ReadUInt16LittleEndian(Raw[0x26..]); set => WriteUInt16LittleEndian(Raw[0x26..], (ushort)value); } + public int SuperMultiNPCRecord { get => ReadUInt16LittleEndian(Raw[0x28..]); set => WriteUInt16LittleEndian(Raw[0x28..], (ushort)value); } + public int SuperMultiFriendsRecord { get => ReadUInt16LittleEndian(Raw[0x2A..]); set => WriteUInt16LittleEndian(Raw[0x2A..], (ushort)value); } +} diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen5/SAV_Misc5.Designer.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen5/SAV_Misc5.Designer.cs index cb036861f..dfb6d8ac7 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen5/SAV_Misc5.Designer.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen5/SAV_Misc5.Designer.cs @@ -33,6 +33,7 @@ private void InitializeComponent() this.B_Save = new System.Windows.Forms.Button(); this.TC_Misc = new System.Windows.Forms.TabControl(); this.TAB_Main = new System.Windows.Forms.TabPage(); + this.B_UnlockAllMusicalProps = new System.Windows.Forms.Button(); this.GB_KeySystem = new System.Windows.Forms.GroupBox(); this.B_AllKeys = new System.Windows.Forms.Button(); this.CLB_KeySystem = new System.Windows.Forms.CheckedListBox(); @@ -99,7 +100,7 @@ private void InitializeComponent() this.CB_Areas = new System.Windows.Forms.ComboBox(); this.LB_Slots = new System.Windows.Forms.ListBox(); this.TAB_Subway = new System.Windows.Forms.TabPage(); - this.GB_SuperChecks = new System.Windows.Forms.GroupBox(); + this.GB_SubwayChecks = new System.Windows.Forms.GroupBox(); this.CHK_SuperMulti = new System.Windows.Forms.CheckBox(); this.CHK_SuperDouble = new System.Windows.Forms.CheckBox(); this.CHK_SuperSingle = new System.Windows.Forms.CheckBox(); @@ -147,7 +148,11 @@ private void InitializeComponent() this.L_SingleRecord = new System.Windows.Forms.Label(); this.TipExpB = new System.Windows.Forms.ToolTip(this.components); this.TipExpW = new System.Windows.Forms.ToolTip(this.components); - this.B_UnlockAllMusicalProps = new System.Windows.Forms.Button(); + this.CHK_Subway2 = new System.Windows.Forms.CheckBox(); + this.CHK_Subway1 = new System.Windows.Forms.CheckBox(); + this.CHK_Subway0 = new System.Windows.Forms.CheckBox(); + this.CHK_Subway3 = new System.Windows.Forms.CheckBox(); + this.CHK_Subway7 = new System.Windows.Forms.CheckBox(); this.TC_Misc.SuspendLayout(); this.TAB_Main.SuspendLayout(); this.GB_KeySystem.SuspendLayout(); @@ -174,7 +179,7 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.PB_SlotPreview)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_Animation)).BeginInit(); this.TAB_Subway.SuspendLayout(); - this.GB_SuperChecks.SuspendLayout(); + this.GB_SubwayChecks.SuspendLayout(); this.GB_SuperMulti.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.NUD_SMultiFriendsRecord)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_SMultiFriendsPast)).BeginInit(); @@ -251,6 +256,16 @@ private void InitializeComponent() this.TAB_Main.Text = "Main"; this.TAB_Main.UseVisualStyleBackColor = true; // + // B_UnlockAllMusicalProps + // + this.B_UnlockAllMusicalProps.Location = new System.Drawing.Point(175, 243); + this.B_UnlockAllMusicalProps.Name = "B_UnlockAllMusicalProps"; + this.B_UnlockAllMusicalProps.Size = new System.Drawing.Size(144, 42); + this.B_UnlockAllMusicalProps.TabIndex = 5; + this.B_UnlockAllMusicalProps.Text = "Unlock All Musical Props"; + this.B_UnlockAllMusicalProps.UseVisualStyleBackColor = true; + this.B_UnlockAllMusicalProps.Click += new System.EventHandler(this.B_UnlockAllMusicalProps_Click); + // // GB_KeySystem // this.GB_KeySystem.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) @@ -1078,7 +1093,7 @@ private void InitializeComponent() // // TAB_Subway // - this.TAB_Subway.Controls.Add(this.GB_SuperChecks); + this.TAB_Subway.Controls.Add(this.GB_SubwayChecks); this.TAB_Subway.Controls.Add(this.GB_SuperMulti); this.TAB_Subway.Controls.Add(this.GB_SuperDoubles); this.TAB_Subway.Controls.Add(this.GB_SuperSingles); @@ -1094,50 +1109,55 @@ private void InitializeComponent() this.TAB_Subway.Text = "Subway"; this.TAB_Subway.UseVisualStyleBackColor = true; // - // GB_SuperChecks + // GB_SubwayChecks // - this.GB_SuperChecks.Controls.Add(this.CHK_SuperMulti); - this.GB_SuperChecks.Controls.Add(this.CHK_SuperDouble); - this.GB_SuperChecks.Controls.Add(this.CHK_SuperSingle); - this.GB_SuperChecks.Location = new System.Drawing.Point(212, 6); - this.GB_SuperChecks.Margin = new System.Windows.Forms.Padding(2); - this.GB_SuperChecks.Name = "GB_SuperChecks"; - this.GB_SuperChecks.Padding = new System.Windows.Forms.Padding(2); - this.GB_SuperChecks.Size = new System.Drawing.Size(118, 87); - this.GB_SuperChecks.TabIndex = 3; - this.GB_SuperChecks.TabStop = false; - this.GB_SuperChecks.Text = "Super Checks"; + this.GB_SubwayChecks.Controls.Add(this.CHK_Subway7); + this.GB_SubwayChecks.Controls.Add(this.CHK_Subway3); + this.GB_SubwayChecks.Controls.Add(this.CHK_Subway2); + this.GB_SubwayChecks.Controls.Add(this.CHK_Subway1); + this.GB_SubwayChecks.Controls.Add(this.CHK_Subway0); + this.GB_SubwayChecks.Controls.Add(this.CHK_SuperMulti); + this.GB_SubwayChecks.Controls.Add(this.CHK_SuperDouble); + this.GB_SubwayChecks.Controls.Add(this.CHK_SuperSingle); + this.GB_SubwayChecks.Location = new System.Drawing.Point(212, 6); + this.GB_SubwayChecks.Margin = new System.Windows.Forms.Padding(2); + this.GB_SubwayChecks.Name = "GB_SubwayChecks"; + this.GB_SubwayChecks.Padding = new System.Windows.Forms.Padding(2); + this.GB_SubwayChecks.Size = new System.Drawing.Size(118, 151); + this.GB_SubwayChecks.TabIndex = 3; + this.GB_SubwayChecks.TabStop = false; + this.GB_SubwayChecks.Text = "Subway Flags"; // // CHK_SuperMulti // this.CHK_SuperMulti.AutoSize = true; - this.CHK_SuperMulti.Location = new System.Drawing.Point(9, 63); + this.CHK_SuperMulti.Location = new System.Drawing.Point(9, 112); this.CHK_SuperMulti.Margin = new System.Windows.Forms.Padding(2); this.CHK_SuperMulti.Name = "CHK_SuperMulti"; this.CHK_SuperMulti.Size = new System.Drawing.Size(85, 17); - this.CHK_SuperMulti.TabIndex = 2; + this.CHK_SuperMulti.TabIndex = 7; this.CHK_SuperMulti.Text = "Super Multi?"; this.CHK_SuperMulti.UseVisualStyleBackColor = true; // // CHK_SuperDouble // this.CHK_SuperDouble.AutoSize = true; - this.CHK_SuperDouble.Location = new System.Drawing.Point(9, 41); + this.CHK_SuperDouble.Location = new System.Drawing.Point(9, 97); this.CHK_SuperDouble.Margin = new System.Windows.Forms.Padding(2); this.CHK_SuperDouble.Name = "CHK_SuperDouble"; this.CHK_SuperDouble.Size = new System.Drawing.Size(102, 17); - this.CHK_SuperDouble.TabIndex = 1; + this.CHK_SuperDouble.TabIndex = 6; this.CHK_SuperDouble.Text = "Super Doubles?"; this.CHK_SuperDouble.UseVisualStyleBackColor = true; // // CHK_SuperSingle // this.CHK_SuperSingle.AutoSize = true; - this.CHK_SuperSingle.Location = new System.Drawing.Point(9, 20); + this.CHK_SuperSingle.Location = new System.Drawing.Point(9, 82); this.CHK_SuperSingle.Margin = new System.Windows.Forms.Padding(2); this.CHK_SuperSingle.Name = "CHK_SuperSingle"; this.CHK_SuperSingle.Size = new System.Drawing.Size(97, 17); - this.CHK_SuperSingle.TabIndex = 0; + this.CHK_SuperSingle.TabIndex = 5; this.CHK_SuperSingle.Text = "Super Singles?"; this.CHK_SuperSingle.UseVisualStyleBackColor = true; // @@ -1687,15 +1707,60 @@ private void InitializeComponent() this.L_SingleRecord.Text = "Record"; this.L_SingleRecord.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // - // B_UnlockAllMusicalProps + // CHK_Subway2 // - this.B_UnlockAllMusicalProps.Location = new System.Drawing.Point(175, 243); - this.B_UnlockAllMusicalProps.Name = "B_UnlockAllMusicalProps"; - this.B_UnlockAllMusicalProps.Size = new System.Drawing.Size(144, 42); - this.B_UnlockAllMusicalProps.TabIndex = 5; - this.B_UnlockAllMusicalProps.Text = "Unlock All Musical Props"; - this.B_UnlockAllMusicalProps.UseVisualStyleBackColor = true; - this.B_UnlockAllMusicalProps.Click += new System.EventHandler(this.B_UnlockAllMusicalProps_Click); + this.CHK_Subway2.AutoSize = true; + this.CHK_Subway2.Location = new System.Drawing.Point(9, 47); + this.CHK_Subway2.Margin = new System.Windows.Forms.Padding(2); + this.CHK_Subway2.Name = "CHK_Subway2"; + this.CHK_Subway2.Size = new System.Drawing.Size(52, 17); + this.CHK_Subway2.TabIndex = 3; + this.CHK_Subway2.Text = "Flag2"; + this.CHK_Subway2.UseVisualStyleBackColor = true; + // + // CHK_Subway1 + // + this.CHK_Subway1.AutoSize = true; + this.CHK_Subway1.Location = new System.Drawing.Point(9, 32); + this.CHK_Subway1.Margin = new System.Windows.Forms.Padding(2); + this.CHK_Subway1.Name = "CHK_Subway1"; + this.CHK_Subway1.Size = new System.Drawing.Size(52, 17); + this.CHK_Subway1.TabIndex = 2; + this.CHK_Subway1.Text = "Flag1"; + this.CHK_Subway1.UseVisualStyleBackColor = true; + // + // CHK_Subway0 + // + this.CHK_Subway0.AutoSize = true; + this.CHK_Subway0.Location = new System.Drawing.Point(9, 17); + this.CHK_Subway0.Margin = new System.Windows.Forms.Padding(2); + this.CHK_Subway0.Name = "CHK_Subway0"; + this.CHK_Subway0.Size = new System.Drawing.Size(52, 17); + this.CHK_Subway0.TabIndex = 1; + this.CHK_Subway0.Text = "Flag0"; + this.CHK_Subway0.UseVisualStyleBackColor = true; + // + // CHK_Subway3 + // + this.CHK_Subway3.AutoSize = true; + this.CHK_Subway3.Location = new System.Drawing.Point(9, 62); + this.CHK_Subway3.Margin = new System.Windows.Forms.Padding(2); + this.CHK_Subway3.Name = "CHK_Subway3"; + this.CHK_Subway3.Size = new System.Drawing.Size(52, 17); + this.CHK_Subway3.TabIndex = 4; + this.CHK_Subway3.Text = "Flag3"; + this.CHK_Subway3.UseVisualStyleBackColor = true; + // + // CHK_Subway7 + // + this.CHK_Subway7.AutoSize = true; + this.CHK_Subway7.Location = new System.Drawing.Point(9, 127); + this.CHK_Subway7.Margin = new System.Windows.Forms.Padding(2); + this.CHK_Subway7.Name = "CHK_Subway7"; + this.CHK_Subway7.Size = new System.Drawing.Size(52, 17); + this.CHK_Subway7.TabIndex = 8; + this.CHK_Subway7.Text = "Flag7"; + this.CHK_Subway7.UseVisualStyleBackColor = true; // // SAV_Misc5 // @@ -1738,8 +1803,8 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.PB_SlotPreview)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_Animation)).EndInit(); this.TAB_Subway.ResumeLayout(false); - this.GB_SuperChecks.ResumeLayout(false); - this.GB_SuperChecks.PerformLayout(); + this.GB_SubwayChecks.ResumeLayout(false); + this.GB_SubwayChecks.PerformLayout(); this.GB_SuperMulti.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.NUD_SMultiFriendsRecord)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_SMultiFriendsPast)).EndInit(); @@ -1881,11 +1946,16 @@ private void InitializeComponent() private System.Windows.Forms.NumericUpDown NUD_SSingleRecord; private System.Windows.Forms.Label L_SSinglePast; private System.Windows.Forms.NumericUpDown NUD_SSinglePast; - private System.Windows.Forms.GroupBox GB_SuperChecks; + private System.Windows.Forms.GroupBox GB_SubwayChecks; private System.Windows.Forms.CheckBox CHK_SuperMulti; private System.Windows.Forms.CheckBox CHK_SuperDouble; private System.Windows.Forms.CheckBox CHK_SuperSingle; private System.Windows.Forms.Panel PAN_MissionMeta; private System.Windows.Forms.Button B_UnlockAllMusicalProps; + private System.Windows.Forms.CheckBox CHK_Subway7; + private System.Windows.Forms.CheckBox CHK_Subway3; + private System.Windows.Forms.CheckBox CHK_Subway2; + private System.Windows.Forms.CheckBox CHK_Subway1; + private System.Windows.Forms.CheckBox CHK_Subway0; } } diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen5/SAV_Misc5.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen5/SAV_Misc5.cs index b5c0100ae..2a9cb6ebe 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen5/SAV_Misc5.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen5/SAV_Misc5.cs @@ -607,22 +607,17 @@ private void SetForms(EntreeSlot slot) private void ReadSubway() { - // Figure out the Super Checks - var swSuperCheck = sw.SuperCheck; - if (swSuperCheck == 0x00) - { - CHK_SuperSingle.Checked = CHK_SuperDouble.Checked = CHK_SuperMulti.Checked = false; - } - else if (swSuperCheck >= 0x70) // 0x70 or anything else means all super enabled - { - CHK_SuperSingle.Checked = CHK_SuperDouble.Checked = CHK_SuperMulti.Checked = true; - } - else - { - if (swSuperCheck is 0x10 or 0x30 or 0x50) CHK_SuperSingle.Checked = true; - if (swSuperCheck is 0x20 or 0x30 or 0x60) CHK_SuperDouble.Checked = true; - if (swSuperCheck is 0x40 or 0x50 or 0x60) CHK_SuperMulti.Checked = true; - } + // Save Normal Checks + CHK_Subway0.Checked = sw.Flag0; + CHK_Subway1.Checked = sw.Flag1; + CHK_Subway2.Checked = sw.Flag2; + CHK_Subway7.Checked = sw.Flag3; + + // Save Super Checks + CHK_SuperSingle.Checked = sw.SuperSingle; + CHK_SuperDouble.Checked = sw.SuperDouble; + CHK_SuperMulti.Checked = sw.SuperMulti; + CHK_Subway7.Checked = sw.Flag7; // Normal // Single @@ -661,8 +656,17 @@ private void ReadSubway() private void SaveSubway() { + // Save Normal Checks + sw.Flag0 = CHK_Subway0.Checked; + sw.Flag1 = CHK_Subway1.Checked; + sw.Flag2 = CHK_Subway2.Checked; + sw.Flag3 = CHK_Subway7.Checked; + // Save Super Checks - sw.SuperCheck = ((CHK_SuperSingle.Checked ? 0x10 : 0x00) + (CHK_SuperDouble.Checked ? 0x20 : 0x00) + (CHK_SuperMulti.Checked ? 0x40 : 0x00)); + sw.SuperSingle = CHK_SuperSingle.Checked; + sw.SuperDouble = CHK_SuperDouble.Checked; + sw.SuperMulti = CHK_SuperMulti.Checked; + sw.Flag7 = CHK_Subway7.Checked; // Normal // Single