mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2025-12-06 07:12:01 +01:00
27 lines
671 B
C#
27 lines
671 B
C#
|
|
using RTSSSharedMemoryNET;
|
|||
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Text;
|
|||
|
|
using System.Threading.Tasks;
|
|||
|
|
|
|||
|
|
namespace CommonHelpers
|
|||
|
|
{
|
|||
|
|
public static class OSDHelpers
|
|||
|
|
{
|
|||
|
|
public static uint OSDIndex(this OSD? osd)
|
|||
|
|
{
|
|||
|
|
if (osd is null)
|
|||
|
|
return uint.MaxValue;
|
|||
|
|
|
|||
|
|
var osdSlot = typeof(OSD).GetField("m_osdSlot",
|
|||
|
|
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
|
|||
|
|
var value = osdSlot.GetValue(osd);
|
|||
|
|
if (value is null)
|
|||
|
|
return uint.MaxValue;
|
|||
|
|
|
|||
|
|
return (uint)value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|