Compare commits

..

No commits in common. "master" and "v1.0.1" have entirely different histories.

2 changed files with 7 additions and 44 deletions

View File

@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>JBTrackIR</AssemblyName>
<Description>SPT TrackIR Support</Description>
<Version>1.0.3</Version>
<Version>1.0.1</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<RestoreAdditionalProjectSources>
@ -23,21 +23,15 @@
<Reference Include="0Harmony">
<HintPath>..\References\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Aki.Reflection">
<HintPath>..\References\Aki.Reflection.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\References\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="BepInEx">
<HintPath>..\References\BepInEx.dll</HintPath>
</Reference>
<Reference Include="spt-common">
<HintPath>..\References\spt-common.dll</HintPath>
</Reference>
<Reference Include="spt-core">
<HintPath>..\References\spt-core.dll</HintPath>
</Reference>
<Reference Include="spt-reflection">
<HintPath>..\References\spt-reflection.dll</HintPath>
</Reference>
<Reference Include="TrackIRUnity">
<HintPath>..\References\TrackIRUnity.dll</HintPath>
</Reference>

View File

@ -1,4 +1,4 @@
using SPT.Reflection.Patching;
using Aki.Reflection.Patching;
using BepInEx;
using BepInEx.Configuration;
using EFT;
@ -16,10 +16,9 @@ using UnityEngine;
namespace JBTrackIR;
[BepInPlugin("com.jonbons.trackir", "JonBons.TrackIR", "1.0.3")]
[BepInPlugin("com.jonbons.trackir", "JonBons.TrackIR", "1.0.1")]
public class Plugin : BaseUnityPlugin
{
static ConfigEntry<bool> tirRefresh;
static ConfigEntry<bool> tirEnabled;
static ConfigEntry<float> tirSensitivityCoef;
static ConfigEntry<int> tirLimitPitchLower;
@ -54,27 +53,6 @@ public class Plugin : BaseUnityPlugin
new Transpiler().Enable();
}
private void Update() {
if (tirRefresh.Value)
{
tirRefresh.BoxedValue = false;
tirRefresh.Value = false;
if (tirRunning) tirClient.TrackIR_Shutdown();
var result = tirClient.TrackIR_Enhanced_Init();
if (!string.IsNullOrEmpty(result))
{
tirRunning = true;
Logger.LogInfo($"com.jonbons.trackir: detected");
}
else
{
Logger.LogInfo($"com.jonbons.trackir: not detected");
}
}
}
private void OnDestroy()
{
if (tirClient != null && tirRunning)
@ -86,14 +64,6 @@ public class Plugin : BaseUnityPlugin
private void BindSettings()
{
tirRefresh = Config.Bind(
"Main Settings",
"Refresh TrackIR",
true,
new ConfigDescription("Refresh TrackIR detection")
);
tirEnabled = Config.Bind(
"Main Settings",
"TrackIR Enabled",
@ -204,7 +174,6 @@ public class Plugin : BaseUnityPlugin
//rot.z = Mathf.Clamp(-tid.fNPRoll * rotationReductionFactor, rollLimits.lower, rollLimits.upper);
}
__instance.HeadRotation = rot; // sync head angles
__instance.ProceduralWeaponAnimation.SetHeadRotation(rot);
//Logger.LogInfo(string.Format("TIR DATA Final pos = {0}; Final rot = {1}", pos, rot));
}