Remote gestures handlers components creation based on current settings

Methods renames
This commit is contained in:
SDraw 2024-08-18 15:47:39 +03:00
parent e5d4ea9d29
commit b38187d6ef
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
36 changed files with 308 additions and 240 deletions

View file

@ -1,6 +1,5 @@
using ABI_RC.Core.Player;
using ABI_RC.Core.Util.AssetFiltering;
using ABI_RC.Systems.GameEventSystem;
using System;
using System.Collections.Generic;
using System.Reflection;
@ -17,8 +16,7 @@ namespace ml_prm
ModUi.Init();
GameEvents.Init(HarmonyInstance);
WorldHandler.Init();
CVRGameEventSystem.Player.OnJoinEntity.AddListener(this.OnRemotePlayerCreated);
RemoteGestureManager.Init();
MelonLoader.MelonCoroutines.Start(WaitForLocalPlayer());
MelonLoader.MelonCoroutines.Start(WaitForWhitelist());
@ -27,12 +25,11 @@ namespace ml_prm
public override void OnDeinitializeMelon()
{
WorldHandler.DeInit();
RemoteGestureManager.DeInit();
if(m_localController != null)
UnityEngine.Object.Destroy(m_localController);
m_localController = null;
CVRGameEventSystem.Player.OnJoinEntity.RemoveListener(this.OnRemotePlayerCreated);
}
System.Collections.IEnumerator WaitForLocalPlayer()
@ -55,11 +52,5 @@ namespace ml_prm
}
l_hashSet.Add(typeof(RagdollToggle));
}
void OnRemotePlayerCreated(CVRPlayerEntity p_player)
{
if((p_player != null) && (p_player.PuppetMaster != null))
p_player.PuppetMaster.gameObject.AddComponent<RemoteGestureHandler>();
}
}
}