mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-03-09 22:43:57 +01:00
Add additional debug information
This commit is contained in:
parent
b0863b89ef
commit
6e84fc2043
|
|
@ -29,6 +29,15 @@ namespace SteamController
|
|||
{
|
||||
get { return GameProcessRunning || SteamUsesSteamInput || SteamUsesSteamInput; }
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string reason = "state";
|
||||
if (GameProcessRunning) reason += " game";
|
||||
if (SteamUsesX360Controller) reason += " steamX360";
|
||||
if (SteamUsesSteamInput) reason += " steamInput";
|
||||
return reason;
|
||||
}
|
||||
}
|
||||
|
||||
public bool RequestEnable { get; set; } = true;
|
||||
|
|
@ -151,7 +160,7 @@ namespace SteamController
|
|||
|
||||
if (current.IsDesktop)
|
||||
{
|
||||
TraceLine("Context: SelectController");
|
||||
TraceLine("Context: SelectController. State={0}", State);
|
||||
SelectNext();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ namespace SteamController.Managers
|
|||
{
|
||||
public sealed class SteamManager : Manager
|
||||
{
|
||||
private bool lastState;
|
||||
private string? lastState;
|
||||
|
||||
public override void Tick(Context context)
|
||||
{
|
||||
|
|
@ -13,15 +13,15 @@ namespace SteamController.Managers
|
|||
{
|
||||
context.State.SteamUsesSteamInput = false;
|
||||
context.State.SteamUsesX360Controller = false;
|
||||
lastState = false;
|
||||
lastState = null;
|
||||
return;
|
||||
}
|
||||
|
||||
var usesController = UsesController() ?? false;
|
||||
var usesController = UsesController();
|
||||
if (lastState == usesController)
|
||||
return;
|
||||
|
||||
if (usesController)
|
||||
if (usesController is not null)
|
||||
{
|
||||
context.State.SteamUsesSteamInput = Helpers.SteamConfiguration.IsControllerBlacklisted(
|
||||
Devices.SteamController.VendorID,
|
||||
|
|
@ -40,17 +40,29 @@ namespace SteamController.Managers
|
|||
}
|
||||
|
||||
lastState = usesController;
|
||||
|
||||
#if DEBUG
|
||||
CommonHelpers.Log.TraceLine(
|
||||
"SteamManager: uses={0}, isRunning={1}, usesSteamInput={2}, usesX360={3}",
|
||||
usesController,
|
||||
SteamConfiguration.IsRunning,
|
||||
context.State.SteamUsesSteamInput,
|
||||
context.State.SteamUsesX360Controller
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
private bool? UsesController()
|
||||
private string? UsesController()
|
||||
{
|
||||
if (!SteamConfiguration.IsRunning)
|
||||
return null;
|
||||
|
||||
return
|
||||
SteamConfiguration.IsBigPictureMode.GetValueOrDefault(false) ||
|
||||
SteamConfiguration.IsRunningGame.GetValueOrDefault(false) ||
|
||||
SteamConfiguration.IsGamePadUI;
|
||||
if (SteamConfiguration.IsBigPictureMode.GetValueOrDefault(false))
|
||||
return "bigpicture";
|
||||
if (SteamConfiguration.IsRunningGame.GetValueOrDefault(false))
|
||||
return "game";
|
||||
if (SteamConfiguration.IsGamePadUI)
|
||||
return "gamepadui";
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue