mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-01-12 19:50:00 +01:00
61 lines
2.2 KiB
C#
61 lines
2.2 KiB
C#
using PowerControl.Helpers;
|
|
using PowerControl.Helpers.AMD;
|
|
|
|
namespace PowerControl.Options
|
|
{
|
|
public static class Resolution
|
|
{
|
|
public static Menu.MenuItemWithOptions Instance = new Menu.MenuItemWithOptions()
|
|
{
|
|
Name = "Resolution",
|
|
PersistentKey = "Resolution",
|
|
ApplyDelay = 1000,
|
|
ResetValue = () =>
|
|
{
|
|
if (!GPUScaling.SafeResolutionChange && !Settings.Default.EnableExperimentalFeatures)
|
|
return null;
|
|
return DisplayResolutionController.GetAllResolutions().Last().ToString();
|
|
},
|
|
OptionsValues = delegate ()
|
|
{
|
|
var resolutions = DisplayResolutionController.GetAllResolutions();
|
|
if (resolutions.Count() > 1)
|
|
return resolutions.Select(item => item.ToString()).ToArray();
|
|
return null;
|
|
},
|
|
CurrentValue = delegate ()
|
|
{
|
|
if (!GPUScaling.SafeResolutionChange && !Settings.Default.EnableExperimentalFeatures)
|
|
return null;
|
|
return DisplayResolutionController.GetResolution().ToString();
|
|
},
|
|
ApplyValue = (selected) =>
|
|
{
|
|
var selectedResolution = new DisplayResolutionController.DisplayResolution(selected);
|
|
|
|
if (ExternalHelpers.DisplayConfig.IsInternalConnected == true)
|
|
{
|
|
ModeTiming.AddTiming(new Helpers.AMD.ADLDisplayModeX2()
|
|
{
|
|
PelsWidth = selectedResolution.Width,
|
|
PelsHeight = selectedResolution.Height,
|
|
RefreshRate = DisplayResolutionController.GetRefreshRate(),
|
|
TimingStandard = Helpers.AMD.ADL.ADL_DL_MODETIMING_STANDARD_CVT,
|
|
});
|
|
}
|
|
else
|
|
{
|
|
DisplayResolutionController.SetResolution(selectedResolution);
|
|
}
|
|
|
|
return DisplayResolutionController.GetResolution().ToString();
|
|
},
|
|
Impacts =
|
|
{
|
|
RefreshRate.Instance,
|
|
FPSLimit.Instance
|
|
}
|
|
};
|
|
}
|
|
}
|