1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-12 21:38:38 +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();
PauseEffect = null;
if (ActiveEffect is GameModel)
Logger.Debug("Finishing change effect with pause");
if (ActiveEffect is GameModel || ActiveEffect is ProfilePreviewModel)
return;
// Non-game effects are stored as the new LastEffect.
General.Default.LastEffect = ActiveEffect.Name;
General.Default.Save();
Logger.Debug("Finishing change effect with pause");
}
/// <summary>

View File

@ -116,7 +116,15 @@ namespace Artemis.ViewModels.Abstract
else
{
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
MainManager.EffectManager.ClearEffect();
}