mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-05 11:29:23 +00:00
Props spawn notification
This commit is contained in:
parent
ba01e61ab3
commit
4481ef7489
3 changed files with 26 additions and 3 deletions
|
@ -1,5 +1,8 @@
|
|||
using ABI_RC.Core.EventSystem;
|
||||
using ABI_RC.Core.InteractionSystem;
|
||||
using ABI_RC.Core.Networking;
|
||||
using ABI_RC.Core.Util;
|
||||
using DarkRift;
|
||||
|
||||
namespace ml_aci
|
||||
{
|
||||
|
@ -12,6 +15,12 @@ namespace ml_aci
|
|||
null,
|
||||
new HarmonyLib.HarmonyMethod(typeof(AvatarChangeInfo).GetMethod(nameof(OnLocalAvatarLoad), System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static))
|
||||
);
|
||||
|
||||
HarmonyInstance.Patch(
|
||||
typeof(CVRSyncHelper).GetMethod(nameof(CVRSyncHelper.SpawnProp)),
|
||||
null,
|
||||
new HarmonyLib.HarmonyMethod(typeof(AvatarChangeInfo).GetMethod(nameof(OnPropSpawned), System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static))
|
||||
);
|
||||
}
|
||||
|
||||
static void OnLocalAvatarLoad()
|
||||
|
@ -19,5 +28,16 @@ namespace ml_aci
|
|||
if(ViewManager.Instance != null)
|
||||
ViewManager.Instance.TriggerPushNotification("Avatar changed", 1f);
|
||||
}
|
||||
|
||||
static void OnPropSpawned()
|
||||
{
|
||||
if(ViewManager.Instance != null)
|
||||
{
|
||||
if((NetworkManager.Instance != null) && (NetworkManager.Instance.GameNetwork.ConnectionState == ConnectionState.Connected))
|
||||
ViewManager.Instance.TriggerPushNotification("Prop spawned", 1f);
|
||||
else
|
||||
ViewManager.Instance.TriggerAlert("Prop Error", "Not connected to live instance", -1, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue