Skip to content

Commit

Permalink
Pre-release fixes #3
Browse files Browse the repository at this point in the history
  • Loading branch information
CatmanFan committed Mar 23, 2024
1 parent 0193c88 commit 28629ca
Show file tree
Hide file tree
Showing 8 changed files with 296 additions and 60 deletions.
6 changes: 6 additions & 0 deletions FriishProduce/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@
<setting name="Default_SEGA_SRAM" serializeAs="String">
<value>1</value>
</setting>
<setting name="Default_SEGA_Brightness" serializeAs="String">
<value>87</value>
</setting>
<setting name="Default_SEGA_Region" serializeAs="String">
<value>us</value>
</setting>
</FriishProduce.Properties.Settings>
</userSettings>
<runtime>
Expand Down
24 changes: 24 additions & 0 deletions FriishProduce/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions FriishProduce/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,11 @@
<Setting Name="Default_SEGA_SRAM" Type="System.String" Scope="User">
<Value Profile="(Default)">1</Value>
</Setting>
<Setting Name="Default_SEGA_Brightness" Type="System.String" Scope="User">
<Value Profile="(Default)">87</Value>
</Setting>
<Setting Name="Default_SEGA_Region" Type="System.String" Scope="User">
<Value Profile="(Default)">us</Value>
</Setting>
</Settings>
</SettingsFile>
10 changes: 6 additions & 4 deletions FriishProduce/Subforms/Options_VC_SEGA.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public Options_VC_SEGA() : base()

Settings = new SortedDictionary<string, string>
{
{ "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 },
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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)
Expand Down
70 changes: 66 additions & 4 deletions FriishProduce/Subforms/SettingsForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions FriishProduce/Subforms/SettingsForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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())
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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();
}
}
Loading

0 comments on commit 28629ca

Please sign in to comment.