mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2025-12-06 07:12:01 +01:00
Since some settings impact others, the application will apply them in a correct order with a fixed delay. This additionally exposes all settings, just some of them are not persisted on create, only on change.
35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
using CommonHelpers;
|
|
|
|
namespace PowerControl.Options
|
|
{
|
|
public static class FanControl
|
|
{
|
|
public static Menu.MenuItemWithOptions Instance = new Menu.MenuItemWithOptions()
|
|
{
|
|
Name = "FAN",
|
|
PersistentKey = "FANMode",
|
|
PersistOnCreate = false,
|
|
ApplyDelay = 500,
|
|
OptionsValues = delegate ()
|
|
{
|
|
return Enum.GetNames<FanMode>();
|
|
},
|
|
CurrentValue = delegate ()
|
|
{
|
|
if (SharedData<FanModeSetting>.GetExistingValue(out var value))
|
|
return value.Current.ToString();
|
|
return null;
|
|
},
|
|
ApplyValue = (selected) =>
|
|
{
|
|
if (!SharedData<FanModeSetting>.GetExistingValue(out var value))
|
|
return null;
|
|
value.Desired = Enum.Parse<FanMode>(selected);
|
|
if (!SharedData<FanModeSetting>.SetExistingValue(value))
|
|
return null;
|
|
return selected;
|
|
}
|
|
};
|
|
}
|
|
}
|