mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-04-05 06:15:26 +00:00
PowerControl: Decompose MenuStack.cs into Options/
This commit is contained in:
parent
ebe1cdba87
commit
f207c12935
18 changed files with 660 additions and 528 deletions
36
PowerControl/Options/SMT.cs
Normal file
36
PowerControl/Options/SMT.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using CommonHelpers;
|
||||
using PowerControl.Helpers;
|
||||
|
||||
namespace PowerControl.Options
|
||||
{
|
||||
public static class SMT
|
||||
{
|
||||
public static Menu.MenuItemWithOptions Instance = new Menu.MenuItemWithOptions()
|
||||
{
|
||||
Name = "SMT",
|
||||
ApplyDelay = 500,
|
||||
Options = { "No", "Yes" },
|
||||
ResetValue = () => { return "Yes"; },
|
||||
CurrentValue = delegate ()
|
||||
{
|
||||
if (!RTSS.IsOSDForeground(out var processId))
|
||||
return null;
|
||||
if (!ProcessorCores.HasSMTThreads())
|
||||
return null;
|
||||
|
||||
return ProcessorCores.IsUsingSMT(processId.Value) ? "Yes" : "No";
|
||||
},
|
||||
ApplyValue = delegate (object selected)
|
||||
{
|
||||
if (!RTSS.IsOSDForeground(out var processId))
|
||||
return null;
|
||||
if (!ProcessorCores.HasSMTThreads())
|
||||
return null;
|
||||
|
||||
ProcessorCores.SetProcessSMT(processId.Value, selected.ToString() == "Yes");
|
||||
|
||||
return ProcessorCores.IsUsingSMT(processId.Value) ? "Yes" : "No";
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue