Decompiled source of ShipVoiceCommandsv2 v2.0.4

ShipVoiceCommandsv2.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using LethalSettings.UI;
using LethalSettings.UI.Components;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.SceneManagement;
using VoiceRecognitionAPI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ShipVoiceCommandsv2")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Add voice commands")]
[assembly: AssemblyFileVersion("2.0.4.0")]
[assembly: AssemblyInformationalVersion("2.0.4")]
[assembly: AssemblyProduct("ShipVoiceCommandsv2")]
[assembly: AssemblyTitle("ShipVoiceCommandsv2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.0.4.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace ShipVoiceCommandsv2
{
	[BepInPlugin("shipvoicecommandsv2.me.loaforc.arceusyoluffy", "ShipVoiceCommandsv2", "2.0.4")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class ShipVoiceCommandsBase : BaseUnityPlugin
	{
		private const string modGUID = "shipvoicecommandsv2.me.loaforc.arceusyoluffy";

		private const string modName = "ShipVoiceCommandsv2";

		private const string modVersion = "2.0.4";

		private readonly Harmony harmony = new Harmony("shipvoicecommandsv2.me.loaforc.arceusyoluffy");

		internal static ShipVoiceCommandsBase instance;

		internal static ManualLogSource logger;

		internal static ConfigEntry<int> CONFIG_VERSION;

		internal static ConfigEntry<bool> ARE_COMMANDS_GLOBAL;

		internal static ConfigEntry<string> OPEN_DOORS_COMMAND;

		internal static ConfigEntry<string> CLOSE_DOORS_COMMAND;

		internal static ConfigEntry<string> ACTIVATE_TELEPORT_COMMAND;

		internal static ConfigEntry<string> TOGGLE_CAMERA;

		internal static ConfigEntry<string> SWITCH_CAMERA;

		internal static ConfigEntry<string> TOGGLE_LIGHTS;

		internal static ConfigEntry<string> PULL_LEVER;

		internal static ConfigEntry<string> ACTIVATE_INVERSE_TELEPORT_COMMAND;

		internal static ConfigEntry<string> TOGGLE_SHIP_HORN;

		internal static ConfigEntry<string> RING_COMPANY_BELL;

		internal static ConfigEntry<string> TOGGLE_TELEVISION;

		internal static ConfigEntry<string> TOGGLE_PLUSHIE;

		internal static ConfigEntry<string> TOGGLE_SHOWER;

		internal static ConfigEntry<string> TOGGLE_TOILET;

		internal static ConfigEntry<string> TOGGLE_SPEAKER;

		internal static ConfigEntry<string> TOGGLE_JACKOLANTERN;

		internal static ConfigEntry<string> TOGGLE_COMPANY_TRAPDOOR;

		internal static ConfigEntry<string> ACTIVATE_RADAR_BOOSTER_FLASH;

		internal static ConfigEntry<string> ACTIVATE_RADAR_BOOSTER_PING;

		internal static ConfigEntry<double> CONFIDENCE;

		private void Awake()
		{
			//IL_0596: Unknown result type (might be due to invalid IL or missing references)
			//IL_059c: Expected O, but got Unknown
			//IL_05d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05da: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e7: Expected O, but got Unknown
			//IL_05e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0612: Unknown result type (might be due to invalid IL or missing references)
			//IL_0639: Expected O, but got Unknown
			if (!((Object)(object)instance == (Object)null))
			{
				return;
			}
			instance = this;
			logger = Logger.CreateLogSource("shipvoicecommandsv2.me.loaforc.arceusyoluffy");
			logger.LogInfo((object)"Setting up config.");
			CONFIG_VERSION = ((BaseUnityPlugin)this).Config.Bind<int>("Config", "ConfigVersion", 1, "Yeah don't touch this lol. You could mess up your settings.");
			ARE_COMMANDS_GLOBAL = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay", "AreCommandsGlobal", false, "Are the voice commands global? Or do you need to be near the ship? It is recommend to play with this off.");
			CONFIDENCE = ((BaseUnityPlugin)this).Config.Bind<double>("Recognition", "Confidence", 0.2, "What amount of confidence is require for it to be classified as recognized. Higher values may help with false positives but may increase times it does not work. Value between 0 and 1.");
			OPEN_DOORS_COMMAND = ((BaseUnityPlugin)this).Config.Bind<string>("Commands", "OpenShipDoors", "open doors,open ship doors", "What voice phrases should open the ship doors. Each phrase should be seperated with a comma");
			CLOSE_DOORS_COMMAND = ((BaseUnityPlugin)this).Config.Bind<string>("Commands", "CloseShipDoors", "close doors,close ship doors", "What voice phrases should close the ship doors. Each phrase should be seperated with a comma");
			ACTIVATE_TELEPORT_COMMAND = ((BaseUnityPlugin)this).Config.Bind<string>("Commands", "ActivateTeleporter", "teleport,teleport player", "What voice phrases should activate the ship teleporter. Each phrase should be seperated with a comma");
			TOGGLE_CAMERA = ((BaseUnityPlugin)this).Config.Bind<string>("Commands", "ToggleCamera", "camera on,camera off, camera toggle", "What voice phrases should toggle the camera. Each phrase should be seperated with a comma");
			SWITCH_CAMERA = ((BaseUnityPlugin)this).Config.Bind<string>("Commands", "SwitchCamera", "camera switch,switch camera,camera next", "What voice phrases should switch the camera. Each phrase should be seperated with a comma");
			TOGGLE_LIGHTS = ((BaseUnityPlugin)this).Config.Bind<string>("Commands", "ToggleLights", "lights on,lights off,toggle lights,night night", "What voice phrases should toggle the ship lights. Each phrase should be seperated with a comma");
			PULL_LEVER = ((BaseUnityPlugin)this).Config.Bind<string>("Commands", "PullLever", "launch,take off", "What voice phrases should cause the ship to take off. Each phrase should be seperated with a comma");
			ACTIVATE_INVERSE_TELEPORT_COMMAND = ((BaseUnityPlugin)this).Config.Bind<string>("Commands", "ActivateInvertedTeleporter", "inverse teleport,inverse teleport player", "What voice phrases should activate the ship inverted teleporter. Each phrase should be seperated with a comma");
			TOGGLE_SHIP_HORN = ((BaseUnityPlugin)this).Config.Bind<string>("Commands", "ToggleShipHorn", "ship horn", "What voice phrases should activate the ship loud horn. Each phrase should be seperated with a comma");
			RING_COMPANY_BELL = ((BaseUnityPlugin)this).Config.Bind<string>("Commands", "RingCompanyBell", "ring bell", "What voice phrases should activate the company bell. Each phrase should be seperated with a comma");
			TOGGLE_TELEVISION = ((BaseUnityPlugin)this).Config.Bind<string>("Commands", "ToggleTelevision", "television", "What voice phrases should toggle the television. Each phrase should be seperated with a comma");
			TOGGLE_PLUSHIE = ((BaseUnityPlugin)this).Config.Bind<string>("Commands", "TogglePlushie", "plushie,plush", "What voice phrases should toggle the plushie pajama man. Each phrase should be seperated with a comma");
			TOGGLE_SHOWER = ((BaseUnityPlugin)this).Config.Bind<string>("Commands", "ToggleShower", "shower", "What voice phrases should toggle the shower. Each phrase should be seperated with a comma");
			TOGGLE_TOILET = ((BaseUnityPlugin)this).Config.Bind<string>("Commands", "ToggleToilet", "toilet,flush toilet,flush", "What voice phrases should flush the toilet. Each phrase should be seperated with a comma");
			TOGGLE_SPEAKER = ((BaseUnityPlugin)this).Config.Bind<string>("Commands", "ToggleSpeaker", "speaker,skip,intro skip", "What voice phrases should toggle the speaker. Each phrase should be seperated with a comma");
			TOGGLE_JACKOLANTERN = ((BaseUnityPlugin)this).Config.Bind<string>("Commands", "ToggleJackOLantern", "lantern,jacko", "What voice phrases should toggle the Jack-O-Lantern. Each phrase should be seperated with a comma");
			TOGGLE_COMPANY_TRAPDOOR = ((BaseUnityPlugin)this).Config.Bind<string>("Commands", "ToggleCompanyTrapdoor", "trap,trapdoor", "What voice phrases should toggle the trapdoor into at the Company Building. Each phrase should be seperated with a comma");
			ACTIVATE_RADAR_BOOSTER_FLASH = ((BaseUnityPlugin)this).Config.Bind<string>("Commands", "ActivateRadarBoosterFlash", "flash", "What voice phrases should activate the flash of the radar booster. Each phrase should be seperated with a comma");
			ACTIVATE_RADAR_BOOSTER_PING = ((BaseUnityPlugin)this).Config.Bind<string>("Commands", "ActivateRadarBoosterPing", "ping", "What voice phrases should ping the radar booster. Each phrase should be seperated with a comma");
			logger.LogInfo((object)"Performing any needed config migrations");
			if (CONFIG_VERSION.Value == 1)
			{
				CONFIG_VERSION.Value = 2;
				if (CONFIDENCE.Value == 0.2)
				{
					CONFIDENCE.Value = 0.85;
				}
			}
			logger.LogInfo((object)"Registering voice commands!");
			Voice.RegisterPhrases(CollectionExtensions.AddRangeToArray<string>(CollectionExtensions.AddRangeToArray<string>(CollectionExtensions.AddRangeToArray<string>(CollectionExtensions.AddRangeToArray<string>(CollectionExtensions.AddRangeToArray<string>(CollectionExtensions.AddRangeToArray<string>(CollectionExtensions.AddRangeToArray<string>(CollectionExtensions.AddRangeToArray<string>(CollectionExtensions.AddRangeToArray<string>(CollectionExtensions.AddRangeToArray<string>(CollectionExtensions.AddRangeToArray<string>(CollectionExtensions.AddRangeToArray<string>(CollectionExtensions.AddRangeToArray<string>(CollectionExtensions.AddRangeToArray<string>(CollectionExtensions.AddRangeToArray<string>(CollectionExtensions.AddRangeToArray<string>(CollectionExtensions.AddRangeToArray<string>(CollectionExtensions.AddRangeToArray<string>(OPEN_DOORS_COMMAND.Value.Split(','), CLOSE_DOORS_COMMAND.Value.Split(',')), ACTIVATE_TELEPORT_COMMAND.Value.Split(',')), SWITCH_CAMERA.Value.Split(',')), TOGGLE_CAMERA.Value.Split(',')), TOGGLE_LIGHTS.Value.Split(',')), PULL_LEVER.Value.Split(',')), ACTIVATE_INVERSE_TELEPORT_COMMAND.Value.Split(',')), TOGGLE_SHIP_HORN.Value.Split(',')), RING_COMPANY_BELL.Value.Split(',')), TOGGLE_TELEVISION.Value.Split(',')), TOGGLE_PLUSHIE.Value.Split(',')), TOGGLE_SHOWER.Value.Split(',')), TOGGLE_TOILET.Value.Split(',')), TOGGLE_SPEAKER.Value.Split(',')), TOGGLE_JACKOLANTERN.Value.Split(',')), TOGGLE_COMPANY_TRAPDOOR.Value.Split(',')), ACTIVATE_RADAR_BOOSTER_FLASH.Value.Split(',')), ACTIVATE_RADAR_BOOSTER_PING.Value.Split(',')));
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object __, VoiceRecognitionEventArgs args)
			{
				if (!((double)args.Confidence < CONFIDENCE.Value) && IsPlayerWithinShipBounds())
				{
					if (OPEN_DOORS_COMMAND.Value.Split(',').Contains(args.Message))
					{
						HangarShipDoor val2 = Object.FindFirstObjectByType<HangarShipDoor>();
						if ((Object)(object)val2 != (Object)null)
						{
							InteractTrigger component = ((Component)((Component)val2).transform.Find("HangarDoorButtonPanel/StartButton/Cube (2)")).GetComponent<InteractTrigger>();
							TriggerButton(component);
							logger.LogInfo((object)"Open Doors");
						}
					}
					if (CLOSE_DOORS_COMMAND.Value.Split(',').Contains(args.Message))
					{
						HangarShipDoor val3 = Object.FindFirstObjectByType<HangarShipDoor>();
						if ((Object)(object)val3 != (Object)null)
						{
							InteractTrigger component2 = ((Component)((Component)val3).transform.Find("HangarDoorButtonPanel/StopButton/Cube (3)")).GetComponent<InteractTrigger>();
							TriggerButton(component2);
							logger.LogInfo((object)"Close Doors");
						}
					}
					if (ACTIVATE_TELEPORT_COMMAND.Value.Split(',').Contains(args.Message))
					{
						GameObject val4 = GameObject.Find("Teleporter(Clone)/ButtonContainer/ButtonAnimContainer/RedButton");
						if ((Object)(object)val4 != (Object)null)
						{
							TriggerButton(val4.GetComponent<InteractTrigger>());
							logger.LogInfo((object)"Teleport");
						}
					}
					if (SWITCH_CAMERA.Value.Split(',').Contains(args.Message))
					{
						GameObject val5 = GameObject.Find("Environment/HangarShip/ShipModels2b/MonitorWall/Cube.001/CameraMonitorSwitchButton/Cube (2)");
						if ((Object)(object)val5 != (Object)null)
						{
							TriggerButton(val5.GetComponent<InteractTrigger>());
							logger.LogInfo((object)"Switch Camera");
						}
					}
					if (TOGGLE_CAMERA.Value.Split(',').Contains(args.Message))
					{
						GameObject val6 = GameObject.Find("Environment/HangarShip/ShipModels2b/MonitorWall/Cube.001/CameraMonitorOnButton/Cube (2)");
						if ((Object)(object)val6 != (Object)null)
						{
							TriggerButton(val6.GetComponent<InteractTrigger>());
							logger.LogInfo((object)"Toggle Camera");
						}
					}
					if (TOGGLE_LIGHTS.Value.Split(',').Contains(args.Message))
					{
						GameObject val7 = GameObject.Find("Environment/HangarShip/LightSwitchContainer/LightSwitch");
						if ((Object)(object)val7 != (Object)null)
						{
							TriggerButton(val7.GetComponent<InteractTrigger>());
							logger.LogInfo((object)"Lights");
						}
					}
					if (PULL_LEVER.Value.Split(',').Contains(args.Message))
					{
						logger.LogInfo((object)"This is bugged for the moment");
					}
					if (ACTIVATE_INVERSE_TELEPORT_COMMAND.Value.Split(',').Contains(args.Message))
					{
						GameObject val8 = GameObject.Find("InverseTeleporter(Clone)/ButtonContainer/ButtonAnimContainer/RedButton");
						if ((Object)(object)val8 != (Object)null)
						{
							TriggerButton(val8.GetComponent<InteractTrigger>());
							logger.LogInfo((object)"Inverse Teleport");
						}
					}
					if (TOGGLE_SHIP_HORN.Value.Split(',').Contains(args.Message))
					{
						ShipAlarmCord val9 = Object.FindFirstObjectByType<ShipAlarmCord>();
						if ((Object)(object)val9 != (Object)null)
						{
							val9.HoldCordDown();
							logger.LogInfo((object)"Ship Horn");
						}
					}
					if (RING_COMPANY_BELL.Value.Split(',').Contains(args.Message))
					{
						GameObject val10 = GameObject.Find("BellDinger/Trigger");
						if ((Object)(object)val10 != (Object)null)
						{
							TriggerButton(val10.GetComponent<InteractTrigger>());
							logger.LogInfo((object)"Company Bell");
						}
					}
					if (TOGGLE_TELEVISION.Value.Split(',').Contains(args.Message))
					{
						GameObject val11 = GameObject.Find("TelevisionContainer(Clone)/Cube");
						if ((Object)(object)val11 != (Object)null)
						{
							TriggerButton(val11.GetComponent<InteractTrigger>());
							logger.LogInfo((object)"Television");
						}
					}
					if (TOGGLE_PLUSHIE.Value.Split(',').Contains(args.Message))
					{
						GameObject val12 = GameObject.Find("PlushiePJManContainer(Clone)/TouchTrigger");
						if ((Object)(object)val12 != (Object)null)
						{
							TriggerButton(val12.GetComponent<InteractTrigger>());
							logger.LogInfo((object)"Plushie pajama man");
						}
					}
					if (TOGGLE_SHOWER.Value.Split(',').Contains(args.Message))
					{
						GameObject val13 = GameObject.Find("Shower(Clone)/InteractTrigger");
						if ((Object)(object)val13 != (Object)null)
						{
							TriggerButton(val13.GetComponent<InteractTrigger>());
							logger.LogInfo((object)"Shower");
						}
					}
					if (TOGGLE_TOILET.Value.Split(',').Contains(args.Message))
					{
						GameObject val14 = GameObject.Find("Toilet(Clone)/Cube");
						if ((Object)(object)val14 != (Object)null)
						{
							TriggerButton(val14.GetComponent<InteractTrigger>());
							logger.LogInfo((object)"Toilet");
						}
					}
					if (TOGGLE_SPEAKER.Value.Split(',').Contains(args.Message))
					{
						GameObject val15 = GameObject.Find("Environment/HangarShip/ShipModels2b/Cube.005 (2)/Cube");
						if ((Object)(object)val15 != (Object)null)
						{
							TriggerButton(val15.GetComponent<InteractTrigger>());
							logger.LogInfo((object)"Speaker");
						}
					}
					if (TOGGLE_JACKOLANTERN.Value.Split(',').Contains(args.Message))
					{
						GameObject val16 = GameObject.Find("PumpkinUnlockableContainer/HitPumpkinTrigger");
						if ((Object)(object)val16 != (Object)null)
						{
							TriggerButton(val16.GetComponent<InteractTrigger>());
							logger.LogInfo((object)"Jack-O-Lantern");
						}
					}
					if (TOGGLE_COMPANY_TRAPDOOR.Value.Split(',').Contains(args.Message))
					{
						GameObject val17 = GameObject.Find("Environment/Map/CompanyPlanet/TrapDoor");
						if ((Object)(object)val17 != (Object)null)
						{
							TriggerButton(val17.GetComponent<InteractTrigger>());
							logger.LogInfo((object)"Company Trapdoor");
						}
					}
					if (ACTIVATE_RADAR_BOOSTER_FLASH.Value.Split(',').Contains(args.Message))
					{
						GameObject val18 = GameObject.Find(" Environment/HangarShip/RadarBoosterDevice(Clone)");
						RadarBoosterItem val19 = Object.FindAnyObjectByType<RadarBoosterItem>();
						if ((Object)(object)val19 != (Object)null)
						{
							logger.LogInfo((object)("C'est le flash enculé " + val19.radarBoosterName + " c'est lui"));
						}
						StartOfRound.Instance.mapScreen.FlashRadarBooster(StartOfRound.Instance.mapScreen.targetTransformIndex);
						logger.LogInfo((object)"FLAAAAAAAAAASH");
					}
					if (ACTIVATE_RADAR_BOOSTER_PING.Value.Split(',').Contains(args.Message))
					{
						GameObject val20 = GameObject.Find("Environment/HangarShip/RadarBoosterDevice(Clone)");
						RadarBoosterItem[] array = Object.FindObjectsOfType<RadarBoosterItem>();
						if (array != null)
						{
							List<string> list = new List<string>();
							List<string> list2 = new List<string>();
							for (int i = 0; i < StartOfRound.Instance.mapScreen.radarTargets.Count; i++)
							{
								list.Add(StartOfRound.Instance.mapScreen.radarTargets[i].name);
								Debug.Log((object)$"name {i}: {list[i]}");
							}
							for (int j = 0; j < 2; j++)
							{
								if ((Object)(object)array[j] != (Object)null)
								{
									list2.Add(array[j].radarBoosterName);
								}
								Debug.Log((object)$"name {j}: {list2[j]}");
							}
						}
						StartOfRound.Instance.mapScreen.PingRadarBooster(StartOfRound.Instance.mapScreen.targetTransformIndex);
						StartOfRound.Instance.mapScreen.PingRadarBooster(1);
						logger.LogInfo((object)"PING PONG");
					}
				}
			});
			logger.LogInfo((object)"Creating mod settings menu...");
			ModSettingsConfig val = new ModSettingsConfig();
			val.Name = "ShipVoiceCommandsv2";
			val.Id = "shipvoicecommandsv2.me.loaforc.arceusyoluffy";
			val.Version = "2.0.4";
			val.Description = "Adds simple voice commands to control your ship!";
			val.MenuComponents = (MenuComponent[])(object)new MenuComponent[2]
			{
				(MenuComponent)new LabelComponent
				{
					Text = "Increase confidence to decrease false positives. Increasing confidence may also make it not register sometimes."
				},
				(MenuComponent)new SliderComponent
				{
					Text = "Confidence",
					Value = (float)CONFIDENCE.Value * 100f,
					OnValueChanged = delegate(SliderComponent self, float value)
					{
						logger.LogInfo((object)$"Confidence slider set to: {value}, current confidence percent: {CONFIDENCE.Value} setting to -> {value / 100f}");
						CONFIDENCE.Value = value / 100f;
					}
				}
			};
			ModMenu.RegisterMod(val);
			logger.LogInfo((object)"ShipVoiceCommandsv2:2.0.4 has succesfully loaded!");
		}

		private void TriggerButton(InteractTrigger trigger)
		{
			trigger.Interact(((Component)GameNetworkManager.Instance.localPlayerController).transform);
		}

		private bool IsPlayerWithinShipBounds()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			StartOfRound val = Object.FindFirstObjectByType<StartOfRound>();
			if ((Object)(object)val == (Object)null)
			{
				return false;
			}
			int sceneCount = SceneManager.sceneCount;
			Scene[] array = (Scene[])(object)new Scene[sceneCount];
			int num = 0;
			for (int i = 0; i < sceneCount; i++)
			{
				array[i] = SceneManager.GetSceneAt(i);
				if (((Scene)(ref array[i])).name == "CompanyBuilding")
				{
					num++;
				}
			}
			if (num == 1)
			{
				return true;
			}
			if (ARE_COMMANDS_GLOBAL.Value)
			{
				return true;
			}
			if (GameNetworkManager.Instance.localPlayerController.isPlayerDead)
			{
				return false;
			}
			Bounds bounds = val.shipBounds.bounds;
			return ((Bounds)(ref bounds)).Contains(((Component)GameNetworkManager.Instance.localPlayerController).transform.position);
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "ShipVoiceCommandsv2";

		public const string PLUGIN_NAME = "ShipVoiceCommandsv2";

		public const string PLUGIN_VERSION = "2.0.4";
	}
}