From e7835467375beb7970dc4cfa95645561e1415cd1 Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 13 Dec 2016 20:13:32 -0800 Subject: [PATCH] Add SOS only checkbox Closes #70 --- pk3DS/Subforms/Gen7/SMWE.Designer.cs | 13 +++++++++++++ pk3DS/Subforms/Gen7/SMWE.cs | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/pk3DS/Subforms/Gen7/SMWE.Designer.cs b/pk3DS/Subforms/Gen7/SMWE.Designer.cs index 845fc37..b051d2e 100644 --- a/pk3DS/Subforms/Gen7/SMWE.Designer.cs +++ b/pk3DS/Subforms/Gen7/SMWE.Designer.cs @@ -254,6 +254,7 @@ private void InitializeComponent() this.CB_TableID = new System.Windows.Forms.ComboBox(); this.B_Export = new System.Windows.Forms.Button(); this.CopySOS = new System.Windows.Forms.Button(); + this.CHK_SOS = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.NUP_Min)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NUP_Max)).BeginInit(); this.GB_Encounters.SuspendLayout(); @@ -697,6 +698,7 @@ private void InitializeComponent() this.GB_Tweak.Controls.Add(this.B_LevelPlus); this.GB_Tweak.Controls.Add(this.NUD_LevelAmp); this.GB_Tweak.Controls.Add(this.CHK_Level); + this.GB_Tweak.Controls.Add(this.CHK_SOS); this.GB_Tweak.Location = new System.Drawing.Point(14, 427); this.GB_Tweak.Name = "GB_Tweak"; this.GB_Tweak.Size = new System.Drawing.Size(282, 120); @@ -3020,6 +3022,16 @@ private void InitializeComponent() this.CopySOS.UseVisualStyleBackColor = true; this.CopySOS.Click += new System.EventHandler(this.CopySOS_Click); // + // CHK_SOS + // + this.CHK_SOS.AutoSize = true; + this.CHK_SOS.Location = new System.Drawing.Point(152, 37); + this.CHK_SOS.Name = "CHK_SOS"; + this.CHK_SOS.Size = new System.Drawing.Size(98, 17); + this.CHK_SOS.TabIndex = 297; + this.CHK_SOS.Text = "SOS Slots Only"; + this.CHK_SOS.UseVisualStyleBackColor = true; + // // SMWE // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -3371,5 +3383,6 @@ private void InitializeComponent() private System.Windows.Forms.NumericUpDown NUD_LevelAmp; private System.Windows.Forms.CheckBox CHK_Level; private System.Windows.Forms.Button CopySOS; + private System.Windows.Forms.CheckBox CHK_SOS; } } \ No newline at end of file diff --git a/pk3DS/Subforms/Gen7/SMWE.cs b/pk3DS/Subforms/Gen7/SMWE.cs index ae6496b..579fdf1 100644 --- a/pk3DS/Subforms/Gen7/SMWE.cs +++ b/pk3DS/Subforms/Gen7/SMWE.cs @@ -532,6 +532,7 @@ private void B_Randomize_Click(object sender, EventArgs e) if (Util.Prompt(MessageBoxButtons.YesNo, "Randomize all? Cannot undo.", "Double check Randomization settings.") != DialogResult.Yes) return; Enabled = false; + int setSkip = CHK_SOS.Checked ? 1 : 0; // Calculate % diff we will apply to each level decimal leveldiff = (100 + NUD_LevelAmp.Value) / 100; @@ -552,7 +553,7 @@ private void B_Randomize_Click(object sender, EventArgs e) Table.MaxLevel = Math.Max(1, Math.Min(100, (int)(leveldiff * Table.MaxLevel))); } - foreach (var EncounterSet in Table.Encounters) + foreach (var EncounterSet in Table.Encounters.Skip(setSkip)) // Skip regular slots if checked { foreach (var encounter in EncounterSet) {