mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-04 07:19:22 +00:00
[DesktopVRSwitch] Testing
This commit is contained in:
parent
03514305be
commit
61a45f97bc
30 changed files with 957 additions and 524 deletions
30
DesktopVRSwitch/VRModeTrackers/HudOperationsTracker.cs
Normal file
30
DesktopVRSwitch/VRModeTrackers/HudOperationsTracker.cs
Normal file
|
@ -0,0 +1,30 @@
|
|||
using ABI_RC.Core.Player;
|
||||
|
||||
namespace NAK.DesktopVRSwitch.VRModeTrackers;
|
||||
|
||||
public class HudOperationsTracker : VRModeTracker
|
||||
{
|
||||
public override void TrackerInit()
|
||||
{
|
||||
VRModeSwitchManager.OnPostVRModeSwitch += OnPostSwitch;
|
||||
}
|
||||
|
||||
public override void TrackerDestroy()
|
||||
{
|
||||
VRModeSwitchManager.OnPostVRModeSwitch -= OnPostSwitch;
|
||||
}
|
||||
|
||||
private void OnPostSwitch(bool intoVR)
|
||||
{
|
||||
HudOperations _hudOperations = HudOperations.Instance;
|
||||
if (_hudOperations == null)
|
||||
{
|
||||
DesktopVRSwitch.Logger.Error("Error while getting HudOperations!");
|
||||
return;
|
||||
}
|
||||
DesktopVRSwitch.Logger.Msg("Switching HudOperations worldLoadingItem & worldLoadStatus.");
|
||||
|
||||
_hudOperations.worldLoadingItem = intoVR ? _hudOperations.worldLoadingItemVr : _hudOperations.worldLoadingItemDesktop;
|
||||
_hudOperations.worldLoadStatus = intoVR ? _hudOperations.worldLoadStatusVr : _hudOperations.worldLoadStatusDesktop;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue