mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-04-04 22:07:40 +00:00
Move RTSSSharedMemoryNET to CommonHelpers
This commit is contained in:
parent
f9572edc79
commit
b442c6fadc
5 changed files with 37 additions and 8 deletions
|
|
@ -12,10 +12,19 @@
|
|||
<PackageReference Include="TaskScheduler" Version="2.10.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="RTSSSharedMemoryNET">
|
||||
<HintPath>RTSSSharedMemoryNET.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="inpoutx64.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="RTSSSharedMemoryNET.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
26
CommonHelpers/OSDHelpers.cs
Normal file
26
CommonHelpers/OSDHelpers.cs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
CommonHelpers/RTSSSharedMemoryNET.dll
Normal file
BIN
CommonHelpers/RTSSSharedMemoryNET.dll
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue