From 28629ca3a7bd4f798f15d27fd59747bca350f3ab Mon Sep 17 00:00:00 2001 From: CatmanFan Date: Sat, 23 Mar 2024 05:59:50 +0100 Subject: [PATCH] Pre-release fixes #3 --- FriishProduce/App.config | 6 + FriishProduce/Properties/Settings.Designer.cs | 24 ++ FriishProduce/Properties/Settings.settings | 6 + FriishProduce/Subforms/Options_VC_SEGA.cs | 10 +- .../Subforms/SettingsForm.Designer.cs | 70 +++++- FriishProduce/Subforms/SettingsForm.cs | 12 + FriishProduce/Subforms/SettingsForm.resx | 221 ++++++++++++++---- README.md | 7 +- 8 files changed, 296 insertions(+), 60 deletions(-) diff --git a/FriishProduce/App.config b/FriishProduce/App.config index 424a8a2c..ef8c2adc 100644 --- a/FriishProduce/App.config +++ b/FriishProduce/App.config @@ -67,6 +67,12 @@ 1 + + 87 + + + us + diff --git a/FriishProduce/Properties/Settings.Designer.cs b/FriishProduce/Properties/Settings.Designer.cs index 3055e289..525e7ec2 100644 --- a/FriishProduce/Properties/Settings.Designer.cs +++ b/FriishProduce/Properties/Settings.Designer.cs @@ -250,5 +250,29 @@ public string Default_SEGA_SRAM { this["Default_SEGA_SRAM"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("87")] + public string Default_SEGA_Brightness { + get { + return ((string)(this["Default_SEGA_Brightness"])); + } + set { + this["Default_SEGA_Brightness"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("us")] + public string Default_SEGA_Region { + get { + return ((string)(this["Default_SEGA_Region"])); + } + set { + this["Default_SEGA_Region"] = value; + } + } } } diff --git a/FriishProduce/Properties/Settings.settings b/FriishProduce/Properties/Settings.settings index 0fd98d0f..d6ccb6d4 100644 --- a/FriishProduce/Properties/Settings.settings +++ b/FriishProduce/Properties/Settings.settings @@ -59,5 +59,11 @@ 1 + + 87 + + + us + \ No newline at end of file diff --git a/FriishProduce/Subforms/Options_VC_SEGA.cs b/FriishProduce/Subforms/Options_VC_SEGA.cs index b2a7ce10..3d821c5b 100644 --- a/FriishProduce/Subforms/Options_VC_SEGA.cs +++ b/FriishProduce/Subforms/Options_VC_SEGA.cs @@ -15,9 +15,9 @@ public Options_VC_SEGA() : base() Settings = new SortedDictionary { - { "console.brightness", "87" }, + { "console.brightness", Default.Default_SEGA_Brightness }, { "console.disable_resetbutton", null }, - { "country", Language.Current.Name.StartsWith("ja") ? "jp" : "us" }, + { "country", Language.Current.Name.StartsWith("ja") ? "jp" : Default.Default_SEGA_Region }, { "dev.mdpad.enable_6b", Default.Default_SEGA_6B }, { "save_sram", Default.Default_SEGA_SRAM }, { "machine_md.use_4ptap", null }, @@ -53,7 +53,7 @@ protected override void ResetOptions() { if (IsSMS) Settings["dev.mdpad.enable_6b"] = null; - if (Settings["console.brightness"] == null || int.Parse(Settings["console.brightness"]) < 0 || !BrightnessValue.Enabled) Settings["console.brightness"] = IsSMS ? "87" : "100"; + if (Settings["console.brightness"] == null || int.Parse(Settings["console.brightness"]) < 0) Settings["console.brightness"] = Default.Default_SEGA_Brightness; BrightnessValue.Value = int.Parse(Settings["console.brightness"]); comboBox1.SelectedIndex = Settings["country"] == "jp" ? 2 : Settings["country"] == "eu" ? 1 : 0; @@ -65,7 +65,7 @@ protected override void ResetOptions() protected override void SaveOptions() { - Settings["console.brightness"] = label1.Text; + Settings["console.brightness"] = BrightnessValue.Enabled ? label1.Text : null; Settings["save_sram"] = checkBox1.Checked ? "1" : null; Settings["country"] = comboBox1.SelectedIndex == 2 ? "jp" : comboBox1.SelectedIndex == 1 ? "eu" : "us"; Settings["dev.mdpad.enable_6b"] = toggleSwitch1.Checked ? "1" : null; @@ -90,6 +90,8 @@ private void ChangeBrightness() pictureBox1.Image = changed; label1.Text = BrightnessValue.Value.ToString(); + + if (!BrightnessValue.Enabled) Settings["console.brightness"] = null; } private void ToggleSwitchChanged(object sender, EventArgs e) diff --git a/FriishProduce/Subforms/SettingsForm.Designer.cs b/FriishProduce/Subforms/SettingsForm.Designer.cs index 035bbf1a..a70eba10 100644 --- a/FriishProduce/Subforms/SettingsForm.Designer.cs +++ b/FriishProduce/Subforms/SettingsForm.Designer.cs @@ -71,6 +71,12 @@ private void InitializeComponent() this.panel6 = new System.Windows.Forms.Panel(); this.Sega6ButtonPad = new System.Windows.Forms.CheckBox(); this.SegaSRAM = new System.Windows.Forms.CheckBox(); + this.groupBox6 = new System.Windows.Forms.GroupBox(); + this.label1 = new System.Windows.Forms.Label(); + this.BrightnessValue = new System.Windows.Forms.TrackBar(); + this.groupBox7 = new System.Windows.Forms.GroupBox(); + this.label2 = new System.Windows.Forms.Label(); + this.comboBox1 = new System.Windows.Forms.ComboBox(); this.groupBox3.SuspendLayout(); this.n64004.SuspendLayout(); this.bottomPanel1.SuspendLayout(); @@ -88,6 +94,9 @@ private void InitializeComponent() this.panel8.SuspendLayout(); this.groupBox5.SuspendLayout(); this.panel6.SuspendLayout(); + this.groupBox6.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.BrightnessValue)).BeginInit(); + this.groupBox7.SuspendLayout(); this.SuspendLayout(); // // DefaultImageInterpolation @@ -373,7 +382,8 @@ private void InitializeComponent() // // panel6 // - this.panel6.Controls.Add(this.Sega6ButtonPad); + this.panel6.Controls.Add(this.groupBox7); + this.panel6.Controls.Add(this.groupBox6); this.panel6.Controls.Add(this.SegaSRAM); resources.ApplyResources(this.panel6, "panel6"); this.panel6.Name = "panel6"; @@ -390,6 +400,48 @@ private void InitializeComponent() this.SegaSRAM.Name = "SegaSRAM"; this.SegaSRAM.UseVisualStyleBackColor = true; // + // groupBox6 + // + this.groupBox6.Controls.Add(this.label1); + this.groupBox6.Controls.Add(this.BrightnessValue); + resources.ApplyResources(this.groupBox6, "groupBox6"); + this.groupBox6.Name = "groupBox6"; + this.groupBox6.TabStop = false; + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // + // BrightnessValue + // + resources.ApplyResources(this.BrightnessValue, "BrightnessValue"); + this.BrightnessValue.Maximum = 100; + this.BrightnessValue.Name = "BrightnessValue"; + this.BrightnessValue.Value = 100; + this.BrightnessValue.Scroll += new System.EventHandler(this.BrightnessValue_Scroll); + // + // groupBox7 + // + this.groupBox7.Controls.Add(this.label2); + this.groupBox7.Controls.Add(this.Sega6ButtonPad); + this.groupBox7.Controls.Add(this.comboBox1); + resources.ApplyResources(this.groupBox7, "groupBox7"); + this.groupBox7.Name = "groupBox7"; + this.groupBox7.TabStop = false; + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // + // comboBox1 + // + this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + resources.ApplyResources(this.comboBox1, "comboBox1"); + this.comboBox1.FormattingEnabled = true; + this.comboBox1.Name = "comboBox1"; + // // SettingsForm // this.AcceptButton = this.OK; @@ -400,13 +452,13 @@ private void InitializeComponent() this.Controls.Add(this.bottomPanel2); this.Controls.Add(this.leftSeparator); this.Controls.Add(this.TreeView); + this.Controls.Add(this.panel6); + this.Controls.Add(this.panel1); + this.Controls.Add(this.panel8); this.Controls.Add(this.panel4); this.Controls.Add(this.panel3); this.Controls.Add(this.panel2); this.Controls.Add(this.panel5); - this.Controls.Add(this.panel6); - this.Controls.Add(this.panel1); - this.Controls.Add(this.panel8); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.KeyPreview = true; this.MaximizeBox = false; @@ -440,6 +492,10 @@ private void InitializeComponent() this.groupBox5.ResumeLayout(false); this.panel6.ResumeLayout(false); this.panel6.PerformLayout(); + this.groupBox6.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.BrightnessValue)).EndInit(); + this.groupBox7.ResumeLayout(false); + this.groupBox7.PerformLayout(); this.ResumeLayout(false); } @@ -486,5 +542,11 @@ private void InitializeComponent() private System.Windows.Forms.Panel panel6; private System.Windows.Forms.CheckBox Sega6ButtonPad; private System.Windows.Forms.CheckBox SegaSRAM; + private System.Windows.Forms.GroupBox groupBox6; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TrackBar BrightnessValue; + private System.Windows.Forms.GroupBox groupBox7; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.ComboBox comboBox1; } } \ No newline at end of file diff --git a/FriishProduce/Subforms/SettingsForm.cs b/FriishProduce/Subforms/SettingsForm.cs index 745abb1f..241425d2 100644 --- a/FriishProduce/Subforms/SettingsForm.cs +++ b/FriishProduce/Subforms/SettingsForm.cs @@ -85,6 +85,11 @@ public void RefreshForm() SegaSRAM.Text = Language.Get("checkBox1", typeof(Options_VC_SEGA).Name, true); Sega6ButtonPad.Text = string.Format(Language.Get(Sega6ButtonPad, this), Language.Get(Console.SMDGEN.ToString())); + comboBox1.Items.Clear(); + comboBox1.Items.Add(Language.Get("Region.U")); + comboBox1.Items.Add(Language.Get("Region.E")); + comboBox1.Items.Add(Language.Get("Region.J")); + // ----------------------------- Language.GetComboBox(NGBios, "comboBox1", typeof(Options_VC_NeoGeo).Name); @@ -105,8 +110,11 @@ public void RefreshForm() n64003.Checked = Default.Default_N64_AllocateROM; ROMCType.SelectedIndex = Default.Default_N64_ROMC0 ? 0 : 1; + label1.Text = Default.Default_SEGA_Brightness; + BrightnessValue.Value = int.Parse(Default.Default_SEGA_Brightness); SegaSRAM.Checked = Default.Default_SEGA_SRAM == "1"; Sega6ButtonPad.Checked = Default.Default_SEGA_6B == "1"; + comboBox1.SelectedIndex = Default.Default_SEGA_Region.ToLower() == "jp" ? 0 : Default.Default_SEGA_Region.ToLower() == "eu" ? 2 : 1; switch (Default.Default_NeoGeo_BIOS.ToLower()) { @@ -162,8 +170,10 @@ private void OK_Click(object sender, EventArgs e) Default.Default_N64_AllocateROM = n64003.Checked; Default.Default_N64_ROMC0 = ROMCType.SelectedIndex == 0; + Default.Default_SEGA_Brightness = label1.Text; Default.Default_SEGA_SRAM = SegaSRAM.Checked ? "1" : null; Default.Default_SEGA_6B = Sega6ButtonPad.Checked ? "1" : null; + Default.Default_SEGA_Region = comboBox1.SelectedIndex == 0 ? "jp" : comboBox1.SelectedIndex == 2 ? "eu" : "us"; switch (NGBios.SelectedIndex) { @@ -331,5 +341,7 @@ private void ToggleSwitchChanged(object sender, EventArgs e) { if (sender == toggleSwitch1) toggleSwitchL1.Text = toggleSwitch1.Checked ? "vWii (Wii U)" : "Wii"; } + + private void BrightnessValue_Scroll(object sender, EventArgs e) => label1.Text = BrightnessValue.Value.ToString(); } } diff --git a/FriishProduce/Subforms/SettingsForm.resx b/FriishProduce/Subforms/SettingsForm.resx index f6cc3d6a..2935cdc1 100644 --- a/FriishProduce/Subforms/SettingsForm.resx +++ b/FriishProduce/Subforms/SettingsForm.resx @@ -776,7 +776,7 @@ $this - 8 + 4 True @@ -851,7 +851,7 @@ $this - 6 + 9 groupBox2 @@ -884,7 +884,7 @@ $this - 5 + 8 12, 10 @@ -974,7 +974,7 @@ $this - 4 + 7 toggleSwitchL1 @@ -1220,7 +1220,7 @@ $this - 3 + 6 PaletteBanner @@ -1358,7 +1358,7 @@ $this - 9 + 5 NGBios @@ -1420,50 +1420,32 @@ 0 - - Sega6ButtonPad - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel6 - - - 0 - - - SegaSRAM - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + True - - panel6 + + 7, 18 - - 1 + + 44, 13 - - 175, 0 + + 19 - - 549, 300 + + Region: - - 25 + + label2 - - panel6 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - $this + + groupBox7 - - 7 + + 0 True @@ -1475,7 +1457,7 @@ NoControl - 12, 32 + 10, 63 161, 18 @@ -1493,11 +1475,137 @@ System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - panel6 + groupBox7 + 1 + + + System + + + 10, 36 + + + 505, 21 + + + 18 + + + comboBox1 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox7 + + + 2 + + + 12, 34 + + + 525, 90 + + + 21 + + + System + + + groupBox7 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel6 + + 0 + + Arial, 9pt + + + 486, 21 + + + 30, 15 + + + 16 + + + 100 + + + TopRight + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox6 + + + 0 + + + False + + + 6, 18 + + + 481, 20 + + + 15 + + + BrightnessValue + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox6 + + + 1 + + + 12, 131 + + + 525, 50 + + + 15 + + + Display + + + groupBox6 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel6 + + + 1 + True @@ -1511,7 +1619,7 @@ NoControl - 12, 12 + 12, 13 81, 18 @@ -1535,7 +1643,28 @@ panel6 - 1 + 2 + + + 175, 0 + + + 549, 300 + + + 25 + + + panel6 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 True diff --git a/README.md b/README.md index 1422dfcf..d0c225fe 100644 --- a/README.md +++ b/README.md @@ -47,15 +47,10 @@ The current version of this application includes a built-in XML editor for addin ## To-Do * ***Before releasing v1.0:*** - [ ] Flash emulator options list -- [X] Tutorial section - [ ] Update Settings UI. - [ ] PCE section - - [ ] SEGA section + - [X] SEGA section - [ ] Flash section -- [X] Double-check & fix other forms - - [X] InjectorForm - - [X] MainForm - - [X] About - [ ] Check for additional bugs that need to be fixed. - [ ] Cleanup file names, other unused parts and streamline code to make it more readable. - [ ] Clean localization files and wiki.