From 8f31e4ed00bcd74611654bb97101a6b6941f00f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Wed, 8 Feb 2023 15:40:08 +0100 Subject: [PATCH] SteamController: Fix Steam Big Picture detection for non-english --- RELEASE.md | 1 + SteamController/Managers/SteamManager.cs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/RELEASE.md b/RELEASE.md index a961b24..2f7bbd5 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -9,6 +9,7 @@ ## 0.6.x +- SteamController: Fix Steam Big Picture detection for non-english - PowerControl: Allow user to configure selectable TDP, CPU and GPU from `PowerControl.dll.ini` - SteamController: Promote RTSS detection to Release - enable by default - SteamController: Improve detection of Steam processes (especially latest controller UI changes) diff --git a/SteamController/Managers/SteamManager.cs b/SteamController/Managers/SteamManager.cs index ce19def..b50e8c5 100644 --- a/SteamController/Managers/SteamManager.cs +++ b/SteamController/Managers/SteamManager.cs @@ -1,6 +1,7 @@ using System.Diagnostics; using System.Runtime.InteropServices; using System.Text; +using System.Text.RegularExpressions; using SteamController.Helpers; namespace SteamController.Managers @@ -13,7 +14,7 @@ namespace SteamController.Managers new Classifier() { Type = "possiblegamepadui", ClassName = "SDL_app", WindowTextPrefix = "SP", ProcessName = "steamwebhelper" }, // Support Steam client released around 2023-01-20, version: 1674182294 - new Classifier() { Type = "gamepadui_2023_01_20", ClassName = "SDL_app", WindowText = "Steam Big Picture Mode", ProcessName = "steamwebhelper" }, + new Classifier() { Type = "gamepadui_2023_01_20", ClassName = "SDL_app", ProcessName = "steamwebhelper" }, new Classifier() { Type = "controllerui_2023_01_20", ClassName = "CUIEngineWin32", ProcessName = "steam" }, // new Classifier() { Type = "possiblegamepadui_2023_01_20", ClassName = "SDL_app", WindowTextSuffix = "Controller Layout", ProcessName = "steamwebhelper" }, }; @@ -125,6 +126,7 @@ namespace SteamController.Managers public String? WindowText { get; set; } public String? WindowTextPrefix { get; set; } public String? WindowTextSuffix { get; set; } + public Regex? WindowTextRegex { get; set; } public String? ProcessName { get; set; } public bool Match(string className, string windowText, string processName) @@ -133,6 +135,8 @@ namespace SteamController.Managers return false; if (WindowText is not null && windowText != WindowText) return false; + if (WindowTextRegex is not null && WindowTextRegex.IsMatch(windowText)) + return false; if (WindowTextPrefix is not null && !windowText.StartsWith(WindowTextPrefix)) return false; if (WindowTextSuffix is not null && !windowText.EndsWith(WindowTextSuffix))