mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-04-05 22:35:38 +00:00
Add RTSS Framelimit
This commit is contained in:
parent
c9accd6c4f
commit
d8b2c87cb1
3 changed files with 172 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using CommonHelpers;
|
||||
using PowerControl.External;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
|
@ -63,10 +64,59 @@ namespace PowerControl
|
|||
ApplyValue = delegate(object selected)
|
||||
{
|
||||
Helpers.PhysicalMonitorBrightnessController.SetRefreshRate((int)selected);
|
||||
Root["FPS Limit"].Update(); // force refresh FPS limit
|
||||
return Helpers.PhysicalMonitorBrightnessController.GetRefreshRate();
|
||||
}
|
||||
},
|
||||
new Menu.MenuItemWithOptions()
|
||||
{
|
||||
Name = "FPS Limit",
|
||||
ApplyDelay = 500,
|
||||
OptionsValues = delegate()
|
||||
{
|
||||
var refreshRate = Helpers.PhysicalMonitorBrightnessController.GetRefreshRate();
|
||||
return new object[]
|
||||
{
|
||||
"Off", refreshRate, refreshRate / 2, refreshRate / 4
|
||||
};
|
||||
},
|
||||
CurrentValue = delegate()
|
||||
{
|
||||
try
|
||||
{
|
||||
RTSS.LoadProfile();
|
||||
if (RTSS.GetProfileProperty("FramerateLimit", out int framerate))
|
||||
return (framerate == 0) ? "Off" : framerate;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return null;
|
||||
},
|
||||
ApplyValue = delegate(object selected)
|
||||
{
|
||||
try
|
||||
{
|
||||
int framerate = 0;
|
||||
if (selected != null && selected.ToString() != "Off")
|
||||
framerate = (int)selected;
|
||||
|
||||
RTSS.LoadProfile();
|
||||
if (!RTSS.SetProfileProperty("FramerateLimit", framerate))
|
||||
return null;
|
||||
if (!RTSS.GetProfileProperty("FramerateLimit", out framerate))
|
||||
return null;
|
||||
RTSS.SaveProfile();
|
||||
RTSS.UpdateProfiles();
|
||||
return (framerate == 0) ? "Off" : framerate;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return null;
|
||||
}
|
||||
},
|
||||
new Menu.MenuItemWithOptions()
|
||||
{
|
||||
Name = "TDP",
|
||||
Options = { "Auto", "3W", "4W", "5W", "6W", "7W", "8W", "10W", "12W", "15W" },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue