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:**
|
**State table for game build 2022r168:**
|
||||||
| Full name | Short name | Latest version | Available in [CVRMA](https://github.com/knah/CVRMelonAssistant) | Current Status | Notes |
|
| 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 Change Info | ml_aci | 1.0.2 | Yes | Working |
|
||||||
| Avatar Motion Tweaker | ml_amt | 1.0.6 | Pending | Working |
|
| Avatar Motion Tweaker | ml_amt | 1.0.6 | Yes | Working |
|
||||||
| Desktop Reticle Switch | ml_drs | 1.0.0 | Yes | Working |
|
| Desktop Reticle Switch | ml_drs | 1.0.0 | Yes | Working |
|
||||||
| Four Point Tracking | ml_fpt | 1.0.4 | Pending | Working |
|
| Four Point Tracking | ml_fpt | 1.0.4 | Yes | Working |
|
||||||
| Leap Motion Extension | ml_lme | 1.1.8 | Pending | Working |
|
| Leap Motion Extension | ml_lme | 1.1.8 | Yes | Working |
|
||||||
| Server Connection Info | ml_sci | 1.0.1 | Yes | Working |
|
| Server Connection Info | ml_sci | 1.0.1 | Yes | Working |
|
||||||
|
|
|
@ -25,18 +25,32 @@ namespace ml_aci
|
||||||
|
|
||||||
static void OnLocalAvatarLoad()
|
static void OnLocalAvatarLoad()
|
||||||
{
|
{
|
||||||
if(ViewManager.Instance != null)
|
try
|
||||||
ViewManager.Instance.TriggerPushNotification("Avatar changed", 1f);
|
{
|
||||||
|
if(ViewManager.Instance != null)
|
||||||
|
ViewManager.Instance.TriggerPushNotification("Avatar changed", 1f);
|
||||||
|
}
|
||||||
|
catch(System.Exception e)
|
||||||
|
{
|
||||||
|
MelonLoader.MelonLogger.Error(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void OnPropSpawned()
|
static void OnPropSpawned()
|
||||||
{
|
{
|
||||||
if(ViewManager.Instance != null)
|
try
|
||||||
{
|
{
|
||||||
if((NetworkManager.Instance != null) && (NetworkManager.Instance.GameNetwork.ConnectionState == ConnectionState.Connected))
|
if(ViewManager.Instance != null)
|
||||||
ViewManager.Instance.TriggerPushNotification("Prop spawned", 1f);
|
{
|
||||||
else
|
if((NetworkManager.Instance != null) && (NetworkManager.Instance.GameNetwork.ConnectionState == ConnectionState.Connected))
|
||||||
ViewManager.Instance.TriggerAlert("Prop Error", "Not connected to live instance", -1, true);
|
ViewManager.Instance.TriggerPushNotification("Prop spawned", 1f);
|
||||||
|
else
|
||||||
|
ViewManager.Instance.TriggerAlert("Prop Error", "Not connected to live instance", -1, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(System.Exception e)
|
||||||
|
{
|
||||||
|
MelonLoader.MelonLogger.Error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,15 +46,29 @@ namespace ml_amt
|
||||||
static void OnAvatarClear_Postfix() => ms_instance?.OnAvatarClear();
|
static void OnAvatarClear_Postfix() => ms_instance?.OnAvatarClear();
|
||||||
void OnAvatarClear()
|
void OnAvatarClear()
|
||||||
{
|
{
|
||||||
if(m_localTweaker != null)
|
try
|
||||||
m_localTweaker.OnAvatarClear();
|
{
|
||||||
|
if(m_localTweaker != null)
|
||||||
|
m_localTweaker.OnAvatarClear();
|
||||||
|
}
|
||||||
|
catch(System.Exception l_exception)
|
||||||
|
{
|
||||||
|
MelonLoader.MelonLogger.Error(l_exception);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void OnSetupAvatarGeneral_Postfix() => ms_instance?.OnSetupAvatarGeneral();
|
static void OnSetupAvatarGeneral_Postfix() => ms_instance?.OnSetupAvatarGeneral();
|
||||||
void OnSetupAvatarGeneral()
|
void OnSetupAvatarGeneral()
|
||||||
{
|
{
|
||||||
if(m_localTweaker != null)
|
try
|
||||||
m_localTweaker.OnSetupAvatarGeneral();
|
{
|
||||||
|
if(m_localTweaker != null)
|
||||||
|
m_localTweaker.OnSetupAvatarGeneral();
|
||||||
|
}
|
||||||
|
catch(System.Exception l_exception)
|
||||||
|
{
|
||||||
|
MelonLoader.MelonLogger.Error(l_exception);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,24 +170,31 @@ namespace ml_fpt
|
||||||
static void OnAvatarClear_Postfix() => ms_instance?.OnAvatarClear();
|
static void OnAvatarClear_Postfix() => ms_instance?.OnAvatarClear();
|
||||||
void OnAvatarClear()
|
void OnAvatarClear()
|
||||||
{
|
{
|
||||||
if(m_inCalibration)
|
try
|
||||||
{
|
{
|
||||||
m_indexIk.enabled = true;
|
if(m_inCalibration)
|
||||||
m_ikCalibrator.enabled = true;
|
|
||||||
|
|
||||||
m_ikCalibrator.leftHandModel.SetActive(false);
|
|
||||||
m_ikCalibrator.rightHandModel.SetActive(false);
|
|
||||||
|
|
||||||
if(m_hipsTrackerIndex != -1)
|
|
||||||
{
|
{
|
||||||
PlayerSetup.Instance._trackerManager.trackers[m_hipsTrackerIndex].ShowTracker(false);
|
m_indexIk.enabled = true;
|
||||||
PlayerSetup.Instance._trackerManager.trackers[m_hipsTrackerIndex].ShowLine(false);
|
m_ikCalibrator.enabled = true;
|
||||||
|
|
||||||
|
m_ikCalibrator.leftHandModel.SetActive(false);
|
||||||
|
m_ikCalibrator.rightHandModel.SetActive(false);
|
||||||
|
|
||||||
|
if(m_hipsTrackerIndex != -1)
|
||||||
|
{
|
||||||
|
PlayerSetup.Instance._trackerManager.trackers[m_hipsTrackerIndex].ShowTracker(false);
|
||||||
|
PlayerSetup.Instance._trackerManager.trackers[m_hipsTrackerIndex].ShowLine(false);
|
||||||
|
}
|
||||||
|
CVR_InteractableManager.enableInteractions = true;
|
||||||
|
|
||||||
|
Reset();
|
||||||
|
|
||||||
|
ShowHudNotification("Calibration canceled");
|
||||||
}
|
}
|
||||||
CVR_InteractableManager.enableInteractions = true;
|
}
|
||||||
|
catch(System.Exception e)
|
||||||
Reset();
|
{
|
||||||
|
MelonLoader.MelonLogger.Error(e);
|
||||||
ShowHudNotification("Calibration canceled");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -317,18 +317,32 @@ namespace ml_lme
|
||||||
static void OnAvatarClear_Postfix() => ms_instance?.OnAvatarClear();
|
static void OnAvatarClear_Postfix() => ms_instance?.OnAvatarClear();
|
||||||
void OnAvatarClear()
|
void OnAvatarClear()
|
||||||
{
|
{
|
||||||
if(m_leapTracked != null)
|
try
|
||||||
m_leapTracked.OnAvatarClear();
|
{
|
||||||
|
if(m_leapTracked != null)
|
||||||
|
m_leapTracked.OnAvatarClear();
|
||||||
|
}
|
||||||
|
catch(System.Exception e)
|
||||||
|
{
|
||||||
|
MelonLoader.MelonLogger.Error(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sneaky forced IndexIK calibration
|
// Sneaky forced IndexIK calibration
|
||||||
static void OnSetupAvatarGeneral_Postfix() => ms_instance?.OnSetupAvatarGeneral();
|
static void OnSetupAvatarGeneral_Postfix() => ms_instance?.OnSetupAvatarGeneral();
|
||||||
void OnSetupAvatarGeneral()
|
void OnSetupAvatarGeneral()
|
||||||
{
|
{
|
||||||
if(m_leapTracked != null)
|
try
|
||||||
m_leapTracked.OnSetupAvatarGeneral();
|
{
|
||||||
|
if(m_leapTracked != null)
|
||||||
|
m_leapTracked.OnSetupAvatarGeneral();
|
||||||
|
|
||||||
OnSettingsHeadAttachChange(Settings.HeadAttach);
|
OnSettingsHeadAttachChange(Settings.HeadAttach);
|
||||||
|
}
|
||||||
|
catch(System.Exception e)
|
||||||
|
{
|
||||||
|
MelonLoader.MelonLogger.Error(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Utilities
|
// Utilities
|
||||||
|
|
|
@ -16,8 +16,15 @@ namespace ml_sci
|
||||||
|
|
||||||
static void OnGameNetworkConnectionClosed(object __0, DisconnectedEventArgs __1)
|
static void OnGameNetworkConnectionClosed(object __0, DisconnectedEventArgs __1)
|
||||||
{
|
{
|
||||||
if((CohtmlHud.Instance != null) && (__1 != null) && (!__1.LocalDisconnect))
|
try
|
||||||
CohtmlHud.Instance.ViewDropTextImmediate("(Local) Client", "Connection lost", (__1.Error != System.Net.Sockets.SocketError.Success) ? ("Reason: " + __1.Error.ToString()) : "");
|
{
|
||||||
|
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