using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using Bunburrows;
using Bunject.Computer.Internal;
using Bunject.Internal;
using Bunject.Levels;
using Characters.Bunny.Data;
using Computer;
using HarmonyLib;
using Levels;
using Misc;
using TMPro;
using Tiling.Behaviour;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: ComVisible(false)]
[assembly: Guid("4d448f27-4f13-493c-a71f-9cf366d9a8ab")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("Bunject.Computer")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+a15b02a0857efd943668c2fb44834a7bbe8b2a4c")]
[assembly: AssemblyProduct("Bunject.Computer")]
[assembly: AssemblyTitle("Bunject.Computer")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Bunject.Computer
{
[BepInPlugin("startup.bunject.computer", "Bunject Computer", "1.2.3")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class ComputerPlugin : BaseUnityPlugin, IBunjectorPlugin
{
public void OnAssetsLoaded()
{
}
public void OnProgressionLoaded(GeneralProgression progression)
{
progression.HandleMapUnlock();
}
private void Awake()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
new Harmony("bunject.computer").PatchAll(Assembly.GetExecutingAssembly());
BunjectAPI.RegisterPlugin((IBunjectorPlugin)(object)this);
}
}
}
namespace Bunject.Computer.Patches.ComputerMapLevelCellsControllerPatches
{
[HarmonyPatch(typeof(ComputerMapLevelCellsController), "DrawMap")]
internal class DrawMapPatch
{
[CompilerGenerated]
private sealed class <Transpiler>d__0 : IEnumerable<CodeInstruction>, IEnumerable, IEnumerator<CodeInstruction>, IDisposable, IEnumerator
{
private int <>1__state;
private CodeInstruction <>2__current;
private int <>l__initialThreadId;
private IEnumerable<CodeInstruction> instructions;
public IEnumerable<CodeInstruction> <>3__instructions;
private int <state>5__2;
private Type <type>5__3;
private ConstructorInfo <constructor>5__4;
private IEnumerator<CodeInstruction> <>7__wrap4;
private CodeInstruction <code>5__6;
CodeInstruction IEnumerator<CodeInstruction>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <Transpiler>d__0(int <>1__state)
{
this.<>1__state = <>1__state;
<>l__initialThreadId = Environment.CurrentManagedThreadId;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
int num = <>1__state;
if (num == -3 || (uint)(num - 1) <= 6u)
{
try
{
}
finally
{
<>m__Finally1();
}
}
<type>5__3 = null;
<constructor>5__4 = null;
<>7__wrap4 = null;
<code>5__6 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_016a: Unknown result type (might be due to invalid IL or missing references)
//IL_0174: Expected O, but got Unknown
//IL_0252: Unknown result type (might be due to invalid IL or missing references)
//IL_025c: Expected O, but got Unknown
//IL_027c: Unknown result type (might be due to invalid IL or missing references)
//IL_0286: Expected O, but got Unknown
//IL_013a: Unknown result type (might be due to invalid IL or missing references)
//IL_0144: Expected O, but got Unknown
//IL_0216: Unknown result type (might be due to invalid IL or missing references)
//IL_0220: Expected O, but got Unknown
try
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<state>5__2 = 0;
<type>5__3 = typeof(ExitTile);
<constructor>5__4 = AccessTools.Constructor(typeof(BunnyIdentity), new Type[4]
{
typeof(Bunburrow),
typeof(int),
typeof(int),
typeof(int)
}, false);
<>7__wrap4 = instructions.GetEnumerator();
<>1__state = -3;
break;
case 1:
<>1__state = -3;
if (<state>5__2 == 0)
{
if (CodeInstructionExtensions.Is(<code>5__6, OpCodes.Isinst, (MemberInfo)<type>5__3))
{
<state>5__2 = 1;
}
}
else
{
if (<state>5__2 == 1)
{
<>2__current = new CodeInstruction(OpCodes.Ldloc_S, (object)7);
<>1__state = 2;
return true;
}
if (<state>5__2 == 2 && <code>5__6.opcode == OpCodes.Call && <code>5__6.operand != null && <code>5__6.operand.Equals(<constructor>5__4))
{
<>2__current = new CodeInstruction(OpCodes.Ldloc_S, (object)18);
<>1__state = 5;
return true;
}
}
goto IL_0299;
case 2:
<>1__state = -3;
<>2__current = new CodeInstruction(OpCodes.Isinst, (object)typeof(BunburrowEntryTile));
<>1__state = 3;
return true;
case 3:
<>1__state = -3;
<>2__current = <code>5__6;
<>1__state = 4;
return true;
case 4:
<>1__state = -3;
<state>5__2 = 2;
goto IL_0299;
case 5:
<>1__state = -3;
<>2__current = new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(DrawMapPatch), "FixIdentity", (Type[])null, (Type[])null));
<>1__state = 6;
return true;
case 6:
<>1__state = -3;
<>2__current = new CodeInstruction(OpCodes.Stloc_S, (object)18);
<>1__state = 7;
return true;
case 7:
{
<>1__state = -3;
goto IL_0299;
}
IL_0299:
<code>5__6 = null;
break;
}
if (<>7__wrap4.MoveNext())
{
<code>5__6 = <>7__wrap4.Current;
<>2__current = <code>5__6;
<>1__state = 1;
return true;
}
<>m__Finally1();
<>7__wrap4 = null;
return false;
}
catch
{
//try-fault
((IDisposable)this).Dispose();
throw;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
private void <>m__Finally1()
{
<>1__state = -1;
if (<>7__wrap4 != null)
{
<>7__wrap4.Dispose();
}
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
[DebuggerHidden]
IEnumerator<CodeInstruction> IEnumerable<CodeInstruction>.GetEnumerator()
{
<Transpiler>d__0 <Transpiler>d__;
if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
{
<>1__state = 0;
<Transpiler>d__ = this;
}
else
{
<Transpiler>d__ = new <Transpiler>d__0(0);
}
<Transpiler>d__.instructions = <>3__instructions;
return <Transpiler>d__;
}
[DebuggerHidden]
IEnumerator IEnumerable.GetEnumerator()
{
return ((IEnumerable<CodeInstruction>)this).GetEnumerator();
}
}
[IteratorStateMachine(typeof(<Transpiler>d__0))]
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <Transpiler>d__0(-2)
{
<>3__instructions = instructions
};
}
private static BunnyIdentity FixIdentity(BunnyIdentity original)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//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)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
return new BunnyIdentity(original.Bunburrow, original.InitialDepth, original.LevelID, AssetsManager.LevelsLists[BunburrowExtension.ToBunburrowName(original.Bunburrow)][original.InitialDepth].BunburrowStyle.SpriteSheetsID);
}
}
}
namespace Bunject.Computer.Patches.ComputerMapInfoControllerPatches
{
[HarmonyPatch(typeof(ComputerMapInfoController))]
internal class DisplayLevelInfoPatch
{
private static bool _init;
private static TextMeshProUGUI levelNameTextComponent;
private static TextMeshProUGUI levelBunniesTextComponent;
private static TextMeshProUGUI bunnyNameTextComponent;
private static TextMeshProUGUI bunnyStatusTextComponent;
private static void Init(ComputerMapInfoController instance)
{
if (!_init)
{
levelNameTextComponent = Traverse.Create((object)instance).Field<TextMeshProUGUI>("levelNameTextComponent").Value;
levelBunniesTextComponent = Traverse.Create((object)instance).Field<TextMeshProUGUI>("levelBunniesTextComponent").Value;
bunnyNameTextComponent = Traverse.Create((object)instance).Field<TextMeshProUGUI>("bunnyNameTextComponent").Value;
bunnyStatusTextComponent = Traverse.Create((object)instance).Field<TextMeshProUGUI>("bunnyStatusTextComponent").Value;
((TMP_Text)levelNameTextComponent).spriteAsset = ((TMP_Text)levelBunniesTextComponent).spriteAsset;
((TMP_Text)bunnyNameTextComponent).spriteAsset = ((TMP_Text)bunnyStatusTextComponent).spriteAsset;
}
}
[HarmonyPostfix]
[HarmonyPatch("DisplayLevelInfo")]
private static void LevelPatch(ComputerMapInfoController __instance, LevelIdentity levelIdentity, LevelObject levelObject)
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
if (levelObject is ModLevelObject)
{
Init(__instance);
if (levelIdentity.Depth == 0)
{
string text = ColorUtility.ToHtmlStringRGB(AssetsManager.BunburrowsListOfStyles[(Bunburrow)0].SkyboxColor);
((TMP_Text)levelNameTextComponent).text = "<color=#" + text + ">Surface</color>";
LocalizedTextHelper.UpdateFontData(levelNameTextComponent, 1, true);
}
else
{
TextMeshProUGUI obj = levelNameTextComponent;
((TMP_Text)obj).text = ((TMP_Text)obj).text + ((TMP_Text)levelBunniesTextComponent).text;
((TMP_Text)levelBunniesTextComponent).text = string.Empty;
LocalizedTextHelper.UpdateFontData(levelBunniesTextComponent, 1, true);
}
}
}
[HarmonyPostfix]
[HarmonyPatch("DisplayBunnyInfo")]
private static void BunnyPatch(ComputerMapInfoController __instance, BunnyIdentity bunnyIdentity)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
if (CustomBunburrowExtension.IsCustomBunburrow(bunnyIdentity.Bunburrow))
{
Init(__instance);
TextMeshProUGUI obj = bunnyNameTextComponent;
((TMP_Text)obj).text = ((TMP_Text)obj).text + ((TMP_Text)bunnyStatusTextComponent).text;
((TMP_Text)bunnyStatusTextComponent).text = string.Empty;
LocalizedTextHelper.UpdateFontData(bunnyStatusTextComponent, 1, true);
}
}
}
}
namespace Bunject.Computer.Patches.ComputerMapDrawerPatches
{
[HarmonyPatch(typeof(ComputerMapDrawer), "HandleOpen")]
internal class HandleOpenPatch
{
private static void Prefix()
{
ModComputerMapDrawer.Instance.HandleOpen();
}
}
[HarmonyPatch(typeof(ComputerMapDrawer), "HandleDownFloorInput")]
internal class HandleDownFloorInputPatch
{
private static bool Prefix(bool __runOriginal)
{
if (__runOriginal)
{
return ModComputerMapDrawer.Instance.HandleDownFloorInput();
}
return false;
}
}
[HarmonyPatch(typeof(ComputerMapDrawer), "CenterOnStart")]
internal class CenterOnStartPatch
{
private static void Postfix()
{
ModComputerMapDrawer.Instance.CenterOnStart();
}
}
[HarmonyPatch(typeof(ComputerMapDrawer), "UpdateSelector")]
internal class UpdateSelectorPatch
{
private static void Postfix()
{
ModComputerMapDrawer.Instance.UpdateSelector();
}
}
[HarmonyPatch(typeof(ComputerMapDrawer), "DrawMapAtDepth")]
internal class DrawMapAtDepthPatch
{
public static bool Prefix(bool __runOriginal, int depth)
{
if (__runOriginal)
{
return ModComputerMapDrawer.Instance.DrawMapAtDepth(depth);
}
return false;
}
}
}
namespace Bunject.Computer.Internal
{
internal class ModComputerMapDrawer
{
private static ModComputerMapDrawer _instance;
private readonly FieldInfo currentlyHoveredLevel;
private readonly FieldInfo currentlyHoveredBunny;
private readonly FieldInfo currentDepth;
private readonly MethodInfo tryGetCellOnCenter;
public static ModComputerMapDrawer Instance
{
get
{
if ((Object)(object)_instance?.This == (Object)null)
{
_instance = new ModComputerMapDrawer();
Debug.Log((object)"Bunject.Computer: Init Map Drawer");
}
return _instance;
}
}
public ComputerMapDrawer This { get; private set; }
public BunburrowsCompleteListOf<ComputerMapLevelCellsController> LevelCellsControllers { get; private set; }
public RectTransform CellsHolderTransform { get; private set; }
public GameObject DepthInputHelpGameObject { get; private set; }
public TextMeshProUGUI DepthTextComponent { get; private set; }
public LevelIdentity? CurrentlyHoveredLevel => (LevelIdentity?)currentlyHoveredLevel.GetValue(This);
public BunnyIdentity? CurrentlyHoveredBunny => (BunnyIdentity?)currentlyHoveredBunny.GetValue(This);
public int CurrentDepth
{
get
{
return (int)currentDepth.GetValue(This);
}
private set
{
currentDepth.SetValue(This, value);
}
}
public Level OpeningLevel { get; private set; }
public Bunburrow FocussedBurrow { get; private set; }
public ComputerMapLevelCellsController FocussedController { get; private set; }
private ModComputerMapDrawer()
{
Traverse val = Traverse.Create((object)GameManager.UIController.OphelineComputerCanvasController).Field("computerMapDrawer");
This = val.GetValue<ComputerMapDrawer>();
LevelCellsControllers = val.Field<BunburrowsCompleteListOf<ComputerMapLevelCellsController>>("levelCellsControllers").Value;
CellsHolderTransform = val.Field<RectTransform>("cellsHolderTransform").Value;
DepthInputHelpGameObject = val.Field<GameObject>("depthInputHelpGameObject").Value;
DepthTextComponent = val.Field<TextMeshProUGUI>("depthTextComponent").Value;
Type typeFromHandle = typeof(ComputerMapDrawer);
tryGetCellOnCenter = AccessTools.Method(typeFromHandle, "TryGetCellOnCenter", (Type[])null, (Type[])null);
currentlyHoveredLevel = AccessTools.Field(typeFromHandle, "currentlyHoveredLevel");
currentlyHoveredBunny = AccessTools.Field(typeFromHandle, "currentlyHoveredBunny");
currentDepth = AccessTools.Field(typeFromHandle, "currentDepth");
}
public void HandleOpen()
{
//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_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Expected O, but got I4
//IL_002d->IL002d: Incompatible stack types: O vs I4
//IL_0027->IL002d: Incompatible stack types: I4 vs O
//IL_0027->IL002d: Incompatible stack types: O vs I4
OpeningLevel = GameManager.CurrentLevel;
LevelIdentity levelIdentity = GameManager.LevelStates.CurrentLevelState.LevelIdentity;
object obj = this;
int num;
if (levelIdentity.Depth != 0)
{
obj = levelIdentity.Bunburrow;
num = (int)obj;
}
else
{
num = 2;
obj = num;
num = (int)obj;
}
((ModComputerMapDrawer)num).FocussedBurrow = (Bunburrow)obj;
FocussedController = LevelCellsControllers[(Bunburrow)2];
}
public bool HandleDownFloorInput()
{
//IL_006c: 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_007b: Unknown result type (might be due to invalid IL or missing references)
bool result = true;
if (TryGetCellOnCenter(out var cell))
{
(int, int) coordinates = cell.Coordinates;
LevelObject levelObject = cell.LevelCellsController.LevelObject;
if ((Object)(object)levelObject != (Object)null)
{
TileLevelData obj = LevelBuilder.BuildNewLevel(levelObject, (BunburrowStyle)null, false).Tiles[coordinates.Item1 * 15 + coordinates.Item2];
BunburrowEntryTile val = (BunburrowEntryTile)(object)((obj is BunburrowEntryTile) ? obj : null);
if (val != null)
{
Bunburrow? bunburrow = val.Bunburrow;
if (bunburrow.HasValue)
{
Bunburrow valueOrDefault = bunburrow.GetValueOrDefault();
CurrentDepth = 0;
FocussedBurrow = valueOrDefault;
result = true;
goto IL_0090;
}
}
result = !levelObject.IsSurface;
}
}
goto IL_0090;
IL_0090:
return result;
}
public void CenterOnStart()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
if (CustomBunburrowExtension.IsCustomBunburrow(FocussedBurrow))
{
CellsHolderTransform.anchoredPosition = LevelCellsControllers[(Bunburrow)2].CenterPosition;
}
}
public void UpdateSelector()
{
//IL_0001: 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_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: 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_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: 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_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: 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_0071: 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_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
if (!CustomBunburrowExtension.IsCustomBunburrow(FocussedBurrow))
{
return;
}
LevelIdentity? val = CurrentlyHoveredLevel;
Bunburrow bunburrow;
int depth;
if (val.HasValue)
{
LevelIdentity valueOrDefault = val.GetValueOrDefault();
bunburrow = valueOrDefault.Bunburrow;
depth = valueOrDefault.Depth;
}
else
{
BunnyIdentity? val2 = CurrentlyHoveredBunny;
if (!val2.HasValue)
{
return;
}
BunnyIdentity valueOrDefault2 = val2.GetValueOrDefault();
bunburrow = valueOrDefault2.Bunburrow;
depth = valueOrDefault2.InitialDepth;
}
TryGetCellOnCenter(out var cell);
if (bunburrow != FocussedBurrow || (Object)(object)FocussedController != (Object)(object)cell.LevelCellsController)
{
if (bunburrow != FocussedBurrow)
{
FocussedBurrow = bunburrow;
DrawMapAtDepth(depth);
}
RectTransform cellsHolderTransform = CellsHolderTransform;
cellsHolderTransform.anchoredPosition -= -cell.LevelCellsController.CenterPosition + LevelCellsControllers[(Bunburrow)2].CenterPosition;
}
}
public bool TryGetCellOnCenter(out ComputerMapCellController cell)
{
ComputerMapCellController[] array = (ComputerMapCellController[])(object)new ComputerMapCellController[1];
MethodInfo methodInfo = tryGetCellOnCenter;
ComputerMapDrawer @this = This;
object[] parameters = array;
bool result = (bool)methodInfo.Invoke(@this, parameters);
cell = array[0];
return result;
}
public bool DrawMapAtDepth(int depth)
{
//IL_0003: 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_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: 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_01f2: Unknown result type (might be due to invalid IL or missing references)
//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
//IL_01fc: Invalid comparison between Unknown and I4
//IL_022d: Unknown result type (might be due to invalid IL or missing references)
//IL_0204: Unknown result type (might be due to invalid IL or missing references)
//IL_0218: Unknown result type (might be due to invalid IL or missing references)
//IL_021e: Unknown result type (might be due to invalid IL or missing references)
bool result = true;
if (CustomBunburrowExtension.IsCustomBunburrow(FocussedBurrow))
{
Dictionary<Bunburrow, LevelsList> dictionary = GenerateMap(FocussedBurrow);
((TMP_Text)DepthTextComponent).text = string.Format("{0} <color=#{1}>{2}</color>", AssetsManager.UILocalizationObject.UIStrings.TryGetValue("computer_map_depth", out var value) ? value : "Depth", ColorUtility.ToHtmlStringRGB(AssetsManager.BunburrowsListOfStyles.Computer.ButtonHoverColor), depth);
LocalizedTextHelper.UpdateFontData(DepthTextComponent, 1, true);
LevelIdentity val = default(LevelIdentity);
foreach (Bunburrow bunburrowsInMapOrder in BunburrowExtension.GetBunburrowsInMapOrderList())
{
if ((Object)(object)dictionary[bunburrowsInMapOrder] != (Object)null)
{
((LevelIdentity)(ref val))..ctor(BunburrowExtension.ToBunburrow(((Object)dictionary[bunburrowsInMapOrder]).name), depth);
if (CollectionExtension.ContainsEquatable<LevelIdentity>((IEnumerable<LevelIdentity>)GameManager.GeneralProgression.LevelsVisited, val))
{
LevelCellsControllers[bunburrowsInMapOrder].DrawMap(dictionary[bunburrowsInMapOrder][depth], val);
continue;
}
}
LevelCellsControllers[bunburrowsInMapOrder].ClearMap();
}
result = false;
}
else if (OpeningLevel.BaseData is ModLevelObject && ((Object)OpeningLevel.BaseData).name.Contains("Surface") && OpeningLevel.BaseData.IsSurface && OpeningLevel.BunburrowEntryTiles.Count > 0)
{
CurrentDepth = 0;
((TMP_Text)DepthTextComponent).text = string.Format("{0} <color=#{1}>{2}</color>", AssetsManager.UILocalizationObject.UIStrings.TryGetValue("computer_map_depth", out var value2) ? value2 : "Depth", ColorUtility.ToHtmlStringRGB(AssetsManager.BunburrowsListOfStyles.Computer.ButtonHoverColor), 0);
LocalizedTextHelper.UpdateFontData(DepthTextComponent, 1, true);
foreach (Bunburrow bunburrowsInMapOrder2 in BunburrowExtension.GetBunburrowsInMapOrderList())
{
if ((int)bunburrowsInMapOrder2 == 2)
{
LevelCellsControllers[bunburrowsInMapOrder2].DrawMap(OpeningLevel.BaseData, default(LevelIdentity));
}
else
{
LevelCellsControllers[bunburrowsInMapOrder2].ClearMap();
}
}
OpeningLevel = null;
result = false;
}
return result;
}
private Dictionary<Bunburrow, LevelsList> GenerateMap(Bunburrow burrow)
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
Dictionary<Bunburrow, LevelsList> dictionary = new Dictionary<Bunburrow, LevelsList>();
LevelsList val2 = (dictionary[(Bunburrow)2] = AssetsManager.LevelsLists[BunburrowExtension.ToBunburrowName(burrow)]);
LevelsList val3 = val2;
val2 = (dictionary[(Bunburrow)0] = val3.AdjacentBunburrows[(Direction)0]);
LevelsList val5 = val2;
val2 = (dictionary[(Bunburrow)1] = val3.AdjacentBunburrows[(Direction)2]);
LevelsList val7 = val2;
val2 = (dictionary[(Bunburrow)3] = val3.AdjacentBunburrows[(Direction)3]);
LevelsList val9 = val2;
val2 = (dictionary[(Bunburrow)4] = val3.AdjacentBunburrows[(Direction)1]);
LevelsList val11 = val2;
dictionary[(Bunburrow)5] = GetBurrow(val5, (Direction)2, val7, (Direction)0);
dictionary[(Bunburrow)6] = GetBurrow(val7, (Direction)1, val11, (Direction)2);
dictionary[(Bunburrow)8] = GetBurrow(val11, (Direction)3, val9, (Direction)1);
dictionary[(Bunburrow)7] = GetBurrow(val9, (Direction)0, val5, (Direction)3);
return dictionary;
}
private LevelsList GetBurrow(LevelsList burrow1, Direction dirFrom1, LevelsList burrow2, Direction dirFrom2)
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
object obj;
if (!((Object)(object)burrow1 != (Object)null) || !((Object)(object)burrow2 != (Object)null))
{
obj = ((burrow1 != null) ? burrow1.AdjacentBunburrows[dirFrom1] : null);
if (obj == null)
{
if (burrow2 == null)
{
return null;
}
return burrow2.AdjacentBunburrows[dirFrom2];
}
}
else
{
if (!((Object)(object)burrow1.AdjacentBunburrows[dirFrom1] == (Object)(object)burrow2.AdjacentBunburrows[dirFrom2]))
{
return null;
}
obj = burrow1.AdjacentBunburrows[dirFrom1];
}
return (LevelsList)obj;
}
}
}