Fixed effects freezing when changing the active keyboard

This commit is contained in:
SpoinkyNL committed 2016-03-17 10:05:18 +01:00
1 parent 3fc2d52eac
commit 9f5c2855bf
2 files changed
+12 -19

No files matched your search

+7 -14
View File
@@ -120,8 +120,15 @@ namespace Artemis.Managers
private void FinishStop(object sender, RunWorkerCompletedEventArgs e)
{
UpdateWorker.RunWorkerCompleted -= FinishStop;
KeyboardManager.ReleaseActiveKeyboard();
Running = false;
if (e.Error != null || !_restarting)
return;
Start();
_restarting = false;
}
public void Pause()
@@ -161,23 +168,9 @@ namespace Artemis.Managers
}
_restarting = true;
UpdateWorker.RunWorkerCompleted += FinishRestart;
Stop();
}
public void FinishRestart(object sender, RunWorkerCompletedEventArgs e)
{
UpdateWorker.RunWorkerCompleted -= FinishRestart;
if (e.Error != null)
return;
Start();
_restarting = false;
}
/// <summary>
/// Loads the last active effect and starts the program
/// </summary>
@@ -34,13 +34,13 @@ namespace Artemis.Modules.Effects.Debug
KeyboardRectangle = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard, 0, 0, new List<Color>
{
Color.Red,
Color.OrangeRed,
Color.Yellow,
//Color.Red,
//Color.OrangeRed,
//Color.Yellow,
Color.Green,
Color.Blue,
Color.Purple,
Color.DeepPink
//Color.Purple,
//Color.DeepPink
}, LinearGradientMode.Horizontal);
Initialized = true;