mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2025-12-06 07:12:01 +01:00
35 lines
1.2 KiB
C#
35 lines
1.2 KiB
C#
|
|
using CommonHelpers;
|
||
|
|
|
||
|
|
namespace PowerControl.Options
|
||
|
|
{
|
||
|
|
public static class SteamController
|
||
|
|
{
|
||
|
|
public static Menu.MenuItemWithOptions Instance = new Menu.MenuItemWithOptions()
|
||
|
|
{
|
||
|
|
Name = "Controller",
|
||
|
|
ApplyDelay = 500,
|
||
|
|
OptionsValues = delegate ()
|
||
|
|
{
|
||
|
|
if (SharedData<SteamControllerSetting>.GetExistingValue(out var value))
|
||
|
|
return value.SelectableProfiles.SplitWithN();
|
||
|
|
return null;
|
||
|
|
},
|
||
|
|
CurrentValue = delegate ()
|
||
|
|
{
|
||
|
|
if (SharedData<SteamControllerSetting>.GetExistingValue(out var value))
|
||
|
|
return value.CurrentProfile.Length > 0 ? value.CurrentProfile : null;
|
||
|
|
return null;
|
||
|
|
},
|
||
|
|
ApplyValue = delegate (object selected)
|
||
|
|
{
|
||
|
|
if (!SharedData<SteamControllerSetting>.GetExistingValue(out var value))
|
||
|
|
return null;
|
||
|
|
value.DesiredProfile = (String)selected;
|
||
|
|
if (!SharedData<SteamControllerSetting>.SetExistingValue(value))
|
||
|
|
return null;
|
||
|
|
return selected;
|
||
|
|
}
|
||
|
|
};
|
||
|
|
}
|
||
|
|
}
|