Add Haptic feedback and selectable profiles

This commit is contained in:
Kamil Trzciński 2022-11-25 21:28:43 +01:00
parent d0b6fb93b0
commit bad617549e
15 changed files with 356 additions and 45 deletions

View file

@ -455,6 +455,32 @@ namespace PowerControl
return null;
return selected;
}
},
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;
}
}
}
};