mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-01-20 23:40:25 +01:00
Use red icon for PowerControl if RTSS is not available
This commit is contained in:
parent
b442c6fadc
commit
4de31ed48c
|
|
@ -1,4 +1,4 @@
|
|||
using CommonHelpers;
|
||||
using CommonHelpers;
|
||||
using CommonHelpers.FromLibreHardwareMonitor;
|
||||
using Microsoft.VisualBasic.Logging;
|
||||
using PowerControl.External;
|
||||
|
|
@ -89,10 +89,7 @@ namespace PowerControl
|
|||
};
|
||||
|
||||
var osdTimer = new System.Windows.Forms.Timer(components);
|
||||
osdTimer.Tick += delegate (object? sender, EventArgs e)
|
||||
{
|
||||
updateOSD();
|
||||
};
|
||||
osdTimer.Tick += OsdTimer_Tick;
|
||||
osdTimer.Interval = 250;
|
||||
osdTimer.Enabled = true;
|
||||
|
||||
|
|
@ -129,6 +126,22 @@ namespace PowerControl
|
|||
}
|
||||
}
|
||||
|
||||
private void OsdTimer_Tick(object? sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
notifyIcon.Text = TitleWithVersion + ". RTSS Version: " + OSD.Version;
|
||||
notifyIcon.Icon = Resources.poll;
|
||||
}
|
||||
catch
|
||||
{
|
||||
notifyIcon.Text = TitleWithVersion + ". RTSS Not Available.";
|
||||
notifyIcon.Icon = Resources.poll_red;
|
||||
}
|
||||
|
||||
updateOSD();
|
||||
}
|
||||
|
||||
private void NeptuneDevice_OnInputReceived(object? sender, hidapi.HidDeviceInputReceivedEventArgs e)
|
||||
{
|
||||
var input = SDCInput.FromBuffer(e.Buffer);
|
||||
|
|
|
|||
10
PowerControl/Resources.Designer.cs
generated
10
PowerControl/Resources.Designer.cs
generated
|
|
@ -69,5 +69,15 @@ namespace PowerControl {
|
|||
return ((System.Drawing.Icon)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
||||
/// </summary>
|
||||
internal static System.Drawing.Icon poll_red {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("poll_red", resourceCulture);
|
||||
return ((System.Drawing.Icon)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,4 +121,7 @@
|
|||
<data name="poll" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\poll.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="poll_red" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\poll_red.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
||||
BIN
PowerControl/Resources/poll_red.ico
Normal file
BIN
PowerControl/Resources/poll_red.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 161 KiB |
Loading…
Reference in a new issue