Skip to content

Commit

Permalink
Multi pets on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Adriano committed Aug 4, 2017
1 parent f1ddccb commit f19bf9c
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 18 deletions.
61 changes: 61 additions & 0 deletions FormOptions.Designer.cs

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

13 changes: 10 additions & 3 deletions FormOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,17 @@ private void FormOptions_Load(object sender, EventArgs e)
{
// Set up audio values
checkBox1.Checked = (Properties.Settings.Default.Volume > 0.0);
checkBox2.Checked = Properties.Settings.Default.WinForeground;
trackBar1.Value = (int)(Properties.Settings.Default.Volume * 10);
trackBar1.Enabled = checkBox1.Checked;
label2.Text = Program.Mainthread.ErrorMessages.AudioErrorMessage;
label2.Text = Program.Mainthread.ErrorMessages.AudioErrorMessage;
if (label2.Text.Length > 1)
{
trackBar1.Enabled = false;
checkBox1.Enabled = false;
}
}
checkBox2.Checked = Properties.Settings.Default.WinForeground;
trackBar2.Value = Properties.Settings.Default.AutostartPets;
}

private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
Expand Down Expand Up @@ -123,5 +124,11 @@ private void checkBox2_Click(object sender, EventArgs e)
Properties.Settings.Default.WinForeground = checkBox2.Checked;
Properties.Settings.Default.Save();
}

private void trackBar2_Scroll(object sender, EventArgs e)
{
Properties.Settings.Default.AutostartPets = trackBar2.Value;
Properties.Settings.Default.Save();
}
}
}
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.5.0")]
[assembly: AssemblyFileVersion("1.0.5.0")]
[assembly: AssemblyVersion("1.0.6.0")]
[assembly: AssemblyFileVersion("1.0.6.0")]
22 changes: 17 additions & 5 deletions Properties/Settings.Designer.cs

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

3 changes: 3 additions & 0 deletions Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@
<Setting Name="WinForeground" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="AutostartPets" Type="System.Int32" Scope="User">
<Value Profile="(Default)">1</Value>
</Setting>
</Settings>
</SettingsFile>
23 changes: 15 additions & 8 deletions StartUp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,14 +273,21 @@ private void timer1_Tick(object sender, EventArgs e)
// "A" when application starts. Add a sheep.
if (timer1.Tag.ToString() == "A")
{
timer1.Enabled = false;
timer1.Tag = "B";

AddDebugInfo(DEBUG_TYPE.info, "init application...");

xml.loadAnimations(animations);

AddSheep();
if (iSheeps < Properties.Settings.Default.AutostartPets && iSheeps < MAX_SHEEPS)
{
if (iSheeps == 0)
{
AddDebugInfo(DEBUG_TYPE.info, "init application...");
xml.loadAnimations(animations);
}

AddSheep();
}
else
{
timer1.Enabled = false;
timer1.Tag = "B";
}
}
// "0" when application should be stopped.
else if (timer1.Tag.ToString() == "0")
Expand Down
3 changes: 3 additions & 0 deletions app.config
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
<setting name="WinForeground" serializeAs="String">
<value>False</value>
</setting>
<setting name="AutostartPets" serializeAs="String">
<value>1</value>
</setting>
</DesktopPet.Properties.Settings>
</userSettings>
</configuration>

0 comments on commit f19bf9c

Please sign in to comment.