Decompiled source of BrowsingPlus v1.2.0

Mods/BrowsingPlus.dll

Decompiled a month ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Threading;
using BrowsingPlus;
using BrowsingPlus.OverrideImplements;
using BrowsingPlus.PanelUI;
using HarmonyLib;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppSLZ.Bonelab;
using Il2CppSLZ.Bonelab.SaveData;
using Il2CppSLZ.Marrow;
using Il2CppSLZ.Marrow.SceneStreaming;
using Il2CppSLZ.Marrow.Warehouse;
using Il2CppSLZ.UI;
using Il2CppSystem;
using Il2CppSystem.Collections.Generic;
using Il2CppTMPro;
using MelonLoader;
using Microsoft.CodeAnalysis;
using Newtonsoft.Json;
using UnityEngine;
using UnityEngine.Events;
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: MelonInfo(typeof(Core), "BrowsingPlus", "1.2.0", "notnotnotswipez", null)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("BrowsingPlus")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("BrowsingPlus")]
[assembly: AssemblyTitle("BrowsingPlus")]
[assembly: NeutralResourcesLanguage("en-US")]
[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 BrowsingPlus
{
	public struct QuickCrateRef
	{
		public string barcode;

		public string title;
	}
	public class Core : MelonMod
	{
		public static List<string> recentlyInstalledPallets = new List<string>();

		public static Dictionary<string, List<QuickCrateRef>> palletToLevel = new Dictionary<string, List<QuickCrateRef>>();

		public static Dictionary<string, List<QuickCrateRef>> palletToAvatar = new Dictionary<string, List<QuickCrateRef>>();

		private static Dictionary<string, string> palletTitleCache = new Dictionary<string, string>();

		public static LevelPanelOverride levelsPanelOverride;

		public static AvatarPanelOverride avatarPanelOverride;

		public const string categoryColor = "#CAB3F9";

		public override void OnInitializeMelon()
		{
			AssetWarehouse.OnReady(Action.op_Implicit((Action)delegate
			{
				PopulateRecentlyInstalledPallets(MarrowSDK.RuntimeModsPath);
				Enumerator<Barcode, Crate> enumerator = AssetWarehouse.Instance._crateRegistry.Values.GetEnumerator();
				while (enumerator.MoveNext())
				{
					Crate current = enumerator.Current;
					HandleCrate(current);
				}
				AssetWarehouse instance = AssetWarehouse.Instance;
				instance.OnCrateAdded += Action<Barcode>.op_Implicit((Action<Barcode>)delegate(Barcode br)
				{
					Crate val = AssetWarehouse.Instance._crateRegistry[br];
					recentlyInstalledPallets.Remove(((Scannable)val.Pallet).Barcode.ID);
					if (!recentlyInstalledPallets.Contains(((Scannable)val.Pallet).Barcode.ID))
					{
						recentlyInstalledPallets.Insert(0, ((Scannable)val.Pallet).Barcode.ID);
					}
					HandleCrate(val, updateIfPossible: true);
				});
			}));
			levelsPanelOverride = new LevelPanelOverride();
			avatarPanelOverride = new AvatarPanelOverride();
		}

		public static string GetProperTitleForPallet(string palletBarcode)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			string text;
			if (palletTitleCache.ContainsKey(palletBarcode))
			{
				text = palletTitleCache[palletBarcode];
			}
			else
			{
				text = ((Scannable)AssetWarehouse.Instance._palletRegistry[new Barcode(palletBarcode)]).Title;
				palletTitleCache.Add(palletBarcode, text);
			}
			return text;
		}

		public static void RemovePalletReference(string palletBarcode)
		{
			recentlyInstalledPallets.Remove(palletBarcode);
			palletToAvatar.Remove(palletBarcode);
			palletToLevel.Remove(palletBarcode);
			levelsPanelOverride.PopulateMenus();
			avatarPanelOverride.PopulateMenus();
		}

		private void HandleCrate(Crate crate, bool updateIfPossible = false)
		{
			AvatarCrate val = ((Il2CppObjectBase)crate).TryCast<AvatarCrate>();
			LevelCrate val2 = ((Il2CppObjectBase)crate).TryCast<LevelCrate>();
			string text = ((Scannable)crate.Pallet).Barcode.ID;
			if (text.StartsWith("SLZ."))
			{
				text = "SLZ";
			}
			if (((Scannable)crate).Redacted || (((Scannable)crate).Unlockable && DataManager.ActiveSave.Unlocks.UnlockCountForBarcode(((Scannable)crate).Barcode) <= 0))
			{
				return;
			}
			if (Object.op_Implicit((Object)(object)val))
			{
				if (!palletToAvatar.ContainsKey(text))
				{
					palletToAvatar.Add(text, new List<QuickCrateRef>());
				}
				bool flag = true;
				foreach (QuickCrateRef item in palletToAvatar[text])
				{
					if (item.barcode == ((Scannable)crate).Barcode.ID)
					{
						flag = false;
						break;
					}
				}
				if (!flag)
				{
					return;
				}
				palletToAvatar[text].Add(new QuickCrateRef
				{
					barcode = ((Scannable)crate).Barcode.ID,
					title = ((Scannable)crate).Title
				});
				palletToAvatar[text].Sort((QuickCrateRef x, QuickCrateRef y) => x.title.CompareTo(y.title));
				if (updateIfPossible)
				{
					avatarPanelOverride.PopulateMenus();
				}
			}
			if (!Object.op_Implicit((Object)(object)val2))
			{
				return;
			}
			if (!palletToLevel.ContainsKey(text))
			{
				palletToLevel.Add(text, new List<QuickCrateRef>());
			}
			bool flag2 = true;
			foreach (QuickCrateRef item2 in palletToLevel[text])
			{
				if (item2.barcode == ((Scannable)crate).Barcode.ID)
				{
					flag2 = false;
					break;
				}
			}
			if (flag2)
			{
				palletToLevel[text].Add(new QuickCrateRef
				{
					barcode = ((Scannable)crate).Barcode.ID,
					title = ((Scannable)crate).Title
				});
				palletToLevel[text].Sort((QuickCrateRef x, QuickCrateRef y) => x.title.CompareTo(y.title));
				if (updateIfPossible)
				{
					levelsPanelOverride.PopulateMenus();
				}
			}
		}

		private void PopulateRecentlyInstalledPallets(string directory)
		{
			recentlyInstalledPallets.Clear();
			palletToLevel.Clear();
			palletToAvatar.Clear();
			Thread thread = new Thread((ThreadStart)delegate
			{
				List<string> list = (from f in new DirectoryInfo(directory).GetFiles()
					orderby f.LastWriteTime descending
					select f.FullName).ToList();
				foreach (string item in list)
				{
					if (item.EndsWith(".manifest"))
					{
						dynamic val = JsonConvert.DeserializeObject<object>(File.ReadAllText(item));
						string text = val["objects"]["1"]["palletBarcode"];
						if (!recentlyInstalledPallets.Contains(text) && !text.StartsWith("SLZ."))
						{
							recentlyInstalledPallets.Add(text);
						}
					}
				}
			});
			thread.Start();
		}
	}
	public class PanelOverrider
	{
		internal PanelView originalPanelView;

		internal TextMeshProUGUI title;

		internal TextMeshProUGUI pageIndicator;

		internal List<PanelButton> panelButtons = new List<PanelButton>();

		internal PanelButton returnButton;

		internal PanelButton nextButton;

		internal PanelButton prevButton;

		internal int lastPage = 0;

		internal int maxPanelView = 5;

		internal int page = 0;

		internal int maxPages = 0;

		internal PanelContainer currentContainer;

		internal List<PanelEntry> allPanelEntries;

		public bool initialized = false;

		public virtual void Populate(PanelView panelView)
		{
			initialized = false;
			panelButtons.Clear();
			originalPanelView = panelView;
			title = ((Component)((Component)panelView).transform.Find("text_TITLE")).GetComponent<TextMeshProUGUI>();
			pageIndicator = ((Component)((Component)panelView).transform.Find("text_standing_val")).GetComponent<TextMeshProUGUI>();
			for (int i = 1; i <= maxPanelView; i++)
			{
				panelButtons.Add(GetPanelButton(((Component)panelView).transform.Find($"button_Item 0{i}")));
			}
			returnButton = GetPanelButton(((Component)panelView).transform.Find("button_return"));
			nextButton = GetPanelButton(((Component)panelView).transform.Find("button_Forward"));
			prevButton = GetPanelButton(((Component)panelView).transform.Find("button_Back"));
			nextButton.SetClickAction(delegate
			{
				PageChange(increment: true);
			});
			prevButton.SetClickAction(delegate
			{
				PageChange(increment: false);
			});
			returnButton.SetClickAction(delegate
			{
				TryReturn();
			});
		}

		public void ForceUpdate()
		{
			OpenContainer(currentContainer, page);
		}

		public void TryInitialize(PanelView panelView)
		{
			if (((Object)panelView).GetInstanceID() == ((Object)originalPanelView).GetInstanceID())
			{
				if (!initialized)
				{
					OnInitialized();
					initialized = true;
				}
				else
				{
					ForceUpdate();
				}
			}
		}

		public virtual void OnInitialized()
		{
		}

		public void TryReturn()
		{
			if (currentContainer.parent != null)
			{
				OpenContainer(currentContainer.parent, lastPage);
			}
			else
			{
				originalPanelView.CloseMenu();
			}
		}

		public void PageChange(bool increment)
		{
			if (increment)
			{
				page++;
				if (page > maxPages)
				{
					page--;
				}
				else
				{
					OpenPage(page);
				}
			}
			else
			{
				page--;
				if (page < 0)
				{
					page++;
				}
				else
				{
					OpenPage(page);
				}
			}
		}

		public void OpenContainer(PanelContainer panelContainer, int pageOverride = 0)
		{
			currentContainer = panelContainer;
			allPanelEntries = currentContainer.children;
			((TMP_Text)title).text = panelContainer.title;
			lastPage = page;
			page = pageOverride;
			maxPages = Mathf.FloorToInt((float)allPanelEntries.Count / (float)maxPanelView);
			if (allPanelEntries.Count % maxPanelView == 0)
			{
				maxPages--;
			}
			if (page > maxPages)
			{
				page = 0;
			}
			OpenPage(page);
		}

		private void OpenPage(int page)
		{
			prevButton.SetActiveState(activeState: false);
			nextButton.SetActiveState(activeState: false);
			foreach (PanelButton panelButton2 in panelButtons)
			{
				panelButton2.SetActiveState(activeState: false);
			}
			int num = page * maxPanelView;
			for (int i = 0; i < maxPanelView; i++)
			{
				int num2 = num + i;
				if (num2 < allPanelEntries.Count)
				{
					PanelEntry panelEntry = allPanelEntries[num2];
					PanelButton panelButton = panelButtons[i + currentContainer.buttonOffset];
					panelButton.SetActiveState(activeState: true);
					panelButton.SetClickAction(panelEntry.onClick);
					panelButton.TryChangeTitle(panelEntry.displayName);
					continue;
				}
				break;
			}
			if (page > 0)
			{
				prevButton.SetActiveState(activeState: true);
			}
			if (page < maxPages)
			{
				nextButton.SetActiveState(activeState: true);
			}
			string text = $"{page + 1} / {maxPages + 1}";
			if (maxPages == 0)
			{
				text = " ";
			}
			((TMP_Text)pageIndicator).text = text;
		}

		internal virtual PanelButton GetPanelButton(Transform transform)
		{
			GameObject gameObject = ((Component)transform).gameObject;
			Button component = gameObject.GetComponent<Button>();
			Transform val = transform.Find("text_standing_val");
			TextMeshProUGUI val2 = null;
			if (Object.op_Implicit((Object)(object)val))
			{
				val2 = ((Component)val).GetComponent<TextMeshProUGUI>();
				((TMP_Text)val2).richText = true;
			}
			RepairButton(component);
			PanelButton result = default(PanelButton);
			result.buttonObject = gameObject;
			result.button = component;
			result.text = (TMP_Text)(object)val2;
			return result;
		}

		internal void RepairButton(Button button)
		{
			Navigation defaultNavigation = Navigation.defaultNavigation;
			defaultNavigation.mode = (Mode)0;
			((Selectable)button).navigation = defaultNavigation;
			((UnityEventBase)button.onClick).m_PersistentCalls.Clear();
		}
	}
	public struct PanelButton
	{
		public GameObject buttonObject;

		public Button button;

		public TMP_Text text;

		public void SetActiveState(bool activeState)
		{
			buttonObject.SetActive(activeState);
		}

		public void SetClickAction(Action action)
		{
			((UnityEventBase)button.onClick).RemoveAllListeners();
			((UnityEvent)button.onClick).AddListener(UnityAction.op_Implicit(action));
		}

		public void TryChangeTitle(string newTitle)
		{
			if (Object.op_Implicit((Object)(object)text))
			{
				text.text = newTitle;
			}
		}
	}
}
namespace BrowsingPlus.Patches
{
	[HarmonyPatch(typeof(LevelsPanelView), "Awake")]
	public class LevelsPanelAwakePatch
	{
		public static void Postfix(LevelsPanelView __instance)
		{
			if (Object.op_Implicit((Object)(object)((Component)__instance).GetComponentInParent<UIRig>()))
			{
				Core.levelsPanelOverride.Populate((PanelView)(object)__instance);
			}
		}
	}
	[HarmonyPatch(typeof(LevelsPanelView), "Activate")]
	public class LevelsPanelEnablePatch
	{
		public static void Postfix(LevelsPanelView __instance)
		{
			Core.levelsPanelOverride.TryInitialize((PanelView)(object)__instance);
		}
	}
	[HarmonyPatch(typeof(AvatarsPanelView), "Awake")]
	public class AvatarsPanelAwakePatch
	{
		public static void Postfix(AvatarsPanelView __instance)
		{
			if (Object.op_Implicit((Object)(object)((Component)__instance).GetComponentInParent<UIRig>()))
			{
				Core.avatarPanelOverride.Populate((PanelView)(object)__instance);
			}
		}
	}
	[HarmonyPatch(typeof(AvatarsPanelView), "Activate")]
	public class AvatarsPanelEnablePatch
	{
		public static void Postfix(AvatarsPanelView __instance)
		{
			Core.avatarPanelOverride.TryInitialize((PanelView)(object)__instance);
		}
	}
	[HarmonyPatch(typeof(AssetWarehouse), "UnloadPallet", new Type[] { typeof(Barcode) })]
	public class WarehouseUnLoadPatchBarcode
	{
		public static void Postfix(Barcode barcode)
		{
			Core.RemovePalletReference(barcode.ID);
		}
	}
	[HarmonyPatch(typeof(AssetWarehouse), "UnloadPallet", new Type[] { typeof(Pallet) })]
	public class WarehouseUnLoadPatchPallet
	{
		public static void Postfix(Pallet pallet)
		{
			Core.RemovePalletReference(((Scannable)pallet).Barcode.ID);
		}
	}
}
namespace BrowsingPlus.PanelUI
{
	public class PanelContainer
	{
		public PanelOverrider overrider;

