mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-04-04 13:57:39 +00:00
Expose OSD and Fan settings in PowerControl
This commit is contained in:
parent
44f25db836
commit
5f940c0ee4
5 changed files with 285 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using CommonHelpers;
|
||||
using CommonHelpers;
|
||||
using CommonHelpers.FromLibreHardwareMonitor;
|
||||
using Microsoft.VisualBasic.Logging;
|
||||
using PerformanceOverlay.External;
|
||||
|
|
@ -32,6 +32,8 @@ namespace PerformanceOverlay
|
|||
"Starts Performance Overlay on Windows startup."
|
||||
);
|
||||
|
||||
SharedData<OverlayModeSetting> sharedData = SharedData<OverlayModeSetting>.CreateNew();
|
||||
|
||||
public Controller()
|
||||
{
|
||||
contextMenu = new System.Windows.Forms.ContextMenuStrip(components);
|
||||
|
|
@ -142,8 +144,37 @@ namespace PerformanceOverlay
|
|||
updateContextItems(contextMenu);
|
||||
}
|
||||
|
||||
private void SharedData_Update()
|
||||
{
|
||||
if (sharedData.GetValue(out var value))
|
||||
{
|
||||
if (Enum.IsDefined<OverlayMode>(value.Desired))
|
||||
{
|
||||
Settings.Default.OSDModeParsed = (OverlayMode)value.Desired;
|
||||
Settings.Default.ShowOSD = true;
|
||||
Settings.Default.Save();
|
||||
updateContextItems(contextMenu);
|
||||
}
|
||||
|
||||
if (Enum.IsDefined<OverlayEnabled>(value.DesiredEnabled))
|
||||
{
|
||||
Settings.Default.ShowOSD = (OverlayEnabled)value.DesiredEnabled == OverlayEnabled.Yes;
|
||||
Settings.Default.Save();
|
||||
updateContextItems(contextMenu);
|
||||
}
|
||||
}
|
||||
|
||||
sharedData.SetValue(new OverlayModeSetting()
|
||||
{
|
||||
Current = Settings.Default.OSDModeParsed,
|
||||
CurrentEnabled = Settings.Default.ShowOSD ? OverlayEnabled.Yes : OverlayEnabled.No
|
||||
});
|
||||
}
|
||||
|
||||
private void OsdTimer_Tick(object? sender, EventArgs e)
|
||||
{
|
||||
SharedData_Update();
|
||||
|
||||
try
|
||||
{
|
||||
notifyIcon.Text = TitleWithVersion + ". RTSS Version: " + OSD.Version;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue