2022-11-29 21:39:54 +01:00
|
|
|
using System.Diagnostics;
|
|
|
|
|
using SteamController.Helpers;
|
|
|
|
|
|
|
|
|
|
namespace SteamController.Managers
|
|
|
|
|
{
|
|
|
|
|
public sealed class ProfileSwitcher : Manager
|
|
|
|
|
{
|
2022-11-29 22:50:07 +01:00
|
|
|
private Context.ContextState wasState;
|
2022-11-29 21:39:54 +01:00
|
|
|
|
|
|
|
|
public override void Tick(Context context)
|
|
|
|
|
{
|
2022-11-29 22:50:07 +01:00
|
|
|
if (wasState.Equals(context.State))
|
2022-11-29 21:39:54 +01:00
|
|
|
return;
|
|
|
|
|
|
2022-11-29 22:50:07 +01:00
|
|
|
if (context.State.IsActive)
|
2022-11-29 21:39:54 +01:00
|
|
|
context.SelectController();
|
|
|
|
|
else
|
|
|
|
|
context.BackToDefault();
|
|
|
|
|
|
2022-11-29 22:50:07 +01:00
|
|
|
wasState = context.State;
|
2022-11-29 21:39:54 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|