From 22b5b5900376be3ae3a79be258339045bd9fee9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Tue, 29 Nov 2022 23:25:30 +0100 Subject: [PATCH] Remove `SteamConfigPath` from `SteamConfiguration` --- SteamController/Helpers/SteamConfiguration.cs | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/SteamController/Helpers/SteamConfiguration.cs b/SteamController/Helpers/SteamConfiguration.cs index 9ff8e36..6a8396c 100644 --- a/SteamController/Helpers/SteamConfiguration.cs +++ b/SteamController/Helpers/SteamConfiguration.cs @@ -71,17 +71,6 @@ namespace SteamController.Helpers get { return GetValue2(SteamKey, SteamPathValue); } } - public static String? SteamConfigPath - { - get - { - var path = SteamPath; - if (path is null) - return null; - return Path.Join(SteamPath, RelativeConfigPath); - } - } - private static Process? SteamProcess { get @@ -102,6 +91,14 @@ namespace SteamController.Helpers } } + public static String? GetConfigPath(String configPath) + { + var path = SteamPath; + if (path is null) + return null; + return Path.Join(SteamPath, configPath); + } + public static bool ShutdownSteam() { var steamExe = SteamExe; @@ -154,7 +151,7 @@ namespace SteamController.Helpers { try { - var configPath = SteamConfigPath; + var configPath = GetConfigPath(RelativeConfigPath); if (configPath is null) return null; @@ -187,9 +184,9 @@ namespace SteamController.Helpers return controllers.Contains(id); } - public static bool BackupSteamConfig() + public static bool BackupSteamConfig(String path) { - var configPath = SteamConfigPath; + var configPath = GetConfigPath(path); if (configPath is null) return true; @@ -205,12 +202,17 @@ namespace SteamController.Helpers } } + public static bool BackupSteamConfig() + { + return BackupSteamConfig(RelativeConfigPath); + } + public static bool UpdateControllerBlacklist(ushort vendorId, ushort productId, bool add) { if (IsRunning) return false; - var configPath = SteamConfigPath; + var configPath = GetConfigPath(RelativeConfigPath); if (configPath is null) return false;