mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-04 02:49:23 +00:00
Try-catch statements for Harmony patches
This commit is contained in:
parent
bee29e7771
commit
4e3d5dd6d4
6 changed files with 93 additions and 37 deletions
|
@ -3,9 +3,9 @@ Merged set of MelonLoader mods for ChilloutVR.
|
|||
**State table for game build 2022r168:**
|
||||
| Full name | Short name | Latest version | Available in [CVRMA](https://github.com/knah/CVRMelonAssistant) | Current Status | Notes |
|
||||
|-----------|------------|----------------|-----------------------------------------------------------------|----------------|-------|
|
||||
| Avatar Change Info | ml_aci | 1.0.2 | Pending | Working |
|
||||
| Avatar Motion Tweaker | ml_amt | 1.0.6 | Pending | Working |
|
||||
| Avatar Change Info | ml_aci | 1.0.2 | Yes | Working |
|
||||
| Avatar Motion Tweaker | ml_amt | 1.0.6 | Yes | Working |
|
||||
| Desktop Reticle Switch | ml_drs | 1.0.0 | Yes | Working |
|
||||
| Four Point Tracking | ml_fpt | 1.0.4 | Pending | Working |
|
||||
| Leap Motion Extension | ml_lme | 1.1.8 | Pending | Working |
|
||||
| Four Point Tracking | ml_fpt | 1.0.4 | Yes | Working |
|
||||
| Leap Motion Extension | ml_lme | 1.1.8 | Yes | Working |
|
||||
| Server Connection Info | ml_sci | 1.0.1 | Yes | Working |
|
||||
|
|
|
@ -24,12 +24,21 @@ namespace ml_aci
|
|||
}
|
||||
|
||||
static void OnLocalAvatarLoad()
|
||||
{
|
||||
try
|
||||
{
|
||||
if(ViewManager.Instance != null)
|
||||
ViewManager.Instance.TriggerPushNotification("Avatar changed", 1f);
|
||||
}
|
||||
catch(System.Exception e)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
static void OnPropSpawned()
|
||||
{
|
||||
try
|
||||
{
|
||||
if(ViewManager.Instance != null)
|
||||
{
|
||||
|
@ -39,5 +48,10 @@ namespace ml_aci
|
|||
ViewManager.Instance.TriggerAlert("Prop Error", "Not connected to live instance", -1, true);
|
||||
}
|
||||
}
|
||||
catch(System.Exception e)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,16 +45,30 @@ namespace ml_amt
|
|||
|
||||
static void OnAvatarClear_Postfix() => ms_instance?.OnAvatarClear();
|
||||
void OnAvatarClear()
|
||||
{
|
||||
try
|
||||
{
|
||||
if(m_localTweaker != null)
|
||||
m_localTweaker.OnAvatarClear();
|
||||
}
|
||||
catch(System.Exception l_exception)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(l_exception);
|
||||
}
|
||||
}
|
||||
|
||||
static void OnSetupAvatarGeneral_Postfix() => ms_instance?.OnSetupAvatarGeneral();
|
||||
void OnSetupAvatarGeneral()
|
||||
{
|
||||
try
|
||||
{
|
||||
if(m_localTweaker != null)
|
||||
m_localTweaker.OnSetupAvatarGeneral();
|
||||
}
|
||||
catch(System.Exception l_exception)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(l_exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -169,6 +169,8 @@ namespace ml_fpt
|
|||
|
||||
static void OnAvatarClear_Postfix() => ms_instance?.OnAvatarClear();
|
||||
void OnAvatarClear()
|
||||
{
|
||||
try
|
||||
{
|
||||
if(m_inCalibration)
|
||||
{
|
||||
|
@ -190,6 +192,11 @@ namespace ml_fpt
|
|||
ShowHudNotification("Calibration canceled");
|
||||
}
|
||||
}
|
||||
catch(System.Exception e)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
static void ShowHudNotification(string p_message)
|
||||
{
|
||||
|
|
|
@ -316,20 +316,34 @@ namespace ml_lme
|
|||
// Patches
|
||||
static void OnAvatarClear_Postfix() => ms_instance?.OnAvatarClear();
|
||||
void OnAvatarClear()
|
||||
{
|
||||
try
|
||||
{
|
||||
if(m_leapTracked != null)
|
||||
m_leapTracked.OnAvatarClear();
|
||||
}
|
||||
catch(System.Exception e)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
// Sneaky forced IndexIK calibration
|
||||
static void OnSetupAvatarGeneral_Postfix() => ms_instance?.OnSetupAvatarGeneral();
|
||||
void OnSetupAvatarGeneral()
|
||||
{
|
||||
try
|
||||
{
|
||||
if(m_leapTracked != null)
|
||||
m_leapTracked.OnSetupAvatarGeneral();
|
||||
|
||||
OnSettingsHeadAttachChange(Settings.HeadAttach);
|
||||
}
|
||||
catch(System.Exception e)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
// Utilities
|
||||
static void ReorientateLeapToUnity(ref Vector3 p_pos, ref Quaternion p_rot, Settings.LeapTrackingMode p_mode)
|
||||
|
|
|
@ -15,9 +15,16 @@ namespace ml_sci
|
|||
}
|
||||
|
||||
static void OnGameNetworkConnectionClosed(object __0, DisconnectedEventArgs __1)
|
||||
{
|
||||
try
|
||||
{
|
||||
if((CohtmlHud.Instance != null) && (__1 != null) && (!__1.LocalDisconnect))
|
||||
CohtmlHud.Instance.ViewDropTextImmediate("(Local) Client", "Connection lost", (__1.Error != System.Net.Sockets.SocketError.Success) ? ("Reason: " + __1.Error.ToString()) : "");
|
||||
}
|
||||
catch(System.Exception e)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue