Skip to content

Commit

Permalink
Merge pull request #1 from Crementif/master
Browse files Browse the repository at this point in the history
Add persistent inputs
  • Loading branch information
MelonSpeedruns authored Jan 17, 2019
2 parents 08ef0af + 509fdc9 commit 6fe279b
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 24 deletions.
4 changes: 2 additions & 2 deletions BotWTWSyncer/Form1.Designer.cs

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

22 changes: 19 additions & 3 deletions BotWTWSyncer/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ public partial class Form1 : Form
public Form1()
{
InitializeComponent();
numericUpDown1.Value = Properties.Settings.Default.Latitude;
numericUpDown2.Value = Properties.Settings.Default.Longitude;
checkBox2.Checked = Properties.Settings.Default.TimeSync;
checkBox1.Checked = Properties.Settings.Default.WeatherSync;
}

public static byte[] HexStringToByteArray(string hex)
Expand Down Expand Up @@ -140,9 +144,6 @@ public void createORconnect()

button6.Enabled = false;

checkBox1.Enabled = true;
checkBox2.Enabled = true;

numericUpDown1.Enabled = false;
numericUpDown2.Enabled = false;

Expand Down Expand Up @@ -249,6 +250,9 @@ public void VerifyNumericBoxes()
else
{
button6.Enabled = true;
Properties.Settings.Default.Latitude = numericUpDown1.Value;
Properties.Settings.Default.Longitude = numericUpDown2.Value;
Properties.Settings.Default.Save();
}
}

Expand All @@ -266,5 +270,17 @@ private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs
{
System.Diagnostics.Process.Start("https://www.latlong.net/");
}

private void checkBox2_CheckStateChanged(object sender, EventArgs e)
{
Properties.Settings.Default.TimeSync = checkBox2.Checked;
Properties.Settings.Default.Save();
}

private void checkBox1_CheckStateChanged(object sender, EventArgs e)
{
Properties.Settings.Default.WeatherSync = checkBox1.Checked;
Properties.Settings.Default.Save();
}
}
}
70 changes: 57 additions & 13 deletions BotWTWSyncer/Properties/Settings.Designer.cs

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

23 changes: 17 additions & 6 deletions BotWTWSyncer/Properties/Settings.settings
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="BotWTWSyncer.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="Latitude" Type="System.Decimal" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="Longitude" Type="System.Decimal" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="WeatherSync" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="TimeSync" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings>
</SettingsFile>

0 comments on commit 6fe279b

Please sign in to comment.