1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Fixed preview not restoring effects when disabling a game

This commit is contained in:
SpoinkyNL 2016-04-27 20:04:17 +02:00
parent 32a651ffec
commit fa3b2f4792
2 changed files with 11 additions and 4 deletions

View File

@ -153,14 +153,13 @@ namespace Artemis.Managers
_mainManager.Unpause(); _mainManager.Unpause();
PauseEffect = null; PauseEffect = null;
if (ActiveEffect is GameModel) Logger.Debug("Finishing change effect with pause");
if (ActiveEffect is GameModel || ActiveEffect is ProfilePreviewModel)
return; return;
// Non-game effects are stored as the new LastEffect. // Non-game effects are stored as the new LastEffect.
General.Default.LastEffect = ActiveEffect.Name; General.Default.LastEffect = ActiveEffect.Name;
General.Default.Save(); General.Default.Save();
Logger.Debug("Finishing change effect with pause");
} }
/// <summary> /// <summary>

View File

@ -116,7 +116,15 @@ namespace Artemis.ViewModels.Abstract
else else
{ {
if (_lastEffect != null) if (_lastEffect != null)
MainManager.EffectManager.ChangeEffect(_lastEffect, true); {
// Game models are only used if they are enabled
var gameModel = _lastEffect as GameModel;
if (gameModel != null)
if (!gameModel.Enabled)
MainManager.EffectManager.GetLastEffect();
else
MainManager.EffectManager.ChangeEffect(_lastEffect, true);
}
else else
MainManager.EffectManager.ClearEffect(); MainManager.EffectManager.ClearEffect();
} }