		public PanelContainer parent;

		public string title;

		public List<PanelEntry> children = new List<PanelEntry>();

		public int buttonOffset = 0;

		public PanelContainer(string title, PanelOverrider overrider, int buttonOffset = 0)
		{
			this.title = title;
			this.overrider = overrider;
			this.buttonOffset = buttonOffset;
		}

		public void Clear()
		{
			children.Clear();
		}

		public void AddEntry(string title, Action onClick)
		{
			children.Add(new PanelEntry
			{
				displayName = title,
				onClick = onClick
			});
		}

		public void AddEntry(int insert, string title, Action onClick)
		{
			children.Insert(insert, new PanelEntry
			{
				displayName = title,
				onClick = onClick
			});
		}

		public PanelContainer MakeContainer(string title)
		{
			PanelContainer container = new PanelContainer(title, overrider);
			container.parent = this;
			children.Add(new PanelEntry
			{
				displayName = title,
				redirect = container,
				onClick = delegate
				{
					overrider.OpenContainer(container);
				}
			});
			return container;
		}
	}
	public struct PanelEntry
	{
		public string displayName;

		public PanelContainer redirect;

		public Action onClick;
	}
}
namespace BrowsingPlus.OverrideImplements
{
	public class AvatarPanelOverride : PanelOverrider
	{
		public PanelContainer palletsContainer;

		public PanelContainer allContainer;

		public PanelContainer mainContainer;

		public AvatarPanelOverride()
		{
			mainContainer = new PanelContainer("<color=#CAB3F9>Avatars", this, 1);
			palletsContainer = mainContainer.MakeContainer("<color=#CAB3F9>Pallets");
			allContainer = mainContainer.MakeContainer("<color=#CAB3F9>All");
		}

		public override void Populate(PanelView panelView)
		{
			initialized = false;
			panelButtons.Clear();
			originalPanelView = panelView;
			title = ((Component)((Component)panelView).transform.Find("text_TITLE")).GetComponent<TextMeshProUGUI>();
			pageIndicator = ((Component)((Component)panelView).transform.Find("text_standing_val")).GetComponent<TextMeshProUGUI>();
			for (int i = 1; i <= maxPanelView; i++)
			{
				panelButtons.Add(GetPanelButton(((Component)panelView).transform.Find($"button_Item_0{i}")));
			}
			returnButton = GetPanelButton(((Component)panelView).transform.Find("button_return"));
			nextButton = GetPanelButton(((Component)panelView).transform.Find("button_Forward"));
			prevButton = GetPanelButton(((Component)panelView).transform.Find("button_Back"));
			nextButton.SetClickAction(delegate
			{
				PageChange(increment: true);
			});
			prevButton.SetClickAction(delegate
			{
				PageChange(increment: false);
			});
			returnButton.SetClickAction(delegate
			{
				TryReturn();
			});
		}

