diff --git a/PowerControl/Controller.cs b/PowerControl/Controller.cs index 08526bd..dad2994 100644 --- a/PowerControl/Controller.cs +++ b/PowerControl/Controller.cs @@ -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); diff --git a/PowerControl/Resources.Designer.cs b/PowerControl/Resources.Designer.cs index fb271b9..d986e2f 100644 --- a/PowerControl/Resources.Designer.cs +++ b/PowerControl/Resources.Designer.cs @@ -69,5 +69,15 @@ namespace PowerControl { return ((System.Drawing.Icon)(obj)); } } + + /// + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// + internal static System.Drawing.Icon poll_red { + get { + object obj = ResourceManager.GetObject("poll_red", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } } } diff --git a/PowerControl/Resources.resx b/PowerControl/Resources.resx index d9b49cf..bb39ad0 100644 --- a/PowerControl/Resources.resx +++ b/PowerControl/Resources.resx @@ -121,4 +121,7 @@ Resources\poll.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Resources\poll_red.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/PowerControl/Resources/poll_red.ico b/PowerControl/Resources/poll_red.ico new file mode 100644 index 0000000..2bbc26c Binary files /dev/null and b/PowerControl/Resources/poll_red.ico differ