Check for props game settings and world restrictions

Combat system integration
Additional measure for unsafe worlds
This commit is contained in:
SDraw 2023-04-12 21:33:25 +03:00
parent 5185c00fb1
commit 912b37c87f
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
9 changed files with 186 additions and 57 deletions

View file

@ -1,5 +1,4 @@
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;
@ -57,6 +56,7 @@ namespace ml_egn
Utils.ShowMenuNotification("Avatar changed", 1f);
else
Utils.ShowHUDNotification("(Synced) Client", "Avatar changed");
}
catch(System.Exception e)
{
@ -68,19 +68,37 @@ namespace ml_egn
{
try
{
if(Utils.IsConnected())
if(Utils.ArePropsEnabled())
{
if(Utils.IsMenuOpened())
Utils.ShowMenuNotification("Prop spawned", 1f);
if(Utils.ArePropsAllowed())
{
if(Utils.IsConnected())
{
if(Utils.IsMenuOpened())
Utils.ShowMenuNotification("Prop spawned", 1f);
else
Utils.ShowHUDNotification("(Synced) Client", "Prop spawned");
}
else
{
if(Utils.IsMenuOpened())
Utils.ShowMenuAlert("Prop Error", "Not connected to live instance");
else
Utils.ShowHUDNotification("(Local) Client", "Unable to spawn prop", "Not connected to live instance");
}
}
else
Utils.ShowHUDNotification("(Synced) Client", "Prop spawned");
{
if(Utils.IsMenuOpened())
Utils.ShowMenuAlert("Prop Error", "Props are not allowed in this world");
}
}
else
{
if(Utils.IsMenuOpened())
Utils.ShowMenuAlert("Prop Error", "Not connected to live instance");
Utils.ShowMenuAlert("Prop Error", "Props are disabled in game settings");
else
Utils.ShowHUDNotification("(Local) Client", "Unable to spawn prop", "Not connected to live instance");
Utils.ShowHUDNotification("(Local) Client", "Unable to spawn prop", "Props are disabled in game settings");
}
}
catch(System.Exception e)

View file

@ -1,10 +1,10 @@
using System.Reflection;
[assembly: AssemblyTitle("ExtendedGameNotifications")]
[assembly: AssemblyVersion("1.0.1")]
[assembly: AssemblyFileVersion("1.0.1")]
[assembly: AssemblyVersion("1.0.2")]
[assembly: AssemblyFileVersion("1.0.2")]
[assembly: MelonLoader.MelonInfo(typeof(ml_egn.ExtendedGameNotifications), "ExtendedGameNotifications", "1.0.1", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
[assembly: MelonLoader.MelonInfo(typeof(ml_egn.ExtendedGameNotifications), "ExtendedGameNotifications", "1.0.2", "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)]

View file

@ -1,5 +1,6 @@
using ABI_RC.Core.InteractionSystem;
using ABI_RC.Core.Networking;
using ABI_RC.Core.Savior;
using ABI_RC.Core.UI;
using DarkRift;
@ -42,5 +43,8 @@ namespace ml_egn
l_result = (NetworkManager.Instance.GameNetwork.ConnectionState == ConnectionState.Connected);
return l_result;
}
public static bool ArePropsAllowed() => ((MetaPort.Instance != null) && MetaPort.Instance.worldAllowProps);
public static bool ArePropsEnabled() => ((MetaPort.Instance != null) && MetaPort.Instance.settings.GetSettingsBool("ContentFilterPropsEnabled"));
}
}