mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-04-06 23:03:59 +00:00
PowerControl: All options accept String
This commit is contained in:
parent
29e373d169
commit
81d4be30ce
17 changed files with 120 additions and 125 deletions
|
|
@ -13,30 +13,31 @@ namespace PowerControl.Options
|
|||
{
|
||||
if (!GPUScaling.SafeResolutionChange && !Settings.Default.EnableExperimentalFeatures)
|
||||
return null;
|
||||
return DisplayResolutionController.GetAllResolutions().Last();
|
||||
return DisplayResolutionController.GetAllResolutions().Last().ToString();
|
||||
},
|
||||
OptionsValues = delegate ()
|
||||
{
|
||||
var resolutions = DisplayResolutionController.GetAllResolutions();
|
||||
if (resolutions.Count() > 1)
|
||||
return resolutions.Select(item => (object)item).ToArray();
|
||||
return resolutions.Select(item => item.ToString()).ToArray();
|
||||
return null;
|
||||
},
|
||||
CurrentValue = delegate ()
|
||||
{
|
||||
if (!GPUScaling.SafeResolutionChange && !Settings.Default.EnableExperimentalFeatures)
|
||||
return null;
|
||||
return DisplayResolutionController.GetResolution();
|
||||
return DisplayResolutionController.GetResolution().ToString();
|
||||
},
|
||||
ApplyValue = delegate (object selected)
|
||||
ApplyValue = (selected) =>
|
||||
{
|
||||
DisplayResolutionController.SetResolution((DisplayResolutionController.DisplayResolution)selected);
|
||||
var selectedResolution = new DisplayResolutionController.DisplayResolution(selected);
|
||||
DisplayResolutionController.SetResolution(selectedResolution);
|
||||
// force refresh Refresh Rate
|
||||
RefreshRate.Instance.Update();
|
||||
// force reset and refresh of FPS limit
|
||||
FPSLimit.Instance.Reset();
|
||||
FPSLimit.Instance.Update();
|
||||
return DisplayResolutionController.GetResolution();
|
||||
return DisplayResolutionController.GetResolution().ToString();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue