Decompiled source of SafehouseProgression v1.1.3

NGA.SafehouseProgression.dll

Decompiled a year ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using Atlas;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Sodalite.ModPanel;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyCompany("NGA")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Persistent player progression! Raid, stash loot, and deploy with seemless scene/loadout saving.")]
[assembly: AssemblyFileVersion("0.0.1.0")]
[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyProduct("NGA.SafehouseProgression")]
[assembly: AssemblyTitle("BepInEx Plugin Title")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.1.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.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace BepInEx
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class BepInAutoPluginAttribute : Attribute
	{
		public BepInAutoPluginAttribute(string id = null, string name = null, string version = null)
		{
		}
	}
}
namespace BepInEx.Preloader.Core.Patching
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class PatcherAutoPluginAttribute : Attribute
	{
		public PatcherAutoPluginAttribute(string id = null, string name = null, string version = null)
		{
		}
	}
}
namespace NGA
{
	[BepInPlugin("NGA.SafehouseProgression", "SafehouseProgression", "0.0.1")]
	[BepInDependency("nrgill28.Sodalite", "1.4.1")]
	[BepInDependency("nrgill28.Atlas", "1.0.0")]
	[BepInProcess("h3vr.exe")]
	public class SafehouseProgression : BaseUnityPlugin
	{
		public struct MyWristButton
		{
			public Action<object> onclick;

			public string name;

			public int priority;

			public MyWristButton(string name_, int priority_, Action<object> clickAction = null)
			{
				onclick = clickAction;
				name = name_;
				priority = priority_;
			}
		}

		[HarmonyPatch(typeof(FVRWristMenu2))]
		[HarmonyPatch("Awake")]
		private class WristMenuAwakeHook
		{
			private static void Postfix(FVRWristMenu2 __instance)
			{
				if ((Object)(object)__instance == (Object)null)
				{
					Logger.LogMessage((object)"FVRWristMenu2 is null!?");
				}
				Dictionary<GameObject, MyWristButton> existingButtons = new Dictionary<GameObject, MyWristButton>();
				FVRWristMenuSection_Safehouse fVRWristMenuSection_Safehouse = AddWristMenuSectionAndButton(__instance, null, "Safehouse™", existingButtons, new MyWristButton("Extract-to-Safehouse", 3, ExtractToSafehouse));
				AddWristMenuSectionAndButton(__instance, fVRWristMenuSection_Safehouse, "Safehouse", existingButtons, new MyWristButton("Leave-the-Safehouse", 2, LeaveTheSafehouse));
				AddWristMenuSectionAndButton(__instance, fVRWristMenuSection_Safehouse, "Safehouse", existingButtons, new MyWristButton("Deployment-Loadout", 1, DeploySafehouseLoadout));
				int num = 0;
				foreach (GameObject item in existingButtons.Keys.OrderBy((GameObject x) => existingButtons[x].priority))
				{
					Text componentInChildren = ((Component)item.transform).GetComponentInChildren<Text>();
					if (num == 0)
					{
						fVRWristMenuSection_Safehouse.TXT_Deploy = componentInChildren;
					}
					if (num == 1)
					{
						fVRWristMenuSection_Safehouse.TXT_Leave = componentInChildren;
					}
					if (num == 2)
					{
						fVRWristMenuSection_Safehouse.TXT_Extract = componentInChildren;
					}
					num++;
				}
			}
		}

		[HarmonyPatch(typeof(FVRSceneSettings))]
		[HarmonyPatch("LoadDefaultSceneRoutine")]
		private class FVRSceneSettingsLoadDefaultSceneRoutineHook
		{
			private static void Prefix(FVRSceneSettings __instance)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				Scene activeScene = SceneManager.GetActiveScene();
				if (((Scene)(ref activeScene)).name == GetSafehouseName() && extracting_to_safehouse_need_map && Object.op_Implicit((Object)(object)GM.CurrentSceneSettings) && (Object)(object)GM.CurrentSceneSettings.DefaultVaultSceneConfig != (Object)null)
				{
					GM.CurrentSceneSettings.DefaultVaultSceneConfig = null;
				}
			}

			private static void Postfix(FVRSceneSettings __instance)
			{
				//IL_0028: Unknown result type (might be due to invalid IL or missing references)
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				//IL_0045: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0076: Expected O, but got Unknown
				//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)__instance == (Object)null)
				{
					Logger.LogMessage((object)"FVRSceneSettings is null!?");
				}
				ManualLogSource logger = Logger;
				Scene activeScene = SceneManager.GetActiveScene();
				logger.LogMessage((object)("Trying to save in scene: " + ((Scene)(ref activeScene)).name));
				activeScene = SceneManager.GetActiveScene();
				if (((Scene)(ref activeScene)).name == GetSafehouseName() && extracting_to_safehouse_need_map)
				{
					extracting_to_safehouse_need_map = false;
					VaultFile val = new VaultFile();
					string text = GetSafehouseName() + "_" + safehouse_persistent_filename;
					if (!VaultSystem.LoadVaultFile(text, (VaultFileDisplayMode)2, ref val))
					{
						Logger.LogMessage((object)"WARNING: Didn't find Safehouse file to load :(");
					}
					Logger.LogMessage((object)val);
					string text2 = default(string);
					if (!VaultSystem.SpawnObjects((VaultFileDisplayMode)2, val, ref text2, (Transform)null, Vector3.up))
					{
						Logger.LogMessage((object)"ERROR: Loading extracted safehouse scene file failed :(");
						Logger.LogMessage((object)text2);
					}
				}
			}
		}

		[HarmonyPatch(typeof(FVRPlayerBody))]
		[HarmonyPatch("Init")]
		private class FvrPlayerBodyInitHook
		{
			private static void Postfix(FVRPlayerBody __instance, FVRSceneSettings SceneSettings)
			{
				//IL_0041: Unknown result type (might be due to invalid IL or missing references)
				//IL_0053: Unknown result type (might be due to invalid IL or missing references)
				//IL_005e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0065: Expected O, but got Unknown
				//IL_007a: Unknown result type (might be due to invalid IL or missing references)
				//IL_008f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0096: Expected O, but got Unknown
				Logger.LogMessage((object)"FVRPlayerBody Init HOOKED!");
				if ((Object)(object)__instance == (Object)null)
				{
					Logger.LogMessage((object)"FVRPlayerBody is null!?");
				}
				if (extracting_to_safehouse_need_loadout)
				{
					extracting_to_safehouse_need_loadout = false;
					Transform transform = new GameObject().transform;
					transform.position = ((Component)__instance).transform.position;
					VaultFile val = new VaultFile();
					bool flag = VaultSystem.LoadVaultFile(raid_extracted_loadout_filename, (VaultFileDisplayMode)1, ref val);
					string text = default(string);
					if (VaultSystem.SpawnObjects((VaultFileDisplayMode)1, val, ref text, transform, Vector3.zero))
					{
						VaultFile val2 = new VaultFile();
						VaultSystem.SaveVaultFile(raid_extracted_loadout_filename, (VaultFileDisplayMode)1, val2);
					}
					else
					{
						Logger.LogMessage((object)"ERROR: Loading extracted loadout file failed :(");
						Logger.LogMessage((object)text);
					}
				}
			}
		}

		public static string raid_extracted_loadout_filename = "Loadout_Extracted_From_Raid";

		public static string safehouse_persistent_filename = "Safehouse_Persitent_Filename";

		public static string safehouse_save_filename = "BU";

		public static string safehouse_deployment_loadout_filename = "Safehouse_Deployment_Filename";

		public static bool extracting_to_safehouse_need_loadout = false;

		public static bool extracting_to_safehouse_need_map = false;

		private static ConfigEntry<int> config_safehouse_index;

		private static ConfigEntry<string> config_safehouse_scene_name;

		private static ConfigEntry<string> config_safehouse_scene_name_TWO;

		private static ConfigEntry<string> config_safehouse_scene_name_THREE;

		internal static ManualLogSource Logger { get; private set; }

