Fix some crashes and UI bugs

Audio manager crashed after loading a second song

Color Picker and ArtPad palette entries were not appearing properly.

Fonts in Shifter could not have decimal sizes.
This commit is contained in:
Michael 2017-01-29 20:45:32 -05:00
parent 11f838ea23
commit 90802ccb55
4 changed files with 25 additions and 5 deletions

View file

@ -54,6 +54,7 @@ namespace ShiftOS.WinForms.Applications
try
{
InitializeComponent();
}
catch (Exception ex)
{
@ -1851,7 +1852,11 @@ namespace ShiftOS.WinForms.Applications
public void OnLoad()
{
foreach (Control ctrl in flowcolours.Controls)
{
ctrl.Tag = "keepbg";
ctrl.BackColor = Color.Black;
}
}
public void OnSkinLoad()

View file

@ -62,54 +62,65 @@ namespace ShiftOS.WinForms.Applications
foreach (Control ctrl in pnlanycolours.Controls)
{
ctrl.MouseDown += new MouseEventHandler(this.colourselctionany);
ctrl.Tag = "keepbg";
}
foreach (Control ctrl in pnlgraycolours.Controls)
{
ctrl.Tag = "keepbg";
ctrl.MouseDown += new MouseEventHandler(this.colourselctiongray);
}
foreach (Control ctrl in pnlredcolours.Controls)
{
ctrl.Tag = "keepbg";
ctrl.MouseDown += new MouseEventHandler(this.colourselctionred);
}
foreach (Control ctrl in pnlgreencolours.Controls)
{
ctrl.Tag = "keepbg";
ctrl.MouseDown += new MouseEventHandler(this.colourselctiongreen);
}
foreach (Control ctrl in pnlbluecolours.Controls)
{
ctrl.Tag = "keepbg";
ctrl.MouseDown += new MouseEventHandler(this.colourselctionblue);
}
foreach (Control ctrl in pnlorangecolours.Controls)
{
ctrl.Tag = "keepbg";
ctrl.MouseDown += new MouseEventHandler(this.colourselctionorange);
}
foreach (Control ctrl in pnlyellowcolours.Controls)
{
ctrl.Tag = "keepbg";
ctrl.MouseDown += new MouseEventHandler(this.colourselctionyellow);
}
foreach (Control ctrl in pnlbrowncolours.Controls)
{
ctrl.Tag = "keepbg";
ctrl.MouseDown += new MouseEventHandler(this.colourselctionbrown);
}
foreach (Control ctrl in pnlpurplecolours.Controls)
{
ctrl.Tag = "keepbg";
ctrl.MouseDown += new MouseEventHandler(this.colourselctionpurple);
}
foreach (Control ctrl in pnlpinkcolours.Controls)
{
ctrl.Tag = "keepbg";
ctrl.MouseDown += new MouseEventHandler(this.colourselctionpink);
}
pnloldcolour.Tag = "keepbg";
pnloldcolour.Click += new EventHandler(pnloldcolour_Click);
pnlnewcolour.Click += new EventHandler(pnlnewcolour_Click);
pnlnewcolour.Tag = "keepbg";
}
public int anylevel = 0;

View file

@ -379,7 +379,7 @@ namespace ShiftOS.WinForms.Applications
var f = en[style.SelectedIndex];
c.Field.SetValue(LoadedSkin, new Font(name.Text, (float)Convert.ToInt32(size.Text), f));
c.Field.SetValue(LoadedSkin, new Font(name.Text, (float)Convert.ToDouble(size.Text), f));
CodepointValue += 100;
};
@ -389,7 +389,7 @@ namespace ShiftOS.WinForms.Applications
var f = en[style.SelectedIndex];
c.Field.SetValue(LoadedSkin, new Font(name.Text, (float)Convert.ToInt32(size.Text), f));
c.Field.SetValue(LoadedSkin, new Font(name.Text, (float)Convert.ToDouble(size.Text), f));
CodepointValue += 50;
};
@ -401,7 +401,7 @@ namespace ShiftOS.WinForms.Applications
var f = en[style.SelectedIndex];
c.Field.SetValue(LoadedSkin, new Font(name.Text, (float)Convert.ToInt32(size.Text), f));
c.Field.SetValue(LoadedSkin, new Font(name.Text, (float)Convert.ToDouble(size.Text), f));
}
catch
{

View file

@ -45,6 +45,8 @@ namespace ShiftOS.Engine
{
Thread.Sleep(5000); //even when the player isn't playing, this will give a good delay between songs.
}
_reader.Dispose();
_out.Dispose();
}
});
t.IsBackground = true;
@ -56,6 +58,8 @@ namespace ShiftOS.Engine
_provider.Volume = volume; //persist between songs
_out.Volume = volume;
}
}
public interface IAudioProvider