-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from nicoco007/fpfc-improvements-and-fixes
FPFC improvements and fixes for 1.31.1
- Loading branch information
Showing
8 changed files
with
81 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,30 @@ | ||
using SiraUtil.Affinity; | ||
using UnityEngine; | ||
|
||
namespace SiraUtil.Tools.FPFC | ||
{ | ||
internal class FPFCFixDaemon : IAffinity | ||
{ | ||
private readonly bool _isOculus; | ||
private readonly IFPFCSettings _fpfcSettings; | ||
private readonly IVRPlatformHelper _vrPlatformHelper; | ||
|
||
public FPFCFixDaemon(IFPFCSettings fpfcSettings, IVRPlatformHelper vrPlatformHelper) | ||
public FPFCFixDaemon(IFPFCSettings fpfcSettings) | ||
{ | ||
_fpfcSettings = fpfcSettings; | ||
_vrPlatformHelper = vrPlatformHelper; | ||
_isOculus = _vrPlatformHelper is OculusVRHelper; | ||
} | ||
|
||
[AffinityPatch(typeof(OculusVRHelper), nameof(OculusVRHelper.hasInputFocus), AffinityMethodType.Getter)] | ||
[AffinityPatch(typeof(UnityXRHelper), nameof(UnityXRHelper.hasInputFocus), AffinityMethodType.Getter)] | ||
protected void ForceInputFocus(ref bool __result) | ||
{ | ||
if (_isOculus && _fpfcSettings.Enabled) | ||
if (_fpfcSettings.Enabled) | ||
__result = true; | ||
} | ||
|
||
[AffinityPatch(typeof(UnityXRHelper), nameof(UnityXRHelper.GetThumbstickValue))] | ||
protected void ForceInputFocus(ref Vector2 __result) | ||
{ | ||
if (_fpfcSettings.Enabled) | ||
__result = new Vector2(Input.GetAxis("Mouse ScrollWheel"), Input.GetAxis("Mouse ScrollWheel")); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters