Rays layer fix

Desktop tracking scale fix
More notifications
This commit is contained in:
SDraw 2023-01-29 19:55:22 +03:00
parent fbad3fdf8e
commit 6bc448d41d
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
8 changed files with 118 additions and 45 deletions

View file

@ -1,5 +1,6 @@
using ABI_RC.Core.EventSystem;
using ABI_RC.Core.InteractionSystem;
using ABI_RC.Core.IO;
using ABI_RC.Core.Networking;
using ABI_RC.Core.Util;
using DarkRift.Client;
@ -28,6 +29,24 @@ namespace ml_egn
null,
new HarmonyLib.HarmonyMethod(typeof(ExtendedGameNotifications).GetMethod(nameof(OnGameNetworkConnectionClosed), BindingFlags.NonPublic | BindingFlags.Static))
);
HarmonyInstance.Patch(
typeof(CVRCamImageSaver).GetMethod(nameof(CVRCamImageSaver.SavePicture), BindingFlags.Public | BindingFlags.Static),
null,
new HarmonyLib.HarmonyMethod(typeof(ExtendedGameNotifications).GetMethod(nameof(OnPictureSave), BindingFlags.NonPublic | BindingFlags.Static))
);
HarmonyInstance.Patch(
typeof(CVRSyncHelper).GetMethod(nameof(CVRSyncHelper.DeleteAllProps), BindingFlags.Public | BindingFlags.Static),
null,
new HarmonyLib.HarmonyMethod(typeof(ExtendedGameNotifications).GetMethod(nameof(OnAllPropsDelete), BindingFlags.NonPublic | BindingFlags.Static))
);
HarmonyInstance.Patch(
typeof(CVRSyncHelper).GetMethod(nameof(CVRSyncHelper.DeleteMyProps), BindingFlags.Public | BindingFlags.Static),
null,
new HarmonyLib.HarmonyMethod(typeof(ExtendedGameNotifications).GetMethod(nameof(OnOwnPropsDelete), BindingFlags.NonPublic | BindingFlags.Static))
);
}
static void OnLocalAvatarLoad()
@ -82,5 +101,43 @@ namespace ml_egn
MelonLoader.MelonLogger.Error(e);
}
}
static void OnPictureSave()
{
try
{
Utils.ShowHUDNotification("(Local) Client", "Screenshot saved");
}
catch(System.Exception e)
{
MelonLoader.MelonLogger.Error(e);
}
}
static void OnAllPropsDelete()
{
try
{
if(Utils.IsMenuOpened())
Utils.ShowMenuNotification("Props are removed");
}
catch(System.Exception e)
{
MelonLoader.MelonLogger.Error(e);
}
}
static void OnOwnPropsDelete()
{
try
{
if(Utils.IsMenuOpened())
Utils.ShowMenuNotification("Own props are removed");
}
catch(System.Exception e)
{
MelonLoader.MelonLogger.Error(e);
}
}
}
}