mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-04-05 06:15:26 +00:00
SteamController: Allow to EnableDS4Support=false
This commit is contained in:
parent
af6cee0bff
commit
eb774e11fa
7 changed files with 26 additions and 10 deletions
|
|
@ -5,13 +5,16 @@ namespace SteamController.ProfilesSettings.Helpers
|
|||
{
|
||||
internal class ProfileStringConverter : TypeConverter
|
||||
{
|
||||
public static string[] Profiles = new string[0];
|
||||
public static List<Profiles.Profile> Profiles = new List<Profiles.Profile>();
|
||||
|
||||
private volatile StandardValuesCollection? collection;
|
||||
|
||||
public override StandardValuesCollection? GetStandardValues(ITypeDescriptorContext? context)
|
||||
{
|
||||
return collection ??= new StandardValuesCollection(Profiles.ToArray());
|
||||
return collection ??= new StandardValuesCollection(Profiles.
|
||||
Where((profile) => profile.Visible).
|
||||
Select((profile) => profile.Name).
|
||||
ToArray());
|
||||
}
|
||||
|
||||
public override bool GetStandardValuesSupported(ITypeDescriptorContext? context)
|
||||
|
|
@ -26,7 +29,7 @@ namespace SteamController.ProfilesSettings.Helpers
|
|||
|
||||
public override bool IsValid(ITypeDescriptorContext? context, object? value)
|
||||
{
|
||||
return Profiles.Contains(value?.ToString());
|
||||
return Profiles.Find((profile) => profile.Name == value?.ToString()) is not null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue