Decompiled source of BlindItems v1.0.0

BlindItems.dll

Decompiled 8 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using IL.RoR2.UI;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.RoR2;
using On.RoR2.UI;
using RiskOfOptions;
using RiskOfOptions.Options;
using RoR2;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

[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.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("BlindItems")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("BlindItems")]
[assembly: AssemblyTitle("BlindItems")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.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 BlindItems
{
	public class ItemAddressables
	{
		public static readonly AssetBundle assets = AssetBundle.LoadFromFile(Path.Combine(Paths.PluginPath, "MarkTullius-BlindItems/blinditemsbundle"));

		public Sprite whiteSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Scrap/texScrapWhiteIcon.png").WaitForCompletion();

		public Sprite greenSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Scrap/texScrapGreenIcon.png").WaitForCompletion();

		public Sprite redSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Scrap/texScrapRedIcon.png").WaitForCompletion();

		public Sprite bossSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Scrap/texScrapYellowIcon.png").WaitForCompletion();

		public Sprite voidWhiteSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/ScrapVoid/texVoidScrapWhiteIcon.png").WaitForCompletion();

		public Sprite voidGreenSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/ScrapVoid/texVoidScrapGreenIcon.png").WaitForCompletion();

		public Sprite voidRedSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/ScrapVoid/texVoidScrapRedIcon.png").WaitForCompletion();

		public Sprite lunarSprite = assets.LoadAsset<Sprite>("texScrapLunarIcon.png");

		public Sprite equipSprite = assets.LoadAsset<Sprite>("texScrapEquipmentIcon.png");

		public Sprite voidBossSprite = assets.LoadAsset<Sprite>("texVoidScrapBossIcon.png");

		public static Sprite modIcon = assets.LoadAsset<Sprite>("modIcon.png");
	}
	public class ItemInventory
	{
		public ItemInventory()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Expected O, but got Unknown
			GameEndReportPanelController.SetDisplayData += (hook_SetDisplayData)delegate(orig_SetDisplayData orig, GameEndReportPanelController self, DisplayData newDisplayData)
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Expected O, but got Unknown
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Expected O, but got Unknown
				//IL_0027: 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_003f: Expected O, but got Unknown
				//IL_0047: Unknown result type (might be due to invalid IL or missing references)
				//IL_0051: Expected O, but got Unknown
				ItemIcon.SetItemIndex += new Manipulator(AllocateItemIcons);
				EquipmentCatalog.GetEquipmentDef += new hook_GetEquipmentDef(AllocateEquipIcon);
				orig.Invoke(self, newDisplayData);
				ItemIcon.SetItemIndex -= new Manipulator(AllocateItemIcons);
				EquipmentCatalog.GetEquipmentDef -= new hook_GetEquipmentDef(AllocateEquipIcon);
			};
		}

		public void AllocateItemIcons(ILContext context)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(context);
			MethodInfo method = typeof(ItemCatalog).GetMethod("GetItemDef");
			val.GotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction i) => ILPatternMatchingExt.MatchCall(i, (MethodBase)method)
			});
			val.Remove();
			method = typeof(Notifications).GetMethod("GetOrigItemDef");
			val.Emit(OpCodes.Call, (MethodBase)method);
		}

		public EquipmentDef AllocateEquipIcon(orig_GetEquipmentDef orig, EquipmentIndex equipmentIndex)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return Notifications.GetOrigEquipDef(equipmentIndex);
		}
	}
	[BepInPlugin("MarkTullius.BlindItems", "BlindItems", "1.0.0")]
	public class Main : BaseUnityPlugin
	{
		public const string PluginGUID = "MarkTullius.BlindItems";

		public const string PluginAuthor = "MarkTullius";

		public const string PluginName = "BlindItems";

		public const string PluginVersion = "1.0.0";

		private Obfuscate _obfuscate;

		private Notifications _notifs;

		private Randomise _randomise;

		private PrinterFix _printerFix;

		private ItemInventory _itemInventory;

		public static List<ItemDef> itemNotifications;

		public static List<EquipmentDef> equipNotifications;

		public const string desc = "Obscures the pickup models and inventory icons, for items and equipments, by replacing them with '?' to add a cursed challenge where you don't know what you're picking up (scrapping/printing) until you have done so.";

		public static ConfigEntry<bool> RandomiseOrder { get; set; }

		public static ConfigEntry<bool> ObscureEquipment { get; set; }

		public static ConfigEntry<bool> ObscureNotifs { get; set; }

		public void Awake()
		{
			InitConfig();
			if (Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"))
			{
				BuildSettings();
			}
			else
			{
				Debug.Log((object)"Risk of Options is not installed, skipping setup.");
			}
			itemNotifications = new List<ItemDef>();
			equipNotifications = new List<EquipmentDef>();
			_obfuscate = new Obfuscate(itemNotifications, equipNotifications);
			if (!ObscureNotifs.Value)
			{
				_notifs = new Notifications(itemNotifications, equipNotifications);
			}
			_randomise = new Randomise();
			_printerFix = new PrinterFix();
			_itemInventory = new ItemInventory();
		}

		public void InitConfig()
		{
			RandomiseOrder = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Randomise Item Order Each Stage", false, "Turn on to randomise the order of your items every time you load into a new stage.");
			ObscureEquipment = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Obscure Current Equipment", true, "Turn off to retain the icon for your currently held equipment(s). Requires a restart");
			ObscureNotifs = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Obscure Notifications", false, "Turn off to retain the icon and descriptions upon pickup/printing/scrapping. Requires a restart");
		}

		public void BuildSettings()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Expected O, but got Unknown
			ModSettingsManager.SetModDescription("Obscures the pickup models and inventory icons, for items and equipments, by replacing them with '?' to add a cursed challenge where you don't know what you're picking up (scrapping/printing) until you have done so.", "MarkTullius.BlindItems", "BlindItems");
			ModSettingsManager.SetModIcon(ItemAddressables.modIcon);
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(RandomiseOrder));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(ObscureEquipment, true));
		}
	}
	public class Notifications
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_PushEquipmentNotification <>9__9_0;

			internal void <PushEquipmentNotification>b__9_0(orig_PushEquipmentNotification orig, CharacterMaster characterMaster, EquipmentIndex equipmentIndex)
			{
				//IL_000a: Unknown result type (might be due to invalid IL or missing references)
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_004d: Invalid comparison between Unknown and I4
				//IL_0074: Unknown result type (might be due to invalid IL or missing references)
				//IL_0080: Expected O, but got Unknown
				orig.Invoke(characterMaster, (EquipmentIndex)(-1));
				EquipmentDef origEquipDef = GetOrigEquipDef(equipmentIndex);
				if (!((NetworkBehaviour)characterMaster).hasAuthority)
				{
					Debug.LogError((object)("Can't PushItemNotification for " + Util.GetBestMasterName(characterMaster) + " because they aren't local."));
					return;
				}
				CharacterMasterNotificationQueue notificationQueueForMaster = CharacterMasterNotificationQueue.GetNotificationQueueForMaster(characterMaster);
				if (Object.op_Implicit((Object)(object)notificationQueueForMaster) && (int)equipmentIndex != -1 && !((Object)(object)origEquipDef == (Object)null))
				{
					float num = 6f;
					notificationQueueForMaster.PushNotification(new NotificationInfo((object)origEquipDef, (TransformationInfo)null), num);
				}
			}
		}

		public static List<ItemDef> itemNotifs;

		public static List<EquipmentDef> equipNotifs;

		private const float AddedNotificationDuration = 6f;

		private const float RemovedNotificationDuration = 3f;

		public Notifications(List<ItemDef> itemNotifications, List<EquipmentDef> equipNotifications)
		{
			itemNotifs = itemNotifications;
			equipNotifs = equipNotifications;
			Awake();
		}

		public void Awake()
		{
			PushItemNotification();
			PushItemRemovalNotification();
			PushEquipmentNotification();
		}

		public void PushItemNotification()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			CharacterMasterNotificationQueue.PushItemNotification += (hook_PushItemNotification)delegate(orig_PushItemNotification orig, CharacterMaster characterMaster, ItemIndex itemIndex)
			{
				//IL_000a: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Unknown result type (might be due to invalid IL or missing references)
				//IL_003b: Expected O, but got Unknown
				orig.Invoke(characterMaster, (ItemIndex)(-1));
				ItemDef origItemDef = GetOrigItemDef(itemIndex);
				CharacterMasterNotificationQueue notificationQueueForMaster = CharacterMasterNotificationQueue.GetNotificationQueueForMaster(characterMaster);
				if (ItemNotificationHandler(characterMaster, itemIndex, origItemDef, notificationQueueForMaster))
				{
					float num = 6f;
					notificationQueueForMaster.PushNotification(new NotificationInfo((object)origItemDef, (TransformationInfo)null), num);
				}
			};
		}

		public void PushItemRemovalNotification()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			PurchaseInteraction.CreateItemTakenOrb += (hook_CreateItemTakenOrb)delegate(orig_CreateItemTakenOrb orig, Vector3 effectOrigin, GameObject targetObject, ItemIndex itemIndex)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0004: Unknown result type (might be due to invalid IL or missing references)
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(effectOrigin, targetObject, itemIndex);
				BuildItemRemovalNotification(itemIndex);
			};
			ScrapperController.CreateItemTakenOrb += (hook_CreateItemTakenOrb)delegate(orig_CreateItemTakenOrb orig, Vector3 effectOrigin, GameObject targetObject, ItemIndex itemIndex)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0004: Unknown result type (might be due to invalid IL or missing references)
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(effectOrigin, targetObject, itemIndex);
				BuildItemRemovalNotification(itemIndex);
			};
		}

		public void BuildItemRemovalNotification(ItemIndex itemIndex)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Expected O, but got Unknown
			CharacterMaster master = PlayerCharacterMasterController._instances[0].master;
			ItemDef origItemDef = GetOrigItemDef(itemIndex);
			CharacterMasterNotificationQueue notificationQueueForMaster = CharacterMasterNotificationQueue.GetNotificationQueueForMaster(master);
			if (ItemNotificationHandler(master, itemIndex, origItemDef, notificationQueueForMaster))
			{
				float num = 3f;
				TransformationInfo val = new TransformationInfo((TransformationType)3, (object)origItemDef);
				NotificationInfo val2 = new NotificationInfo((object)ItemCatalog.GetItemDef(itemIndex), val);
				notificationQueueForMaster.PushNotification(val2, num);
			}
		}

		public void PushEquipmentNotification()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			object obj = <>c.<>9__9_0;
			if (obj == null)
			{
				hook_PushEquipmentNotification val = delegate(orig_PushEquipmentNotification orig, CharacterMaster characterMaster, EquipmentIndex equipmentIndex)
				{
					//IL_000a: Unknown result type (might be due to invalid IL or missing references)
					//IL_004b: Unknown result type (might be due to invalid IL or missing references)
					//IL_004d: Invalid comparison between Unknown and I4
					//IL_0074: Unknown result type (might be due to invalid IL or missing references)
					//IL_0080: Expected O, but got Unknown
					orig.Invoke(characterMaster, (EquipmentIndex)(-1));
					EquipmentDef origEquipDef = GetOrigEquipDef(equipmentIndex);
					if (!((NetworkBehaviour)characterMaster).hasAuthority)
					{
						Debug.LogError((object)("Can't PushItemNotification for " + Util.GetBestMasterName(characterMaster) + " because they aren't local."));
					}
					else
					{
						CharacterMasterNotificationQueue notificationQueueForMaster = CharacterMasterNotificationQueue.GetNotificationQueueForMaster(characterMaster);
						if (Object.op_Implicit((Object)(object)notificationQueueForMaster) && (int)equipmentIndex != -1 && !((Object)(object)origEquipDef == (Object)null))
						{
							float num = 6f;
							notificationQueueForMaster.PushNotification(new NotificationInfo((object)origEquipDef, (TransformationInfo)null), num);
						}
					}
				};
				<>c.<>9__9_0 = val;
				obj = (object)val;
			}
			CharacterMasterNotificationQueue.PushEquipmentNotification += (hook_PushEquipmentNotification)obj;
		}

		public static ItemDef GetOrigItemDef(ItemIndex itemIndex)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			return itemNotifs.Find((ItemDef itemDef) => itemDef.itemIndex == itemIndex);
		}

		public static EquipmentDef GetOrigEquipDef(EquipmentIndex equipmentIndex)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			return equipNotifs.Find((EquipmentDef equipDef) => equipDef.equipmentIndex == equipmentIndex);
		}

		public bool ItemNotificationHandler(CharacterMaster characterMaster, ItemIndex itemIndex, ItemDef itemDef, CharacterMasterNotificationQueue notificationQueue)
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Invalid comparison between Unknown and I4
			if (!((NetworkBehaviour)characterMaster).hasAuthority)
			{
				Debug.LogError((object)("Can't PushItemNotification for " + Util.GetBestMasterName(characterMaster) + " because they aren't local."));
				return false;
			}
			if (Object.op_Implicit((Object)(object)notificationQueue) && (int)itemIndex != -1 && ((Object)(object)itemDef == (Object)null || itemDef.hidden))
			{
				return false;
			}
			return true;
		}
	}
	public class Obfuscate
	{
		public const string itemName = "???";

		private const string itemDescription = "?????";

		private readonly ItemAddressables _addressables;

		public Obfuscate(List<ItemDef> itemNotifications, List<EquipmentDef> equipNotifications)
		{
			_addressables = new ItemAddressables();
			Awake(itemNotifications, equipNotifications);
		}

		public void Awake(List<ItemDef> itemNotifications, List<EquipmentDef> equipNotifications)
		{
			ObfuscateItems(itemNotifications);
			ObfuscateEquipments(equipNotifications);
		}

		public void ObfuscateItems(List<ItemDef> itemNotifications)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected O, but got Unknown
			ItemCatalog.SetItemDefs += (hook_SetItemDefs)delegate(orig_SetItemDefs orig, ItemDef[] itemDefs)
			{
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				//IL_0069: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Invalid comparison between Unknown and I4
				//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(itemDefs);
				foreach (ItemDef val in itemDefs)
				{
					ItemDef val2 = ScriptableObject.CreateInstance<ItemDef>();
					val2.itemIndex = val.itemIndex;
					val2.pickupIconSprite = val.pickupIconSprite;
					val2.nameToken = val.nameToken;
					val2.pickupToken = val.pickupToken;
					val2.hidden = val.hidden;
					itemNotifications.Add(val2);
					if ((int)val.deprecatedTier != 5)
					{
						val.pickupModelPrefab = PickupCatalog.GetHiddenPickupDisplayPrefab();
						val.nameToken = "???";
						val.pickupToken = "?????";
						val.pickupIconSprite = GetPickupIconSprite(val.deprecatedTier);
					}
				}
			};
		}

		public void ObfuscateEquipments(List<EquipmentDef> equipNotifications)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected O, but got Unknown
			EquipmentCatalog.SetEquipmentDefs += (hook_SetEquipmentDefs)delegate(orig_SetEquipmentDefs orig, EquipmentDef[] equipDefs)
			{
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(equipDefs);
				foreach (EquipmentDef val in equipDefs)
				{
					EquipmentDef val2 = ScriptableObject.CreateInstance<EquipmentDef>();
					val2.equipmentIndex = val.equipmentIndex;
					val2.pickupIconSprite = val.pickupIconSprite;
					val2.nameToken = val.nameToken;
					val2.pickupToken = val.pickupToken;
					equipNotifications.Add(val2);
					val.pickupModelPrefab = PickupCatalog.GetHiddenPickupDisplayPrefab();
					val.nameToken = "???";
					val.pickupToken = "?????";
					val.descriptionToken = "?????";
					if (Main.ObscureEquipment.Value)
					{
						val.pickupIconSprite = _addressables.equipSprite;
					}
				}
			};
		}

		public Sprite GetPickupIconSprite(ItemTier tier)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected I4, but got Unknown
			return (Sprite)((int)tier switch
			{
				0 => _addressables.whiteSprite, 
				1 => _addressables.greenSprite, 
				2 => _addressables.redSprite, 
				4 => _addressables.bossSprite, 
				3 => _addressables.lunarSprite, 
				6 => _addressables.voidWhiteSprite, 
				7 => _addressables.voidGreenSprite, 
				8 => _addressables.voidRedSprite, 
				9 => _addressables.voidBossSprite, 
				_ => null, 
			});
		}
	}
	public class PrinterFix
	{
		private const float yPos = 2.5f;

		public PrinterFix()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Expected O, but got Unknown
			InteractableSpawnCard.Spawn += new hook_Spawn(CorrectPickupPosition);
		}

		public void CorrectPickupPosition(orig_Spawn orig, InteractableSpawnCard self, Vector3 position, Quaternion rotation, DirectorSpawnRequest directorSpawnRequest, ref SpawnResult result)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, position, rotation, directorSpawnRequest, ref result);
			GameObject spawnedInstance = result.spawnedInstance;
			if (!((Object)spawnedInstance).name.Contains("Duplicator"))
			{
				return;
			}
			Transform child = spawnedInstance.transform.GetChild(0);
			if ((Object)(object)child != (Object)null && child.childCount > 2)
			{
				Transform child2 = child.GetChild(2);
				if ((Object)(object)child2 != (Object)null)
				{
					Vector3 localPosition = ((Component)child2).transform.localPosition;
					Vector3 localPosition2 = default(Vector3);
					((Vector3)(ref localPosition2))..ctor(localPosition.x, 2.5f, localPosition.z);
					((Component)spawnedInstance.transform.GetChild(0).GetChild(2)).transform.localPosition = localPosition2;
				}
				else
				{
					Debug.LogError((object)"Pickup display not found. Unable to adjust model height.");
				}
			}
			else
			{
				Debug.LogError((object)"Printer does not appear to have the correct number of children.");
			}
		}
	}
	public class Randomise
	{
		public Randomise()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Expected O, but got Unknown
			Stage.Start += new hook_Start(ShuffleItemOrder);
		}

		public void ShuffleItemOrder(orig_Start orig, Stage self)
		{
			orig.Invoke(self);
			if (Main.RandomiseOrder.Value)
			{
				List<ItemIndex> itemAcquisitionOrder = PlayerCharacterMasterController._instances[0].master.inventory.itemAcquisitionOrder;
				Util.ShuffleList<ItemIndex>(itemAcquisitionOrder);
				PlayerCharacterMasterController._instances[0].master.inventory.itemAcquisitionOrder = itemAcquisitionOrder;
			}
		}
	}
}