		internal override PanelButton GetPanelButton(Transform transform)
		{
			GameObject gameObject = ((Component)transform).gameObject;
			Button component = gameObject.GetComponent<Button>();
			Transform val = transform.Find("text_avatar_val");
			TextMeshPro val2 = null;
			if (Object.op_Implicit((Object)(object)val))
			{
				val2 = ((Component)val).GetComponent<TextMeshPro>();
				((TMP_Text)val2).richText = true;
			}
			RepairButton(component);
			PanelButton result = default(PanelButton);
			result.buttonObject = gameObject;
			result.button = component;
			result.text = (TMP_Text)(object)val2;
			return result;
		}

		public override void OnInitialized()
		{
			PopulateMenus();
			OpenContainer(mainContainer);
		}

		public void PopulateMenus()
		{
			palletsContainer.Clear();
			allContainer.Clear();
			PanelContainer panelContainer = palletsContainer.MakeContainer("<color=#CAB3F9>SLZ");
			foreach (QuickCrateRef quickCrateRef2 in Core.palletToAvatar["SLZ"])
			{
				panelContainer.AddEntry(quickCrateRef2.title, delegate
				{
					SwapAvatarAndCorrectlyScale(quickCrateRef2.barcode);
				});
				allContainer.AddEntry(quickCrateRef2.title, delegate
				{
					SwapAvatarAndCorrectlyScale(quickCrateRef2.barcode);
				});
			}
			foreach (string recentlyInstalledPallet in Core.recentlyInstalledPallets)
			{
				if (recentlyInstalledPallet == "SLZ" || !Core.palletToAvatar.ContainsKey(recentlyInstalledPallet))
				{
					continue;
				}
				string properTitleForPallet = Core.GetProperTitleForPallet(recentlyInstalledPallet);
				PanelContainer panelContainer2 = palletsContainer.MakeContainer("<color=#CAB3F9>" + properTitleForPallet);
				foreach (QuickCrateRef quickCrateRef in Core.palletToAvatar[recentlyInstalledPallet])
				{
					panelContainer2.AddEntry(quickCrateRef.title, delegate
					{
						SwapAvatarAndCorrectlyScale(quickCrateRef.barcode);
					});
				}
			}
			List<QuickCrateRef> list = new List<QuickCrateRef>();
			foreach (string recentlyInstalledPallet2 in Core.recentlyInstalledPallets)
			{
				if (recentlyInstalledPallet2 == "SLZ" || !Core.palletToAvatar.ContainsKey(recentlyInstalledPallet2))
				{
					continue;
				}
				foreach (QuickCrateRef item in Core.palletToAvatar[recentlyInstalledPallet2])
				{
					list.Add(item);
				}
			}
			list.Sort((QuickCrateRef x, QuickCrateRef y) => x.title.CompareTo(y.title));
			foreach (QuickCrateRef added in list)
			{
				allContainer.AddEntry(added.title, delegate
				{
					SwapAvatarAndCorrectlyScale(added.barcode);
				});
			}
		}