		private void Awake()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			Logger = ((BaseUnityPlugin)this).Logger;
			Harmony val = new Harmony("NGA.SafehouseProgression");
			SetUpConfigFields();
			val.PatchAll();
			Logger.LogMessage((object)"Hello, world! Sent from NGA.SafehouseProgression 0.0.1");
		}

		private void SetUpConfigFields()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			config_safehouse_index = ((BaseUnityPlugin)this).Config.Bind<int>("House", "SceneID INDEX", 1, new ConfigDescription("Swap between 3 safehouse scene IDs you specified below. All your safehouses will be saved.", (AcceptableValueBase)new AcceptableValueIntRangeStep(1, 3, 1), new object[0]));
			config_safehouse_scene_name = ((BaseUnityPlugin)this).Config.Bind<string>("House", "Safehouse Scene ID: 1", "GP_Hangar", "Examples: IndoorRange, ArizonaTargets, Grillhouse_2Story. Find more in Thunderstore. Will CRASH if you get ID wrong.");
			config_safehouse_scene_name_TWO = ((BaseUnityPlugin)this).Config.Bind<string>("House", "Safehouse Scene ID: 2", "IndoorRange", "Index: 2");
			config_safehouse_scene_name_THREE = ((BaseUnityPlugin)this).Config.Bind<string>("House", "Safehouse Scene ID: 3", "Grillhouse_2Story", "Index: 3");
		}

		private static string GetSafehouseName()
		{
			List<string> list = new List<string> { config_safehouse_scene_name.Value, config_safehouse_scene_name_TWO.Value, config_safehouse_scene_name_THREE.Value };
			return list[config_safehouse_index.Value - 1];
		}

		private static void AddWristMenuButton(FVRWristMenuSection shMenuSection, MyWristButton new_button, Transform buttonTransform)
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Expected O, but got Unknown
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Expected O, but got Unknown
			((Component)buttonTransform).GetComponentInChildren<Text>().text = new_button.name;
			Button component = ((Component)buttonTransform).GetComponent<Button>();
			component.onClick = new ButtonClickedEvent();
			((UnityEvent)component.onClick).AddListener((UnityAction)delegate
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				SM.PlayGlobalUISound((GlobalUISound)0, buttonTransform.position);
				new_button.onclick(component);
			});
		}

		private static void ResizeAndReorderSection(RectTransform background, int oldButtonCount, Dictionary<GameObject, MyWristButton> existingButtons)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			Vector2 sizeDelta = background.sizeDelta;
			int childCount = ((Transform)background).childCount;
			RectTransform val = (RectTransform)((Transform)background).GetChild(0);
			float num = val.sizeDelta.y * ((Transform)val).localScale.y;
			float num2 = (sizeDelta.y - num * (float)oldButtonCount) / (float)(oldButtonCount + 2);
			float num3 = num + num2;
			background.sizeDelta = new Vector2(sizeDelta.x, (float)childCount * num3 + num2 * 2f);
			float num4 = num3 / 2f + num2;
			foreach (GameObject item in existingButtons.Keys.OrderBy((GameObject x) => existingButtons[x].priority))
			{
				item.transform.localPosition = new Vector3(0f, num4, 0f);
				num4 += num3;
			}
		}

		private static FVRWristMenuSection_Safehouse AddWristMenuSectionAndButton(FVRWristMenu2 instance2, FVRWristMenuSection_Safehouse menuSection, string sectionText, Dictionary<GameObject, MyWristButton> existingButtons, MyWristButton new_button)
		{
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Expected O, but got Unknown
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Expected O, but got Unknown
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Expected O, but got Unknown
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Expected O, but got Unknown
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Expected O, but got Unknown
			if ((Object)(object)menuSection == (Object)null)
			{
				FVRWristMenuSection val = instance2.Sections.First((FVRWristMenuSection x) => (object)((object)x).GetType() == typeof(FVRWristMenuSection_Spawn));
				Transform transform = ((Component)val).transform;
				FVRWristMenuSection val2 = Object.Instantiate<FVRWristMenuSection>(val, transform.position, transform.rotation, transform.parent);
				GameObject gameObject = ((Component)val2).gameObject;
				Object.Destroy((Object)(object)val2);
				Renderer component = gameObject.GetComponent<Renderer>();
				if ((Object)(object)component != (Object)null)
				{
					Color color = default(Color);
					((Color)(ref color))..ctor(0.3f, 0.67f, 0.3f, 1f);
					component.material.color = color;
				}
				menuSection = gameObject.AddComponent<FVRWristMenuSection_Safehouse>();
				((FVRWristMenuSection)menuSection).ButtonText = sectionText;
				((FVRWristMenuSection)menuSection).Menu = instance2;
				instance2.Sections.Add((FVRWristMenuSection)(object)menuSection);
				instance2.RegenerateButtons();
				RectTransform val3 = (RectTransform)((Component)menuSection).transform;
				RectTransform val4 = (RectTransform)((Transform)val3).GetChild(0);
				int childCount = ((Transform)val3).childCount;
				for (int num = childCount - 1; num >= 0; num--)
				{
					RectTransform val5 = (RectTransform)((Transform)val3).GetChild(num);
					if (!((Object)(object)val5 == (Object)(object)val4))
					{
						Object.DestroyImmediate((Object)(object)((Component)val5).gameObject);
					}
				}
				existingButtons.Add(((Component)val4).gameObject, new_button);
				AddWristMenuButton((FVRWristMenuSection)(object)menuSection, new_button, (Transform)(object)val4);
				ResizeAndReorderSection(val3, childCount, existingButtons);
				return menuSection;
			}
			RectTransform val6 = (RectTransform)((Component)menuSection).transform;
			Transform child = ((Transform)val6).GetChild(0);
			RectTransform val7 = (RectTransform)Object.Instantiate<GameObject>(((Component)child).gameObject, child.position, child.rotation, child.parent).transform;
			existingButtons.Add(((Component)val7).gameObject, new_button);
			AddWristMenuButton((FVRWristMenuSection)(object)menuSection, new_button, (Transform)(object)val7);
			ResizeAndReorderSection(val6, ((Transform)val6).childCount - 1, existingButtons);
			return menuSection;
		}

		private static void ExtractToSafehouse(object sender)
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Expected O, but got Unknown
			FVRWristMenuSection_Safehouse fVRWristMenuSection_Safehouse = Object.FindObjectOfType<FVRWristMenuSection_Safehouse>();
			if (!fVRWristMenuSection_Safehouse.confirmedExtractToSafehouse)
			{
				fVRWristMenuSection_Safehouse.ResetConfirm();
				fVRWristMenuSection_Safehouse.confirmedExtractToSafehouse = true;
				fVRWristMenuSection_Safehouse.TXT_Extract.text = "Extract-to-Safehouse ??";
				return;
			}
			fVRWristMenuSection_Safehouse.ResetConfirm();
			VaultFile val = new VaultFile();
			if (VaultSystem.FindAndScanObjectsInQuickbelt(val) && !VaultSystem.SaveVaultFile(raid_extracted_loadout_filename, (VaultFileDisplayMode)1, val))
			{
				Logger.LogMessage((object)"ERROR: Extraction Vault file not saved :(");
			}
			extracting_to_safehouse_need_loadout = true;
			extracting_to_safehouse_need_map = true;
			for (int i = 0; i < GM.CurrentSceneSettings.QuitReceivers.Count; i++)
			{
				GM.CurrentSceneSettings.QuitReceivers[i].BroadcastMessage("QUIT", (SendMessageOptions)1);
			}
			if (((AnvilCallbackBase)GM.LoadingCallback).IsCompleted)
			{
				CustomSceneInfo customScene = AtlasPlugin.GetCustomScene(GetSafehouseName());
				if (customScene != null)
				{
					AtlasPlugin.LoadCustomScene(GetSafehouseName());
				}
				else
				{
					SteamVR_LoadLevel.Begin(GetSafehouseName(), false, 0.5f, 0f, 0f, 0f, 1f);
				}
			}
		}

		private static void LeaveTheSafehouse(object sender)
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Expected O, but got Unknown
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Expected O, but got Unknown
			FVRWristMenuSection_Safehouse fVRWristMenuSection_Safehouse = Object.FindObjectOfType<FVRWristMenuSection_Safehouse>();
			if (!fVRWristMenuSection_Safehouse.confirmedLeaveTheSafehouse)
			{
				fVRWristMenuSection_Safehouse.ResetConfirm();
				fVRWristMenuSection_Safehouse.confirmedLeaveTheSafehouse = true;
				fVRWristMenuSection_Safehouse.TXT_Leave.text = "Leave-the-Safehouse ??";
				return;
			}
			fVRWristMenuSection_Safehouse.ResetConfirm();
			VaultFile val = new VaultFile();
			if (VaultSystem.FindAndScanObjectsInQuickbelt(val))
			{
				if (!VaultSystem.SaveVaultFile(safehouse_deployment_loadout_filename, (VaultFileDisplayMode)1, val))
				{
					Logger.LogMessage((object)"ERROR: Deploy Vault file not saved :(");
				}
			}
			else
			{
				Logger.LogMessage((object)"ERROR: Couldn't scan quickbelt to leave safehouse :(");
			}
			VaultFile val2 = new VaultFile();
			if (VaultSystem.FindAndScanObjectsInScene(val2))
			{
				string text = GetSafehouseName() + "_" + safehouse_persistent_filename;
				if (!VaultSystem.SaveVaultFile(text, (VaultFileDisplayMode)2, val2))
				{
					Logger.LogMessage((object)"ERROR: Safehouse Scene Vault file not saved :(");
				}
			}
			int num = Random.Range(1, 3);
			Logger.LogMessage((object)("num " + num));
			if (num == 1)
			{
				VaultFile val3 = new VaultFile();
				if (VaultSystem.FindAndScanObjectsInScene(val3))
				{
					string text2 = DateTime.Now.ToString("yyyyMMdd_HHmmss");
					string text3 = GetSafehouseName() + "_" + safehouse_save_filename + "_" + text2;
					if (!VaultSystem.SaveVaultFile(text3, (VaultFileDisplayMode)2, val3))
					{
						Logger.LogMessage((object)"ERROR: Safehouse BACKUP Scene Vault file not saved :(");
					}
				}
			}
			SteamVR_LoadLevel.Begin("MainMenu3", false, 0.5f, 0f, 0f, 0f, 1f);
		}

		private static void DeploySafehouseLoadout(object sender)
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Expected O, but got Unknown
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Expected O, but got Unknown
			FVRWristMenuSection_Safehouse fVRWristMenuSection_Safehouse = Object.FindObjectOfType<FVRWristMenuSection_Safehouse>();
			if (!fVRWristMenuSection_Safehouse.confirmedDeploySafehouseLoadout)
			{
				fVRWristMenuSection_Safehouse.ResetConfirm();
				fVRWristMenuSection_Safehouse.confirmedDeploySafehouseLoadout = true;
				fVRWristMenuSection_Safehouse.TXT_Deploy.text = "Deployment-Loadout ??";
				return;
			}
			fVRWristMenuSection_Safehouse.ResetConfirm();
			FVRPlayerBody val = Object.FindObjectOfType<FVRPlayerBody>();
			Transform transform = new GameObject().transform;
			transform.position = ((Component)val).transform.position;
			VaultFile val2 = new VaultFile();
			bool flag = VaultSystem.LoadVaultFile(safehouse_deployment_loadout_filename, (VaultFileDisplayMode)1, ref val2);
			string text = default(string);
			bool flag2 = VaultSystem.SpawnObjects((VaultFileDisplayMode)1, val2, ref text, transform, Vector3.zero);
			VaultFile val3 = new VaultFile();
			VaultSystem.SaveVaultFile(safehouse_deployment_loadout_filename, (VaultFileDisplayMode)1, val3);
		}
	}
	public class FVRWristMenuSection_Safehouse : FVRWristMenuSection
	{
		public Text TXT_Deploy;

		public Text TXT_Leave;

		public Text TXT_Extract;

		public bool confirmedDeploySafehouseLoadout = false;

		public bool confirmedLeaveTheSafehouse = false;

		public bool confirmedExtractToSafehouse = false;

		public void ResetConfirm()
		{
			confirmedDeploySafehouseLoadout = false;
			confirmedLeaveTheSafehouse = false;
			confirmedExtractToSafehouse = false;
			TXT_Deploy.text = "Deployment-Loadout";
			TXT_Leave.text = "Leave-the-Safehouse";
			TXT_Extract.text = "Extract-to-Safehouse";
		}

		public override void OnHide()
		{
			ResetConfirm();
		}
	}
}