Skip to content

Commit 3f00ff0

Browse files
committed
Migrate to BSIPA 4
1 parent 9f4874e commit 3f00ff0

14 files changed

+73
-48
lines changed

Libraries/0Harmony.1.2.0.1.dll

-112 KB
Binary file not shown.

Libraries/0Harmony.dll

708 KB
Binary file not shown.

Libraries/IPA.Injector.dll

1.5 KB
Binary file not shown.

Libraries/IPA.Loader.dll

91.5 KB
Binary file not shown.
-660 KB
Binary file not shown.

Libraries/Newtonsoft.Json.dll

684 KB
Binary file not shown.

Packaging/DynamicOpenVR/Plugins/DynamicOpenVR.manifest

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@
77
"name": "DynamicOpenVR",
88
"version": "0.2.0",
99
"features": [],
10-
"dependsOn": {}
10+
"dependsOn": {},
11+
"files": [
12+
"Libs\\DynamicOpenVR.dll"
13+
]
1114
}

Source/DynamicOpenVR.BeatSaber/BeatSaberInputPatches.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// You should have received a copy of the GNU Affero General Public License
1515
// along with this program. If not, see http://www.gnu.org/licenses/.
1616

17-
using Harmony;
17+
using HarmonyLib;
1818
using System;
1919
using UnityEngine.XR;
2020

Source/DynamicOpenVR.BeatSaber/DynamicOpenVR.BeatSaber.csproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
<WarningLevel>4</WarningLevel>
3232
</PropertyGroup>
3333
<ItemGroup>
34-
<Reference Include="0Harmony.1.2.0.1">
35-
<HintPath>..\..\Libraries\0Harmony.1.2.0.1.dll</HintPath>
34+
<Reference Include="0Harmony">
35+
<HintPath>..\..\Libraries\0Harmony.dll</HintPath>
3636
</Reference>
3737
<Reference Include="HMLib">
3838
<HintPath>..\..\Libraries\HMLib.dll</HintPath>
@@ -46,8 +46,9 @@
4646
<Reference Include="Main">
4747
<HintPath>..\..\Libraries\Main.dll</HintPath>
4848
</Reference>
49-
<Reference Include="Newtonsoft.Json.12.0.0.0">
50-
<HintPath>..\..\Libraries\Newtonsoft.Json.12.0.0.0.dll</HintPath>
49+
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
50+
<SpecificVersion>False</SpecificVersion>
51+
<HintPath>..\..\Libraries\Newtonsoft.Json.dll</HintPath>
5152
</Reference>
5253
<Reference Include="System" />
5354
<Reference Include="System.Core" />
@@ -75,6 +76,7 @@
7576
<Compile Include="IPALogHandler.cs" />
7677
<Compile Include="MessageBox.cs" />
7778
<Compile Include="NativeMethods.cs" />
79+
<Compile Include="OpenVREventHandler.cs" />
7880
<Compile Include="Plugin.cs" />
7981
<Compile Include="Properties\AssemblyInfo.cs" />
8082
<Compile Include="BeatSaberInputPatches.cs" />
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Runtime.InteropServices;
4+
using UnityEngine;
5+
using Valve.VR;
6+
7+
namespace DynamicOpenVR.BeatSaber
8+
{
9+
internal class OpenVREventHandler : MonoBehaviour
10+
{
11+
private readonly HashSet<EVREventType> _pauseEvents = new HashSet<EVREventType>(new [] { EVREventType.VREvent_InputFocusCaptured, EVREventType.VREvent_DashboardActivated, EVREventType.VREvent_OverlayShown });
12+
13+
public event Action onGamePaused;
14+
15+
private void Update()
16+
{
17+
VREvent_t evt = default;
18+
if (OpenVR.System.PollNextEvent(ref evt, (uint)Marshal.SizeOf(typeof(VREvent_t))) && _pauseEvents.Contains((EVREventType) evt.eventType))
19+
{
20+
onGamePaused?.Invoke();
21+
}
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)