		private void SwapAvatarAndCorrectlyScale(string barcode)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			AvatarsPanelView val = ((Il2CppObjectBase)originalPanelView).TryCast<AvatarsPanelView>();
			Barcode val2 = new Barcode(barcode);
			val.SwapAvatar(((Il2CppObjectBase)AssetWarehouse.Instance._crateRegistry[val2]).TryCast<AvatarCrate>());
		}
	}
	public class LevelPanelOverride : PanelOverrider
	{
		public PanelContainer palletsContainer;

		public PanelContainer allContainer;

		public PanelContainer mainContainer;

		public LevelPanelOverride()
		{
			mainContainer = new PanelContainer("<color=#CAB3F9>Levels", this, 1);
			palletsContainer = mainContainer.MakeContainer("<color=#CAB3F9>Pallets");
			allContainer = mainContainer.MakeContainer("<color=#CAB3F9>All");
		}

		public override void OnInitialized()
		{
			PopulateMenus();
			OpenContainer(mainContainer);
		}

		public void PopulateMenus()
		{
			palletsContainer.Clear();
			allContainer.Clear();
			PanelContainer panelContainer = palletsContainer.MakeContainer("<color=#CAB3F9>SLZ");
			foreach (QuickCrateRef quickCrateRef2 in Core.palletToLevel["SLZ"])
			{
				panelContainer.AddEntry(quickCrateRef2.title, delegate
				{
					//IL_000c: Unknown result type (might be due to invalid IL or missing references)
					//IL_0017: Expected O, but got Unknown
					SceneStreamer.Load(new Barcode(quickCrateRef2.barcode), (Barcode)null);
				});
				allContainer.AddEntry(quickCrateRef2.title, delegate
				{
					//IL_000c: Unknown result type (might be due to invalid IL or missing references)
					//IL_0017: Expected O, but got Unknown
					SceneStreamer.Load(new Barcode(quickCrateRef2.barcode), (Barcode)null);
				});
			}
			foreach (string recentlyInstalledPallet in Core.recentlyInstalledPallets)
			{
				if (recentlyInstalledPallet == "SLZ" || !Core.palletToLevel.ContainsKey(recentlyInstalledPallet))
				{
					continue;
				}
				string properTitleForPallet = Core.GetProperTitleForPallet(recentlyInstalledPallet);
				PanelContainer panelContainer2 = palletsContainer.MakeContainer("<color=#CAB3F9>" + properTitleForPallet);
				foreach (QuickCrateRef quickCrateRef in Core.palletToLevel[recentlyInstalledPallet])
				{
					panelContainer2.AddEntry(quickCrateRef.title, delegate
					{
						//IL_000c: Unknown result type (might be due to invalid IL or missing references)
						//IL_0016: Unknown result type (might be due to invalid IL or missing references)
						//IL_0020: Expected O, but got Unknown
						//IL_0020: Expected O, but got Unknown
						SceneStreamer.Load(new Barcode(quickCrateRef.barcode), new Barcode("SLZ.BONELAB.CORE.Level.LevelModLevelLoad"));
					});
				}
			}
			List<QuickCrateRef> list = new List<QuickCrateRef>();
			foreach (string recentlyInstalledPallet2 in Core.recentlyInstalledPallets)
			{
				if (recentlyInstalledPallet2 == "SLZ" || !Core.palletToLevel.ContainsKey(recentlyInstalledPallet2))
				{
					continue;
				}
				foreach (QuickCrateRef item in Core.palletToLevel[recentlyInstalledPallet2])
				{
					list.Add(item);
				}
			}
			list.Sort((QuickCrateRef x, QuickCrateRef y) => x.title.CompareTo(y.title));
			foreach (QuickCrateRef added in list)
			{
				allContainer.AddEntry(added.title, delegate
				{
					//IL_000c: Unknown result type (might be due to invalid IL or missing references)
					//IL_0016: Unknown result type (might be due to invalid IL or missing references)
					//IL_0020: Expected O, but got Unknown
					//IL_0020: Expected O, but got Unknown
					SceneStreamer.Load(new Barcode(added.barcode), new Barcode("SLZ.BONELAB.CORE.Level.LevelModLevelLoad"));
				});
			}
		}
	}
}