mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-03 10:29:22 +00:00
Notification delay
World ragdoll restriction
This commit is contained in:
parent
9c339f3662
commit
0239ab3057
14 changed files with 501 additions and 414 deletions
22
README.md
22
README.md
|
@ -1,18 +1,18 @@
|
|||
Merged set of MelonLoader mods for ChilloutVR.
|
||||
|
||||
**Table for game build 2023r175:**
|
||||
| Full name | Short name | Latest version | Available in [CVRMA](https://github.com/knah/CVRMelonAssistant) |
|
||||
| Full name | Short name | Latest version |
|
||||
|:---------:|:----------:|:--------------:| :----------------------------------------------------------------|
|
||||
| [Avatar Motion Tweaker](/ml_amt/README.md) | ml_amt | 1.4.0 [:arrow_down:](../../releases/latest/download/ml_amt.dll)|<ul><li>- [x] Published</li><li>- [x] Update review</li></ul>|
|
||||
| [Avatar Synced Look](/ml_asl/README.md) | ml_asl | 1.0.4 [:arrow_down:](../../releases/latest/download/ml_asl.dll)|<ul><li>- [x] Published</li><li>- [x] Update review</li></ul>|
|
||||
| [Better Fingers Tracking](/ml_bft/README.md) | ml_bft | 1.0.4 [:arrow_down:](../../releases/latest/download/ml_bft.dll)|<ul><li>- [x] Published</li><li>- [x] Update review</li></ul>|
|
||||
| [Desktop Head Tracking](/ml_dht/README.md) | ml_dht | 1.2.4 [:arrow_down:](../../releases/latest/download/ml_dht.dll) |<ul><li>- [x] Published</li><li>- [x] Update review</li></ul>|
|
||||
| [Leap Motion Extension](/ml_lme/README.md)| ml_lme | 1.5.1 [:arrow_down:](../../releases/latest/download/ml_lme.dll)|<ul><li>- [x] Published</li><li>- [x] Update review</li></ul>|
|
||||
| [Pickup Arm Movement](/ml_pam/README.md)| ml_pam | 1.1.3 [:arrow_down:](../../releases/latest/download/ml_pam.dll)|<ul><li>- [x] Published</li><li>- [x] Update review</li></ul>|
|
||||
| [Player Movement Copycat](/ml_pmc/README.md)| ml_pmc | 1.0.8 [:arrow_down:](../../releases/latest/download/ml_pmc.dll)|<ul><li>- [x] Published</li><li>- [x] Update review</li></ul>|
|
||||
| [Player Ragdoll Mod](/ml_prm/README.md) | ml_prm | 1.1.6 [:arrow_down:](../../releases/latest/download/ml_prm.dll)|<ul><li>- [x] Published</li><li>- [x] Update review</li></ul>|
|
||||
| [Players Instance Notifier](/ml_pin/README.md) | ml_pin | 1.0.5 [:arrow_down:](../../releases/latest/download/ml_ml_pin.dll)|<ul><li>- [x] Published</li><li>- [x] Update review</li></ul>|
|
||||
| [Vive Extended Input](/ml_vei/README.md) | ml_vei | 1.0.4 [:arrow_down:](../../releases/latest/download/ml_vei.dll)|<ul><li>- [x] Published</li><li>- [x] Update review</li></ul>|
|
||||
| [Avatar Motion Tweaker](/ml_amt/README.md) | ml_amt | 1.4.0 [:arrow_down:](../../releases/latest/download/ml_amt.dll)|
|
||||
| [Avatar Synced Look](/ml_asl/README.md) | ml_asl | 1.0.4 [:arrow_down:](../../releases/latest/download/ml_asl.dll)|
|
||||
| [Better Fingers Tracking](/ml_bft/README.md) | ml_bft | 1.0.4 [:arrow_down:](../../releases/latest/download/ml_bft.dll)|
|
||||
| [Desktop Head Tracking](/ml_dht/README.md) | ml_dht | 1.2.4 [:arrow_down:](../../releases/latest/download/ml_dht.dll)|
|
||||
| [Leap Motion Extension](/ml_lme/README.md)| ml_lme | 1.5.1 [:arrow_down:](../../releases/latest/download/ml_lme.dll)|
|
||||
| [Pickup Arm Movement](/ml_pam/README.md)| ml_pam | 1.1.3 [:arrow_down:](../../releases/latest/download/ml_pam.dll)|
|
||||
| [Player Movement Copycat](/ml_pmc/README.md)| ml_pmc | 1.0.8 [:arrow_down:](../../releases/latest/download/ml_pmc.dll)|
|
||||
| [Player Ragdoll Mod](/ml_prm/README.md) | ml_prm | 1.1.7 [:arrow_down:](../../releases/latest/download/ml_prm.dll)|
|
||||
| [Players Instance Notifier](/ml_pin/README.md) | ml_pin | 1.0.7 [:arrow_down:](../../releases/latest/download/ml_ml_pin.dll)|
|
||||
| [Vive Extended Input](/ml_vei/README.md) | ml_vei | 1.0.4 [:arrow_down:](../../releases/latest/download/ml_vei.dll)|
|
||||
|
||||
**Archived mods:**
|
||||
| Full name | Short name | Notes |
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[assembly: MelonLoader.MelonInfo(typeof(ml_pin.PlayersInstanceNotifier), "PlayersInstanceNotifier", "1.0.6", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
|
||||
[assembly: MelonLoader.MelonInfo(typeof(ml_pin.PlayersInstanceNotifier), "PlayersInstanceNotifier", "1.0.7", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
|
||||
[assembly: MelonLoader.MelonGame(null, "ChilloutVR")]
|
||||
[assembly: MelonLoader.MelonPlatform(MelonLoader.MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
|
||||
[assembly: MelonLoader.MelonPlatformDomain(MelonLoader.MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
|
||||
|
|
|
@ -12,6 +12,7 @@ Available mod's settings in `Settings - Audio - Players Instance Notifier`:
|
|||
* **Notify of:** players notification filter type, available filters: `None`, `Friends`, `All`; `All` by default.
|
||||
* **Mixed volume:** volume of notifications; `100` by default.
|
||||
* Note: Respects game's interface volume setting and mixes with it accordingly.
|
||||
* **Delay between notifications:** prevents notification until previous one is finished; `true` by default.
|
||||
* **Notify in public instances:** notifies in `Public` instances; `true` by default.
|
||||
* **Notify in friends instances:** notifies in `Friends of friends` and `Friends` instances; `true` by default.
|
||||
* **Notify in private instances:** notifies in `Everyone can invite` and `Owner must invite` instances; `true` by default.
|
||||
|
|
|
@ -25,6 +25,7 @@ namespace ml_pin
|
|||
{
|
||||
NotifyType,
|
||||
Volume,
|
||||
Delay,
|
||||
NotifyInPublic,
|
||||
NotifyInFriends,
|
||||
NotifyInPrivate,
|
||||
|
@ -33,6 +34,7 @@ namespace ml_pin
|
|||
|
||||
public static NotificationType NotifyType { get; private set; } = NotificationType.All;
|
||||
public static float Volume { get; private set; } = 1.0f;
|
||||
public static bool Delay { get; private set; } = true;
|
||||
public static bool NotifyInPublic { get; private set; } = true;
|
||||
public static bool NotifyInFriends { get; private set; } = true;
|
||||
public static bool NotifyInPrivate { get; private set; } = true;
|
||||
|
@ -43,6 +45,7 @@ namespace ml_pin
|
|||
|
||||
public static readonly SettingEvent<NotificationType> OnNotifyTypeChanged = new SettingEvent<NotificationType>();
|
||||
public static readonly SettingEvent<float> OnVolumeChanged = new SettingEvent<float>();
|
||||
public static readonly SettingEvent<bool> OnDelayChange = new SettingEvent<bool>();
|
||||
public static readonly SettingEvent<bool> OnNotifyInPublicChanged = new SettingEvent<bool>();
|
||||
public static readonly SettingEvent<bool> OnNotifyInFriendsChanged = new SettingEvent<bool>();
|
||||
public static readonly SettingEvent<bool> OnNotifyInPrivateChanged = new SettingEvent<bool>();
|
||||
|
@ -56,6 +59,7 @@ namespace ml_pin
|
|||
{
|
||||
ms_category.CreateEntry(ModSetting.NotifyType.ToString(), (int)NotifyType),
|
||||
ms_category.CreateEntry(ModSetting.Volume.ToString(), (int)(Volume * 100f)),
|
||||
ms_category.CreateEntry(ModSetting.Delay.ToString(), Delay),
|
||||
ms_category.CreateEntry(ModSetting.NotifyInPublic.ToString(), NotifyInPublic),
|
||||
ms_category.CreateEntry(ModSetting.NotifyInFriends.ToString(), NotifyInFriends),
|
||||
ms_category.CreateEntry(ModSetting.NotifyInPrivate.ToString(), NotifyInPrivate),
|
||||
|
@ -64,6 +68,7 @@ namespace ml_pin
|
|||
|
||||
NotifyType = (NotificationType)(int)ms_entries[(int)ModSetting.NotifyType].BoxedValue;
|
||||
Volume = (int)ms_entries[(int)ModSetting.Volume].BoxedValue * 0.01f;
|
||||
Delay = (bool)ms_entries[(int)ModSetting.Delay].BoxedValue;
|
||||
NotifyInPublic = (bool)ms_entries[(int)ModSetting.NotifyInPublic].BoxedValue;
|
||||
NotifyInFriends = (bool)ms_entries[(int)ModSetting.NotifyInFriends].BoxedValue;
|
||||
NotifyInPrivate = (bool)ms_entries[(int)ModSetting.NotifyInPrivate].BoxedValue;
|
||||
|
@ -104,6 +109,13 @@ namespace ml_pin
|
|||
{
|
||||
switch(l_setting)
|
||||
{
|
||||
case ModSetting.Delay:
|
||||
{
|
||||
Delay = l_value;
|
||||
OnDelayChange.Invoke(Delay);
|
||||
}
|
||||
break;
|
||||
|
||||
case ModSetting.NotifyInPublic:
|
||||
{
|
||||
NotifyInPublic = l_value;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using ABI_RC.Core.AudioEffects;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
|
@ -20,12 +21,24 @@ namespace ml_pin
|
|||
|
||||
bool m_loaded = false;
|
||||
readonly AudioClip[] m_clips = null;
|
||||
int[] m_clipDelays = null;
|
||||
int[] m_playTicks = null;
|
||||
|
||||
internal SoundManager()
|
||||
{
|
||||
m_clips = new AudioClip[4];
|
||||
for(int i = 0; i < 4; i++)
|
||||
m_clips[i] = null;
|
||||
|
||||
m_clipDelays = new int[4];
|
||||
m_clipDelays[(int)SoundType.PlayerJoin] = 708;
|
||||
m_clipDelays[(int)SoundType.PlayerLeave] = 380;
|
||||
m_clipDelays[(int)SoundType.FriendJoin] = 708;
|
||||
m_clipDelays[(int)SoundType.FriendLeave] = 380;
|
||||
|
||||
m_playTicks = new int[4];
|
||||
for(int i = 0; i < 4; i++)
|
||||
m_playTicks[i] = 0;
|
||||
}
|
||||
public void LoadSounds()
|
||||
{
|
||||
|
@ -59,12 +72,28 @@ namespace ml_pin
|
|||
yield break;
|
||||
|
||||
m_clips[(int)p_type] = l_clip;
|
||||
m_clipDelays[(int)p_type] = (int)(l_clip.length * 1000f);
|
||||
}
|
||||
|
||||
public void PlaySound(SoundType p_type)
|
||||
{
|
||||
if(m_loaded && (m_clips[(int)p_type] != null))
|
||||
InterfaceAudio.Instance.UserInterfaceAudio.PlayOneShot(m_clips[(int)p_type], Settings.Volume);
|
||||
{
|
||||
if(Settings.Delay)
|
||||
{
|
||||
int l_tick = Environment.TickCount;
|
||||
if(l_tick - m_playTicks[(int)p_type] > m_clipDelays[(int)p_type])
|
||||
{
|
||||
m_playTicks[(int)p_type] = l_tick;
|
||||
InterfaceAudio.Instance.UserInterfaceAudio.PlayOneShot(m_clips[(int)p_type], Settings.Volume);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_playTicks[(int)p_type] = Environment.TickCount;
|
||||
InterfaceAudio.Instance.UserInterfaceAudio.PlayOneShot(m_clips[(int)p_type], Settings.Volume);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<Authors>SDraw</Authors>
|
||||
<Company>None</Company>
|
||||
<Product>PlayersInstanceNotifier</Product>
|
||||
<Version>1.0.6</Version>
|
||||
<Version>1.0.7</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
|
|
|
@ -20,6 +20,13 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class ="row-wrapper">
|
||||
<div class ="option-caption">Delay between notifications: </div>
|
||||
<div class ="option-input">
|
||||
<div id="Delay" class ="inp_toggle no-scroll" data-current="true"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class ="row-wrapper">
|
||||
<div class ="option-caption">Notify in public instances: </div>
|
||||
<div class ="option-input">
|
||||
|
|
|
@ -15,6 +15,7 @@ namespace ml_prm
|
|||
Settings.Init();
|
||||
ModUi.Init();
|
||||
GameEvents.Init(HarmonyInstance);
|
||||
WorldHandler.Init();
|
||||
|
||||
// Whitelist the toggle script
|
||||
(typeof(SharedFilter).GetField("_localComponentWhitelist", BindingFlags.NonPublic | BindingFlags.Static)?.GetValue(null) as HashSet<Type>)?.Add(typeof(RagdollToggle));
|
||||
|
@ -24,6 +25,8 @@ namespace ml_prm
|
|||
|
||||
public override void OnDeinitializeMelon()
|
||||
{
|
||||
WorldHandler.DeInit();
|
||||
|
||||
if(m_localController != null)
|
||||
UnityEngine.Object.Destroy(m_localController);
|
||||
m_localController = null;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[assembly: MelonLoader.MelonInfo(typeof(ml_prm.PlayerRagdollMod), "PlayerRagdollMod", "1.1.6", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
|
||||
[assembly: MelonLoader.MelonInfo(typeof(ml_prm.PlayerRagdollMod), "PlayerRagdollMod", "1.1.7", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
|
||||
[assembly: MelonLoader.MelonGame(null, "ChilloutVR")]
|
||||
[assembly: MelonLoader.MelonPriority(2)]
|
||||
[assembly: MelonLoader.MelonOptionalDependencies("BTKUILib")]
|
||||
|
|
|
@ -46,6 +46,9 @@ Available additional parameters for AAS animator:
|
|||
* **`Ragdolled`:** defines current ragdoll state; boolean.
|
||||
* Note: Can be set as local-only (not synced) if starts with `#` character.
|
||||
|
||||
# World restriction
|
||||
World creators can restrict ragdolling by creating empty game object with name `[RagdollRestriction]` anywhere in scene.
|
||||
|
||||
# Unity Editor Script
|
||||
You can also trigger the ragdoll via animations on your avatar. To do this you need:
|
||||
* Download and import the `ml_prm_editor_script.unitypackage` into your unity project
|
||||
|
|
|
@ -213,7 +213,7 @@ namespace ml_prm
|
|||
if(m_downTime >= Settings.RecoverDelay)
|
||||
{
|
||||
SwitchRagdoll();
|
||||
m_downTime = float.MinValue; // One attepmt to recover
|
||||
m_downTime = float.MinValue; // One attempt to recover
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -363,13 +363,13 @@ namespace ml_prm
|
|||
m_rigidBodies.Add(l_body);
|
||||
l_body.isKinematic = true;
|
||||
l_body.angularDrag = Settings.AngularDrag;
|
||||
l_body.drag = (Utils.IsWorldSafe() ? Settings.MovementDrag : 1f);
|
||||
l_body.drag = (WorldHandler.IsSafeWorld() ? Settings.MovementDrag : 1f);
|
||||
l_body.useGravity = false;
|
||||
l_body.collisionDetectionMode = CollisionDetectionMode.ContinuousDynamic;
|
||||
l_body.gameObject.layer = LayerMask.NameToLayer("PlayerLocal");
|
||||
|
||||
GravityInfluencer l_gravInfluencer = l_body.gameObject.AddComponent<GravityInfluencer>();
|
||||
l_gravInfluencer.SetActiveGravity((!Utils.IsWorldSafe() || Settings.Gravity));
|
||||
l_gravInfluencer.SetActiveGravity((!WorldHandler.IsSafeWorld() || Settings.Gravity));
|
||||
m_gravityInfluencers.Add(l_gravInfluencer);
|
||||
}
|
||||
|
||||
|
@ -398,7 +398,7 @@ namespace ml_prm
|
|||
if((l_body != null) && (l_collider != null) && (l_puppetTransforms[i] == m_puppetReferences.hips || l_puppetTransforms[i] == m_puppetReferences.spine || l_puppetTransforms[i] == m_puppetReferences.chest))
|
||||
{
|
||||
PhysicsInfluencer l_physicsInfluencer = l_puppetTransforms[i].gameObject.AddComponent<PhysicsInfluencer>();
|
||||
l_physicsInfluencer.airDrag = (Utils.IsWorldSafe() ? Settings.MovementDrag : 1f);
|
||||
l_physicsInfluencer.airDrag = (WorldHandler.IsSafeWorld() ? Settings.MovementDrag : 1f);
|
||||
l_physicsInfluencer.airAngularDrag = Settings.AngularDrag;
|
||||
l_physicsInfluencer.fluidDrag = 3f;
|
||||
l_physicsInfluencer.fluidAngularDrag = 1f;
|
||||
|
@ -572,7 +572,7 @@ namespace ml_prm
|
|||
{
|
||||
if(m_avatarReady)
|
||||
{
|
||||
float l_drag = (Utils.IsWorldSafe() ? p_value : 1f);
|
||||
float l_drag = (WorldHandler.IsSafeWorld() ? p_value : 1f);
|
||||
foreach(Rigidbody l_body in m_rigidBodies)
|
||||
{
|
||||
l_body.drag = l_drag;
|
||||
|
@ -601,7 +601,7 @@ namespace ml_prm
|
|||
{
|
||||
if(m_avatarReady)
|
||||
{
|
||||
bool l_gravity = (!Utils.IsWorldSafe() || p_state);
|
||||
bool l_gravity = (!WorldHandler.IsSafeWorld() || p_state);
|
||||
foreach(PhysicsInfluencer l_influencer in m_physicsInfluencers)
|
||||
l_influencer.enabled = l_gravity;
|
||||
foreach(GravityInfluencer l_influencer in m_gravityInfluencers)
|
||||
|
@ -618,8 +618,8 @@ namespace ml_prm
|
|||
{
|
||||
if(m_physicsMaterial != null)
|
||||
{
|
||||
bool l_slipperiness = (Settings.Slipperiness && Utils.IsWorldSafe());
|
||||
bool l_bounciness = (Settings.Bounciness && Utils.IsWorldSafe());
|
||||
bool l_slipperiness = (Settings.Slipperiness && WorldHandler.IsSafeWorld());
|
||||
bool l_bounciness = (Settings.Bounciness && WorldHandler.IsSafeWorld());
|
||||
m_physicsMaterial.dynamicFriction = (l_slipperiness ? 0f : c_defaultFriction);
|
||||
m_physicsMaterial.staticFriction = (l_slipperiness ? 0f : c_defaultFriction);
|
||||
m_physicsMaterial.frictionCombine = (l_slipperiness ? PhysicMaterialCombine.Minimum : PhysicMaterialCombine.Average);
|
||||
|
@ -631,7 +631,7 @@ namespace ml_prm
|
|||
{
|
||||
if(m_avatarReady)
|
||||
{
|
||||
bool l_buoyancy = (!Utils.IsWorldSafe() || p_state);
|
||||
bool l_buoyancy = (!WorldHandler.IsSafeWorld() || p_state);
|
||||
foreach(PhysicsInfluencer l_influencer in m_physicsInfluencers)
|
||||
l_influencer.enableInfluence = l_buoyancy;
|
||||
|
||||
|
@ -672,7 +672,7 @@ namespace ml_prm
|
|||
PlayerSetup.Instance.animatorManager.CancelEmote = true;
|
||||
m_ragdolledParameter.SetValue(true);
|
||||
|
||||
if(!Utils.IsWorldSafe())
|
||||
if(!WorldHandler.IsSafeWorld())
|
||||
{
|
||||
m_reachedGround = false; // Force player to unragdoll and reach ground first
|
||||
m_groundedTime = 0f;
|
||||
|
@ -683,8 +683,8 @@ namespace ml_prm
|
|||
foreach(Rigidbody l_body in m_rigidBodies)
|
||||
l_body.isKinematic = false;
|
||||
|
||||
Vector3 l_velocity = Vector3.ClampMagnitude(m_velocity * (Utils.IsWorldSafe() ? Settings.VelocityMultiplier : 1f), Utils.GetWorldMovementLimit());
|
||||
if(Settings.ViewVelocity && Utils.IsWorldSafe())
|
||||
Vector3 l_velocity = Vector3.ClampMagnitude(m_velocity * (WorldHandler.IsSafeWorld() ? Settings.VelocityMultiplier : 1f), WorldHandler.GetMovementLimit());
|
||||
if(Settings.ViewVelocity && WorldHandler.IsSafeWorld())
|
||||
{
|
||||
float l_mag = l_velocity.magnitude;
|
||||
l_velocity = PlayerSetup.Instance.GetActiveCamera().transform.forward * l_mag;
|
||||
|
@ -708,7 +708,7 @@ namespace ml_prm
|
|||
{
|
||||
BetterBetterCharacterController.Instance.TeleportPlayerTo(m_puppetReferences.hips.position, PlayerSetup.Instance.GetPlayerRotation().eulerAngles, false, false);
|
||||
TryRestoreMovement();
|
||||
if(!Utils.IsWorldSafe())
|
||||
if(!WorldHandler.IsSafeWorld())
|
||||
{
|
||||
Vector3 l_vec = BetterBetterCharacterController.Instance.GetVelocity();
|
||||
l_vec.y = Mathf.Clamp(l_vec.y, float.MinValue, 0f);
|
||||
|
@ -775,6 +775,9 @@ namespace ml_prm
|
|||
|
||||
bool CanRagdoll()
|
||||
{
|
||||
if(WorldHandler.IsRestrictedWorld())
|
||||
return false;
|
||||
|
||||
bool l_result = m_reachedGround;
|
||||
l_result &= !BodySystem.isCalibrating;
|
||||
l_result &= !BetterBetterCharacterController.Instance.IsSitting();
|
||||
|
|
|
@ -16,21 +16,6 @@ namespace ml_prm
|
|||
static readonly FieldInfo ms_influencerTouchingVolumes = typeof(PhysicsInfluencer).GetField("_touchingVolumes", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
static readonly FieldInfo ms_influencerSubmergedColliders = typeof(PhysicsInfluencer).GetField("_submergedColliders", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
|
||||
public static bool IsInVR() => ((MetaPort.Instance != null) && MetaPort.Instance.isUsingVr);
|
||||
public static bool IsWorldSafe() => ((CVRWorld.Instance != null) && CVRWorld.Instance.allowFlying);
|
||||
public static float GetWorldMovementLimit()
|
||||
{
|
||||
float l_result = 1f;
|
||||
if(CVRWorld.Instance != null)
|
||||
{
|
||||
l_result = CVRWorld.Instance.baseMovementSpeed;
|
||||
l_result *= CVRWorld.Instance.sprintMultiplier;
|
||||
l_result *= CVRWorld.Instance.inAirMovementMultiplier;
|
||||
l_result *= CVRWorld.Instance.flyMultiplier;
|
||||
}
|
||||
return l_result;
|
||||
}
|
||||
|
||||
public static void ClearFluidVolumes(this BetterBetterCharacterController p_instance) => (ms_touchingVolumes.GetValue(p_instance) as List<FluidVolume>)?.Clear();
|
||||
|
||||
public static void CopyGlobal(this Transform p_source, Transform p_target)
|
||||
|
|
44
ml_prm/WorldHandler.cs
Normal file
44
ml_prm/WorldHandler.cs
Normal file
|
@ -0,0 +1,44 @@
|
|||
using ABI.CCK.Components;
|
||||
using ABI_RC.Systems.GameEventSystem;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ml_prm
|
||||
{
|
||||
static class WorldHandler
|
||||
{
|
||||
static bool ms_safeWorld = true;
|
||||
static bool ms_restrictedWorld = false;
|
||||
static float ms_movementLimit = 1f;
|
||||
|
||||
internal static void Init()
|
||||
{
|
||||
CVRGameEventSystem.World.OnLoad.AddListener(OnWorldLoad);
|
||||
}
|
||||
|
||||
internal static void DeInit()
|
||||
{
|
||||
CVRGameEventSystem.World.OnLoad.RemoveListener(OnWorldLoad);
|
||||
}
|
||||
|
||||
static void OnWorldLoad(string p_id)
|
||||
{
|
||||
ms_safeWorld = ((CVRWorld.Instance != null) && CVRWorld.Instance.allowFlying);
|
||||
ms_movementLimit = 1f;
|
||||
|
||||
GameObject l_restrictObj = GameObject.Find("[RagdollRestriction]");
|
||||
ms_restrictedWorld = ((l_restrictObj == null) ? false : (l_restrictObj.scene.name != "DontDestroyOnLoad"));
|
||||
|
||||
if(CVRWorld.Instance != null)
|
||||
{
|
||||
ms_movementLimit = CVRWorld.Instance.baseMovementSpeed;
|
||||
ms_movementLimit *= CVRWorld.Instance.sprintMultiplier;
|
||||
ms_movementLimit *= CVRWorld.Instance.inAirMovementMultiplier;
|
||||
ms_movementLimit *= CVRWorld.Instance.flyMultiplier;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsSafeWorld() => ms_safeWorld;
|
||||
public static bool IsRestrictedWorld() => ms_restrictedWorld;
|
||||
public static float GetMovementLimit() => ms_movementLimit;
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<Platforms>x64</Platforms>
|
||||
<PackageId>PlayerRagdollMod</PackageId>
|
||||
<Version>1.1.6</Version>
|
||||
<Version>1.1.7</Version>
|
||||
<Authors>SDraw</Authors>
|
||||
<Company>None</Company>
|
||||
<Product>PlayerRagdollMod</Product>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue