Decompiled source of HearthHarvest v0.1.7

BepInEx/plugins/HearthHarvest/HearthHarvest.dll

Decompiled 2 days ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyCompany("HearthHarvest")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.1.7.0")]
[assembly: AssemblyInformationalVersion("0.1.7")]
[assembly: AssemblyProduct("HearthHarvest")]
[assembly: AssemblyTitle("HearthHarvest")]
[assembly: AssemblyVersion("0.1.7.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 HearthHarvest
{
	public enum RequestKind
	{
		Kitchen,
		Garden
	}
	public sealed class Entry
	{
		public string Id = "";

		public string Title = "";

		public string Prefab = "";

		public string Recipe = "";

		public string Note = "";

		public RequestKind Kind;

		public int Target = 1;

		public int Progress;

		public int Checks;

		public bool Complete;

		public Entry Copy()
		{
			return (Entry)MemberwiseClone();
		}
	}
	public sealed class BoardData
	{
		public int Revision;

		public List<Entry> Entries = new List<Entry>();

		public BoardData Copy()
		{
			BoardData boardData = new BoardData
			{
				Revision = Revision
			};
			foreach (Entry entry in Entries)
			{
				boardData.Entries.Add(entry.Copy());
			}
			return boardData;
		}
	}
	public static class BoardCodec
	{
		public const int MaxRows = 24;

		public const int MaxEncoded = 16000;

		private static readonly UTF8Encoding Utf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);

		public static string Clean(string s, int max)
		{
			if (s == null)
			{
				return "";
			}
			StringBuilder stringBuilder = new StringBuilder();
			foreach (char c in s)
			{
				if (!char.IsControl(c) && c != '<' && c != '>')
				{
					stringBuilder.Append(c);
				}
				if (stringBuilder.Length == max)
				{
					break;
				}
			}
			return stringBuilder.ToString();
		}

		public static bool Valid(BoardData d)
		{
			if (d == null || d.Revision < 0 || d.Entries == null || d.Entries.Count > 24)
			{
				return false;
			}
			HashSet<string> hashSet = new HashSet<string>(StringComparer.Ordinal);
			foreach (Entry entry in d.Entries)
			{
				if (entry == null || !Guid.TryParseExact(entry.Id, "N", out var _) || !hashSet.Add(entry.Id) || entry.Kind < RequestKind.Kitchen || entry.Kind > RequestKind.Garden || entry.Target < 1 || entry.Target > 9999 || entry.Progress < 0 || entry.Progress > entry.Target || entry.Checks < 0)
				{
					return false;
				}
				if (!Text(entry.Title, 64) || entry.Title.Length == 0 || !Text(entry.Note, 160) || !Text(entry.Prefab, 100) || !Text(entry.Recipe, 100))
				{
					return false;
				}
			}
			return true;
		}

		private static bool Text(string s, int n)
		{
			if (s != null && s.Length <= n)
			{
				return Clean(s, n) == s;
			}
			return false;
		}

		public static string Encode(BoardData d)
		{
			if (!Valid(d))
			{
				throw new InvalidDataException("Invalid board data");
			}
			using MemoryStream memoryStream = new MemoryStream();
			using (BinaryWriter binaryWriter = new BinaryWriter(memoryStream, Utf8, leaveOpen: true))
			{
				binaryWriter.Write((byte)1);
				binaryWriter.Write(d.Revision);
				binaryWriter.Write((byte)d.Entries.Count);
				foreach (Entry entry in d.Entries)
				{
					binaryWriter.Write(entry.Id);
					binaryWriter.Write((byte)entry.Kind);
					binaryWriter.Write(entry.Title);
					binaryWriter.Write(entry.Prefab);
					binaryWriter.Write(entry.Recipe);
					binaryWriter.Write(entry.Note);
					binaryWriter.Write(entry.Target);
					binaryWriter.Write(entry.Progress);
					binaryWriter.Write(entry.Checks);
					binaryWriter.Write(entry.Complete);
				}
			}
			string text = Convert.ToBase64String(memoryStream.ToArray());
			if (text.Length > 16000)
			{
				throw new InvalidDataException("Board too large");
			}
			return text;
		}

		public static bool TryDecode(string value, out BoardData d)
		{
			d = null;
			if (string.IsNullOrEmpty(value))
			{
				d = new BoardData();
				return true;
			}
			if (value.Length > 16000)
			{
				return false;
			}
			try
			{
				using MemoryStream memoryStream = new MemoryStream(Convert.FromBase64String(value));
				using BinaryReader binaryReader = new BinaryReader(memoryStream, Utf8);
				if (binaryReader.ReadByte() != 1)
				{
					return false;
				}
				BoardData boardData = new BoardData
				{
					Revision = binaryReader.ReadInt32()
				};
				int num = binaryReader.ReadByte();
				if (num > 24)
				{
					return false;
				}
				for (int i = 0; i < num; i++)
				{
					boardData.Entries.Add(new Entry
					{
						Id = binaryReader.ReadString(),
						Kind = (RequestKind)binaryReader.ReadByte(),
						Title = binaryReader.ReadString(),
						Prefab = binaryReader.ReadString(),
						Recipe = binaryReader.ReadString(),
						Note = binaryReader.ReadString(),
						Target = binaryReader.ReadInt32(),
						Progress = binaryReader.ReadInt32(),
						Checks = binaryReader.ReadInt32(),
						Complete = binaryReader.ReadBoolean()
					});
				}
				if (memoryStream.Position != memoryStream.Length || !Valid(boardData))
				{
					return false;
				}
				d = boardData;
				return true;
			}
			catch (Exception ex) when (ex is IOException || ex is FormatException || ex is ArgumentException)
			{
				return false;
			}
		}

		public static bool TryApply(BoardData current, int expected, BoardData proposed, out BoardData next)
		{
			next = null;
			if (!Valid(current) || !Valid(proposed) || current.Revision != expected || current.Revision == int.MaxValue)
			{
				return false;
			}
			next = proposed.Copy();
			next.Revision = current.Revision + 1;
			try
			{
				Encode(next);
				return true;
			}
			catch (InvalidDataException)
			{
				next = null;
				return false;
			}
		}

		public static int Batches(int units, int yield)
		{
			if (units < 1 || yield < 1)
			{
				return 0;
			}
			return (units + yield - 1) / yield;
		}
	}
	internal sealed class BoardFace : MonoBehaviour
	{
		private sealed class Need
		{
			internal string Id;

			internal string Name;

			internal long Amount;
		}

		private static readonly HashSet<BoardFace> faces = new HashSet<BoardFace>();

		private static float nextTick;

		private static float nextScan;

		private static int totalScans;

		private Board board;

		private TMP_Text kitchen;

		private TMP_Text garden;

		private TMP_Text stockText;

		private TMP_Text meal;

		private TMP_Text notes;

		private string raw;

		private string lastRender = "";

		private BoardData data;

		private StorageSnapshot stock;

		private float stockTime = -1f;

		private float nextRead;

		private long stockPlayer;

		private bool privateView;

		private bool distant;

		private string cachedNote = "No notes yet";

		private int cachedUnavailable;

		internal static int ScanCount => totalScans;

		private void Awake()
		{
			board = ((Component)this).GetComponent<Board>();
			kitchen = Text("HH_KitchenText");
			garden = Text("HH_GardenText");
			stockText = Text("HH_StockText");
			meal = Text("HH_MealText");
			notes = Text("HH_NotesText");
		}

		private TMP_Text Text(string name)
		{
			return ((IEnumerable<TMP_Text>)((Component)this).GetComponentsInChildren<TMP_Text>(true)).FirstOrDefault((Func<TMP_Text, bool>)((TMP_Text t) => ((Object)t).name == name));
		}

		private void OnEnable()
		{
			faces.Add(this);
		}

		private void OnDisable()
		{
			faces.Remove(this);
		}

		internal static void Tick()
		{
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: 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_00be: Unknown result type (might be due to invalid IL or missing references)
			float unscaledTime = Time.unscaledTime;
			if (unscaledTime < nextTick)
			{
				return;
			}
			nextTick = unscaledTime + 0.5f;
			Player localPlayer = Player.m_localPlayer;
			if (!Object.op_Implicit((Object)(object)localPlayer))
			{
				return;
			}
			BoardFace boardFace = null;
			float num = float.MaxValue;
			foreach (BoardFace face in faces)
			{
				if (!Object.op_Implicit((Object)(object)face) || !Object.op_Implicit((Object)(object)face.board) || !face.board.Ready)
				{
					continue;
				}
				Vector3 val = ((Character)localPlayer).GetEyePoint() - ((Component)face).transform.position;
				float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude;
				if (sqrMagnitude > 144f)
				{
					face.DistanceVisible(visible: false);
					continue;
				}
				face.DistanceVisible(visible: true);
				bool flag = Access.Ward(((Component)face).transform.position, localPlayer.GetPlayerID());
				face.Render(unscaledTime, localPlayer, flag);
				if (flag && sqrMagnitude < num && Access.Allowed(face.board, localPlayer))
				{
					num = sqrMagnitude;
					boardFace = face;
				}
			}
			if (!Object.op_Implicit((Object)(object)boardFace) || !Plugin.Instance.ShowStorage.Value || unscaledTime < nextScan || (boardFace.stock != null && boardFace.stockPlayer == localPlayer.GetPlayerID() && unscaledTime - boardFace.stockTime < 10f))
			{
				return;
			}
			nextScan = unscaledTime + 2f;
			try
			{
				boardFace.Accept(StorageSnapshot.Scan(boardFace.board));
				totalScans++;
				boardFace.Render(unscaledTime, localPlayer, allowed: true, force: true);
			}
			catch (Exception)
			{
				boardFace.stock = null;
				boardFace.stockTime = -1f;
				boardFace.Render(unscaledTime, localPlayer, allowed: true, force: true);
			}
		}

		private void DistanceVisible(bool visible)
		{
			if (distant == !visible)
			{
				return;
			}
			distant = !visible;
			TMP_Text[] array = (TMP_Text[])(object)new TMP_Text[5] { kitchen, garden, stockText, meal, notes };
			foreach (TMP_Text val in array)
			{
				if (Object.op_Implicit((Object)(object)val))
				{
					((Behaviour)val).enabled = visible;
				}
			}
			lastRender = "";
			nextRead = 0f;
			if (!visible)
			{
				stock = null;
				stockTime = -1f;
			}
		}

		internal void Accept(StorageSnapshot snapshot)
		{
			stock = snapshot;
			stockTime = Time.unscaledTime;
			stockPlayer = (Object.op_Implicit((Object)(object)Player.m_localPlayer) ? Player.m_localPlayer.GetPlayerID() : 0);
			lastRender = "";
		}

		internal static void Accept(Board target, StorageSnapshot snapshot)
		{
			if (Object.op_Implicit((Object)(object)target))
			{
				((Component)target).GetComponent<BoardFace>()?.Accept(snapshot);
			}
		}

		private void UpdateNotes(string freshness, bool known)
		{
			Put(notes, freshness + "\n" + (known ? (stock.Included + " accessible chests") : "No fresh count") + "\n" + ((cachedUnavailable > 0) ? (cachedUnavailable + " recipe(s) unknown") : Short(cachedNote, 18)));
		}

		private static string Short(string s, int max)
		{
			if (!string.IsNullOrEmpty(s))
			{
				if (s.Length > max)
				{
					return s.Substring(0, max - 1) + "…";
				}
				return s;
			}
			return "";
		}

		private static void Put(TMP_Text t, string text)
		{
			if (Object.op_Implicit((Object)(object)t) && t.text != text)
			{
				t.text = text;
			}
		}

		private void Render(float now, Player p, bool allowed, bool force = false)
		{
			if (!force && now < nextRead)
			{
				return;
			}
			nextRead = now + 1f;
			if (!allowed)
			{
				if (!privateView)
				{
					Put(kitchen, "PRIVATE BOARD");
					Put(garden, "");
					Put(stockText, "");
					Put(meal, "");
					Put(notes, "Ward access required");
					privateView = true;
				}
				stock = null;
				stockTime = -1f;
				lastRender = "";
				return;
			}
			if (privateView)
			{
				privateView = false;
				force = true;
			}
			string text = board.Raw;
			bool flag = text != raw;
			if (flag)
			{
				raw = text;
				BoardCodec.TryDecode(raw, out data);
			}
			if (data == null)
			{
				Put(kitchen, "BOARD UNAVAILABLE");
				Put(garden, "");
				Put(stockText, "");
				Put(meal, "");
				Put(notes, "Saved data preserved");
				return;
			}
			if (stockPlayer != p.GetPlayerID())
			{
				stock = null;
				stockTime = -1f;
			}
			bool value = Plugin.Instance.ShowStorage.Value;
			bool known = value && stock != null;
			int num = (known ? Math.Max(0, (int)(now - stockTime)) : 0);
			bool flag2 = Access.Allowed(board, p);
			string freshness = ((!value) ? "Stock disabled" : (known ? (((num > 15) ? "STALE " : "") + num + "s ago" + (flag2 ? "" : "\nOut of reach")) : (flag2 ? "Refreshing..." : "Move closer")));
			string text2 = text + "|" + stockTime + "|" + value + "|" + (num > 15);
			if (!force && !flag && text2 == lastRender)
			{
				UpdateNotes(freshness, known);
				return;
			}
			lastRender = text2;
			Entry[] source = data.Entries.Where((Entry e) => !e.Complete).ToArray();
			Entry[] array = source.Where((Entry e) => e.Kind == RequestKind.Kitchen).ToArray();
			Entry[] array2 = source.Where((Entry e) => e.Kind == RequestKind.Garden).ToArray();
			Put(kitchen, "MEAL REQUESTS\n\n" + ((array.Length == 0) ? "No requests" : string.Join("\n\n", from e in array.Take(2)
				select Short(e.Title, 22) + "\n" + Math.Max(0, e.Target - e.Progress) + " still wanted")) + ((array.Length > 2) ? ("\n+ " + (array.Length - 2) + " more") : ""));
			Put(garden, "GARDEN REQUESTS\n" + ((array2.Length == 0) ? "No requests" : (Short(array2[0].Title, 20) + "\n" + array2[0].Progress + " / " + array2[0].Target)) + ((array2.Length > 1) ? ("\n+ " + (array2.Length - 1) + " more") : ""));
			Dictionary<string, Need> dictionary = new Dictionary<string, Need>(StringComparer.Ordinal);
			int num2 = 0;
			Entry[] array3 = array;
			foreach (Entry entry in array3)
			{
				int num4 = Math.Max(0, entry.Target - entry.Progress);
				if (num4 == 0)
				{
					continue;
				}
				Recipe val = Catalog.Find(entry.Recipe);
				if (!Object.op_Implicit((Object)(object)val) || val.m_resources == null || val.m_requireOnlyOneIngredient || val.m_amount < 1)
				{
					num2++;
					continue;
				}
				int num5 = BoardCodec.Batches(num4, val.m_amount);
				Requirement[] resources = val.m_resources;
				foreach (Requirement val2 in resources)
				{
					if (!((Object)(object)val2?.m_resItem == (Object)null))
					{
						string name = ((Object)val2.m_resItem).name;
						if (!dictionary.TryGetValue(name, out var value2))
						{
							value2 = new Need
							{
								Id = name,
								Name = Catalog.Name(val2.m_resItem)
							};
							dictionary.Add(name, value2);
						}
						value2.Amount = Math.Min(2147483647L, value2.Amount + (long)Math.Max(0, val2.GetAmount(1)) * (long)num5);
					}
				}
			}
			var array4 = (from n in dictionary.Values
				select new
				{
					Need = n,
					Amount = (known ? Math.Max(0L, n.Amount - stock.Count(n.Id)) : n.Amount)
				} into x
				where x.Amount > 0
				orderby x.Amount descending, x.Need.Name
				select x).ToArray();
			string text3 = ((!known) ? "NEEDED (stock ?)" : ((num > 15) ? "LAST SHORTAGES" : "SHORTAGES"));
			Put(stockText, text3 + "\n" + ((array4.Length != 0) ? string.Join("\n", from x in array4.Take(2)
				select BoardSummary.Ingredient(x.Need.Name, x.Amount)) : ((num2 > 0) ? "Recipe unknown" : ((dictionary.Count == 0) ? "No ingredients" : (known ? "None in snapshot" : "Unknown")))) + ((array4.Length > 2) ? ("\n+ " + (array4.Length - 2) + " more") : ""));
			Entry entry2 = array.FirstOrDefault();
			Put(meal, "PROGRESS\n" + ((entry2 == null) ? "Nothing requested" : (Short(entry2.Title, 22) + "\n" + entry2.Progress + " / " + entry2.Target + " prepared")));
			cachedNote = source.Select((Entry e) => e.Note).FirstOrDefault((string n) => !string.IsNullOrWhiteSpace(n)) ?? "No notes yet";
			cachedUnavailable = num2;
			UpdateNotes(freshness, known);
		}
	}
	internal static class BoardSummary
	{
		internal static string Ingredient(string name, long amount)
		{
			string text = " x " + Math.Max(0L, amount).ToString(CultureInfo.InvariantCulture);
			int num = Math.Max(1, 22 - text.Length);
			name = name ?? "";
			if (name.Length > num)
			{
				name = name.Substring(0, num - 1) + ".";
			}
			return name + text;
		}
	}
	internal sealed class BoardUI
	{
		internal Board Target;

		internal static int SuppressThrough;

		private BoardData data;

		private int selected = -1;

		private int token;

		private int detailTab;

		private bool pending;

		private bool dirty;

		private bool adding;

		private float deadline;

		private string status = "";

		private string query = "";

		private string amount = "1";

		private RequestKind kind;

		private Vector2 rowsScroll;

		private Vector2 recipeScroll;

		private Vector2 detailScroll;

		private StorageSnapshot stock;

		private GUIStyle title;

		private GUIStyle label;

		private GUIStyle small;

		private GUIStyle heading;

		private GUIStyle footer;

		private BoardUIArt art;

		internal bool Open => Object.op_Implicit((Object)(object)Target);

		internal void Dispose()
		{
			Close();
			art?.Dispose();
			art = null;
		}

		internal void Show(Board board)
		{
			Close();
			Catalog.Refresh();
			Target = board;
			Load(board.Raw);
			status = "Shared requests. Changes are saved only when you press Save.";
		}

		private void Load(string raw)
		{
			if (!BoardCodec.TryDecode(raw, out data))
			{
				data = null;
				status = "This board's saved data is unreadable. Nothing will be overwritten.";
			}
			selected = -1;
			dirty = false;
			adding = false;
		}

		internal void Close()
		{
			Target = null;
			data = null;
			pending = false;
			stock = null;
			dirty = false;
			adding = false;
			GUIUtility.keyboardControl = 0;
			GUIUtility.hotControl = 0;
			SuppressThrough = Time.frameCount + 1;
			GameCamera instance = GameCamera.instance;
			if (instance != null)
			{
				instance.UpdateMouseCapture();
			}
		}

		internal void Tick()
		{
			if (Open)
			{
				if (!Access.Allowed(Target, Player.m_localPlayer))
				{
					Close();
				}
				else if (ZInput.GetKeyDown((KeyCode)27, true))
				{
					Close();
				}
				else if (pending && Time.unscaledTime > deadline)
				{
					pending = false;
					Load(Target.Raw);
					status = "No confirmation received. Latest available board loaded; check before retrying.";
				}
			}
		}

		internal void Acknowledge(Board source, int request, string message, string canonical)
		{
			if (Open && !((Object)(object)source != (Object)(object)Target) && request == token && pending)
			{
				pending = false;
				Load(canonical);
				status = message;
			}
		}

		private void Save()
		{
			if (pending || data == null || !dirty)
			{
				return;
			}
			if (selected >= 0 && (!int.TryParse(amount, out var result) || result < 1 || result > 9999))
			{
				status = "Enter a target from 1 to 9999 before saving.";
				return;
			}
			pending = true;
			deadline = Time.unscaledTime + 7f;
			token++;
			status = "Waiting for board owner...";
			try
			{
				if (!Target.Send(data.Revision, data, token))
				{
					pending = false;
					status = "Unable to save: check range and permissions.";
				}
			}
			catch (Exception)
			{
				pending = false;
				status = "Invalid or oversized board. Edit was not saved.";
			}
		}

		private void Add(Recipe recipe)
		{
			if (data.Entries.Count < 24)
			{
				Entry item = new Entry
				{
					Id = Guid.NewGuid().ToString("N"),
					Kind = kind,
					Title = (Object.op_Implicit((Object)(object)recipe) ? BoardCodec.Clean(Catalog.Name(recipe.m_item), 64) : "New garden request"),
					Recipe = (Object.op_Implicit((Object)(object)recipe) ? ((Object)recipe).name : ""),
					Prefab = (Object.op_Implicit((Object)(object)recipe) ? ((Object)recipe.m_item).name : ""),
					Target = 1
				};
				data.Entries.Add(item);
				selected = data.Entries.Count - 1;
				amount = "1";
				adding = false;
				dirty = true;
			}
		}

		private void Styles()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: 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_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Expected O, but got Unknown
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Expected O, but got Unknown
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Expected O, but got Unknown
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Expected O, but got Unknown
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			title = new GUIStyle(GUI.skin.label)
			{
				fontSize = 38,
				alignment = (TextAnchor)4,
				fontStyle = (FontStyle)1,
				richText = false
			};
			title.normal.textColor = new Color(1f, 0.91f, 0.7f);
			label = new GUIStyle(GUI.skin.label)
			{
				fontSize = 17,
				wordWrap = true,
				richText = false
			};
			label.normal.textColor = new Color(0.13f, 0.102f, 0.075f);
			small = new GUIStyle(label)
			{
				fontSize = 14
			};
			heading = new GUIStyle(label)
			{
				fontSize = 19,
				fontStyle = (FontStyle)1
			};
			footer = new GUIStyle(small);
			footer.normal.textColor = new Color(1f, 0.91f, 0.7f);
		}

		private bool Button(Rect r, string text, GUIStyle custom = null)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return art.Button(r, text, custom);
		}

		private static void Panel(Rect r, Color c)
		{
			//IL_0000: 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_000b: Unknown result type (might be due to invalid IL or missing references)
			Color color = GUI.color;
			GUI.color = c;
			GUI.DrawTexture(r, (Texture)(object)Texture2D.whiteTexture);
			GUI.color = color;
		}

		internal void Draw()
		{
			//IL_0635: Unknown result type (might be due to invalid IL or missing references)
			//IL_063b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0641: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Invalid comparison between Unknown and I4
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: 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_0046: 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_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Invalid comparison between Unknown and I4
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Unknown result type (might be due to invalid IL or missing references)
			//IL_024c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0297: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Unknown result type (might be due to invalid IL or missing references)
			//IL_0405: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0453: Unknown result type (might be due to invalid IL or missing references)
			//IL_049f: Unknown result type (might be due to invalid IL or missing references)
			//IL_051a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0543: Unknown result type (might be due to invalid IL or missing references)
			//IL_058b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0615: Unknown result type (might be due to invalid IL or missing references)
			if (!Open)
			{
				return;
			}
			Event current = Event.current;
			if ((int)current.type == 4 && (int)current.keyCode == 27)
			{
				current.Use();
				Close();
				return;
			}
			Matrix4x4 matrix = GUI.matrix;
			GUISkin skin = GUI.skin;
			Color color = GUI.color;
			Color backgroundColor = GUI.backgroundColor;
			bool enabled = GUI.enabled;
			float num = Mathf.Min((float)Screen.width / 1190f, (float)Screen.height / 880f);
			GUI.matrix = Matrix4x4.TRS(new Vector3(((float)Screen.width - 1150f * num) / 2f + 25f * num, ((float)Screen.height - 840f * num) / 2f + 50f * num), Quaternion.identity, new Vector3(num, num, 1f));
			try
			{
				if (art == null)
				{
					art = new BoardUIArt(skin);
				}
				GUI.skin = art.Skin;
				Styles();
				art.Background();
				art.Title();
				if (Button(new Rect(1030f, 24f, 38f, 34f), "X", art.Square))
				{
					Close();
					return;
				}
				if (data == null)
				{
					GUI.Label(new Rect(35f, 130f, 1000f, 100f), status, label);
					return;
				}
				GUI.enabled = !pending;
				art.Plaque(new Rect(48f, 101f, 330f, 35f), "REQUEST BOARD");
				GUI.Label(new Rect(299f, 140f, 80f, 23f), data.Entries.Count + " / 24", small);
				rowsScroll = GUI.BeginScrollView(new Rect(30f, 169f, 360f, 414f), rowsScroll, new Rect(0f, 0f, 338f, (float)Math.Max(410, data.Entries.Count * 67)));
				for (int i = 0; i < data.Entries.Count; i++)
				{
					Entry entry = data.Entries[i];
					GUI.backgroundColor = (Color)((i == selected) ? new Color(0.55f, 0.65f, 0.35f) : Color.white);
					if (Button(new Rect(0f, (float)(i * 67), 333f, 60f), ((i == selected) ? "> " : "") + ((entry.Title.Length > 28) ? (entry.Title.Substring(0, 25) + "...") : entry.Title) + "\n" + ((entry.Kind == RequestKind.Kitchen) ? "Meal: " : "Garden: ") + entry.Progress + " / " + entry.Target + (entry.Complete ? "  [DONE]" : ""), art.Row))
					{
						selected = i;
						detailTab = 0;
						amount = entry.Target.ToString();
						adding = false;
						GUI.FocusControl((string)null);
					}
				}
				GUI.backgroundColor = Color.white;
				GUI.EndScrollView();
				if (data.Entries.Count == 0)
				{
					GUI.Label(new Rect(47f, 165f, 310f, 130f), "Nothing pinned yet. Add a kitchen dish or a garden request for the village.", label);
				}
				GUI.enabled = !pending && data.Entries.Count < 24;
				if (Button(new Rect(35f, 603f, 166f, 38f), "+ Kitchen dish"))
				{
					Catalog.Refresh();
					kind = RequestKind.Kitchen;
					adding = true;
					query = "";
					selected = -1;
				}
				if (Button(new Rect(210f, 603f, 166f, 38f), "+ Garden request"))
				{
					kind = RequestKind.Garden;
					Add(null);
				}
				GUI.enabled = !pending;
				if (adding)
				{
					AddPanel();
				}
				else if (selected >= 0 && selected < data.Entries.Count)
				{
					Details();
				}
				else
				{
					GUI.Label(new Rect(422f, 155f, 620f, 125f), "Choose a request to view its recipe, leave a note or record progress.\n\nNothing here consumes items or crafts automatically.", label);
				}
				GUI.Label(new Rect(34f, 674f, 750f, 48f), pending ? "Saving..." : status, footer);
				GUI.enabled = !pending;
				if (Button(new Rect(810f, 683f, 120f, 34f), "Reload"))
				{
					Load(Target.Raw);
					status = "Reloaded. Unsaved edits discarded.";
				}
				GUI.enabled = !pending && dirty && (selected < 0 || (int.TryParse(amount, out var result) && result >= 1 && result <= 9999));
				if (Button(new Rect(942f, 683f, 120f, 34f), "Save changes"))
				{
					Save();
				}
			}
			finally
			{
				GUI.skin = skin;
				GUI.matrix = matrix;
				GUI.color = color;
				GUI.backgroundColor = backgroundColor;
				GUI.enabled = enabled;
			}
		}

		private void AddPanel()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: 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_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: 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_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			art.Plaque(new Rect(440f, 101f, 590f, 35f), "PIN A KITCHEN REQUEST");
			GUI.Label(new Rect(418f, 140f, 620f, 40f), "Choose a loaded food, uncooked dish or mead-base recipe.", small);
			query = GUI.TextField(new Rect(420f, 184f, 620f, 30f), query, 64);
			Recipe[] array = Catalog.Recipes(query).Take(200).ToArray();
			recipeScroll = GUI.BeginScrollView(new Rect(414f, 227f, 635f, 380f), recipeScroll, new Rect(0f, 0f, 605f, (float)Math.Max(370, array.Length * 45)));
			for (int i = 0; i < array.Length; i++)
			{
				Recipe val = array[i];
				if (Button(new Rect(0f, (float)(i * 45), 596f, 39f), Catalog.Name(val.m_item) + " (batch: " + val.m_amount + ")"))
				{
					Add(val);
					break;
				}
			}
			GUI.EndScrollView();
			GUI.Label(new Rect(420f, 616f, 610f, 35f), "Up to 200 matches. Search to narrow the list. Recipes follow your installed mods.", small);
		}

		private void Details()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_06dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_071c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_063f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_067d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0305: Unknown result type (might be due to invalid IL or missing references)
			//IL_0445: Unknown result type (might be due to invalid IL or missing references)
			//IL_0346: Unknown result type (might be due to invalid IL or missing references)
			//IL_0375: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0601: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a4: Unknown result type (might be due to invalid IL or missing references)
			Entry entry = data.Entries[selected];
			art.Plaque(new Rect(440f, 101f, 590f, 35f), (entry.Kind == RequestKind.Kitchen) ? "MEAL REQUEST" : "GARDEN REQUEST");
			string text = GUI.TextField(new Rect(420f, 146f, 620f, 34f), entry.Title, 64);
			if (text != entry.Title)
			{
				entry.Title = BoardCodec.Clean(text, 64);
				dirty = true;
			}
			if (Button(new Rect(420f, 198f, 200f, 40f), ((detailTab == 0) ? "> " : "") + "Request details"))
			{
				detailTab = 0;
			}
			if (entry.Kind == RequestKind.Kitchen)
			{
				if (Button(new Rect(635f, 198f, 200f, 40f), ((detailTab == 1) ? "> " : "") + "Ingredients & stock"))
				{
					detailTab = 1;
				}
			}
			else
			{
				detailTab = 0;
			}
			if (detailTab == 0)
			{
				GUI.Label(new Rect(420f, 270f, 150f, 30f), "Target quantity", label);
				string text2 = GUI.TextField(new Rect(580f, 267f, 100f, 36f), amount, 4);
				if (text2 != amount)
				{
					amount = text2;
					if (!int.TryParse(text2, out var result) || result < 1 || result > 9999)
					{
						status = "Enter a target from 1 to 9999 before saving.";
					}
					if (int.TryParse(text2, out var result2) && result2 >= 1 && result2 <= 9999)
					{
						if (entry.Target != result2)
						{
							entry.Checks = 0;
							entry.Complete = false;
						}
						entry.Target = result2;
						entry.Progress = Math.Min(entry.Progress, result2);
						dirty = true;
					}
				}
				GUI.Label(new Rect(420f, 330f, 230f, 30f), "Prepared: " + entry.Progress + " / " + entry.Target, label);
				if (Button(new Rect(675f, 325f, 60f, 38f), "-1"))
				{
					entry.Progress = Math.Max(0, entry.Progress - 1);
					dirty = true;
				}
				if (Button(new Rect(747f, 325f, 60f, 38f), "+1"))
				{
					entry.Progress = Math.Min(entry.Target, entry.Progress + 1);
					dirty = true;
				}
				bool flag = GUI.Toggle(new Rect(840f, 331f, 180f, 30f), entry.Complete, "Completed");
				if (flag != entry.Complete)
				{
					entry.Complete = flag;
					dirty = true;
				}
				GUI.Label(new Rect(420f, 393f, 600f, 28f), "Note for the village", heading);
				text = art.Note(new Rect(420f, 433f, 620f, 130f), entry.Note, 160);
				if (text != entry.Note)
				{
					entry.Note = BoardCodec.Clean(text, 160);
					dirty = true;
				}
				GUI.Label(new Rect(420f, 580f, 620f, 48f), "Progress is recorded by hand. Save changes to share this request.", small);
			}
			else
			{
				Recipe val = Catalog.Find(entry.Recipe);
				if (Object.op_Implicit((Object)(object)val) && !val.m_requireOnlyOneIngredient && val.m_amount > 0 && val.m_resources != null)
				{
					int num = BoardCodec.Batches(entry.Target, val.m_amount);
					GUI.Label(new Rect(420f, 260f, 620f, 46f), num + " batch(es), " + num * val.m_amount + " portions. Tick ingredients you have prepared.", label);
					Requirement[] array = val.m_resources.Where((Requirement x) => Object.op_Implicit((Object)(object)x?.m_resItem)).ToArray();
					detailScroll = GUI.BeginScrollView(new Rect(416f, 320f, 635f, 200f), detailScroll, new Rect(0f, 0f, 610f, (float)Math.Max(190, array.Length * 40)));
					for (int num2 = 0; num2 < array.Length; num2++)
					{
						Requirement val2 = array[num2];
						string text3 = Catalog.Name(val2.m_resItem) + " x " + (long)val2.GetAmount(1) * (long)num + ((stock != null) ? ("  |  Nearby: " + stock.Count(((Object)val2.m_resItem).name)) : "");
						if (num2 < 31)
						{
							bool flag2 = (entry.Checks & (1 << num2)) != 0;
							bool flag3 = GUI.Toggle(new Rect(4f, (float)(num2 * 40), 596f, 34f), flag2, text3);
							if (flag3 != flag2)
							{
								entry.Checks = (flag3 ? (entry.Checks | (1 << num2)) : (entry.Checks & ~(1 << num2)));
								dirty = true;
							}
						}
						else
						{
							GUI.Label(new Rect(4f, (float)(num2 * 40), 596f, 34f), text3, small);
						}
					}
					GUI.EndScrollView();
				}
				else
				{
					GUI.Label(new Rect(420f, 270f, 615f, 130f), "Recipe is unavailable on this client. Your request and note are preserved.", label);
				}
				if (Plugin.Instance.ShowStorage.Value)
				{
					if (Button(new Rect(420f, 544f, 270f, 40f), "Refresh nearby supplies"))
					{
						try
						{
							stock = StorageSnapshot.Scan(Target);
							BoardFace.Accept(Target, stock);
						}
						catch (Exception)
						{
							stock = null;
							status = "Storage scan unavailable. No items were changed.";
						}
					}
					GUI.Label(new Rect(420f, 597f, 620f, 40f), stock?.Status ?? "Reads accessible chests within 15m. No items are moved or reserved.", small);
				}
			}
			if (Button(new Rect(880f, 641f, 160f, 30f), "Remove request"))
			{
				data.Entries.RemoveAt(selected);
				selected = -1;
				dirty = true;
				status = "Request removed locally. Save to apply, or Reload to undo.";
			}
		}
	}
	internal sealed class BoardUIArt
	{
		private readonly List<Texture2D> owned = new List<Texture2D>();

		internal Texture2D board;

		internal Texture2D paper;

		internal Texture2D woodButton;

		internal Texture2D squareButton;

		internal Texture2D title;

		internal GUISkin Skin;

		internal GUIStyle Row;

		private static readonly Color Ink = new Color(0.13f, 0.102f, 0.075f);

		private static readonly Color Ivory = new Color(1f, 0.91f, 0.7f);

		internal GUIStyle Square;

		private GUIStyle clearButton;

		private GUIStyle clearSquare;

		private Texture2D Load(string name, int left, int top, int right, int bottom, int width)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Expected O, but got Unknown
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Expected O, but got Unknown
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false);
			using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("HearthHarvest.UI." + name + ".png"))
			{
				if (stream == null)
				{
					throw new InvalidDataException(name);
				}
				using MemoryStream memoryStream = new MemoryStream();
				stream.CopyTo(memoryStream);
				if (!ImageConversion.LoadImage(val, memoryStream.ToArray()))
				{
					throw new InvalidDataException(name);
				}
			}
			int num = Math.Max(1, (bottom - top) * width / (right - left));
			Texture2D val2 = new Texture2D(width, num, (TextureFormat)4, false);
			Color[] array = (Color[])(object)new Color[width * num];
			for (int i = 0; i < num; i++)
			{
				for (int j = 0; j < width; j++)
				{
					array[i * width + j] = val.GetPixelBilinear(((float)left + ((float)j + 0.5f) * (float)(right - left) / (float)width) / (float)((Texture)val).width, ((float)(((Texture)val).height - bottom) + ((float)i + 0.5f) * (float)(bottom - top) / (float)num) / (float)((Texture)val).height);
				}
			}
			val2.SetPixels(array);
			val2.Apply(false, true);
			((Texture)val2).wrapMode = (TextureWrapMode)1;
			((Texture)val2).filterMode = (FilterMode)1;
			((Object)val2).name = "HH UI " + name;
			owned.Add(val2);
			Object.Destroy((Object)(object)val);
			return val2;
		}

		private GUIStyle Style(GUIStyle original, Texture2D tex, Color color, int size, RectOffset border, RectOffset padding)
		{
			//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_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: 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_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Expected O, but got Unknown
			//IL_00bd: 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_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			GUIStyle val = new GUIStyle(original)
			{
				fontSize = size,
				richText = false,
				border = border,
				padding = padding,
				overflow = new RectOffset(),
				contentOffset = Vector2.zero,
				fixedWidth = 0f,
				fixedHeight = 0f,
				stretchWidth = true,
				stretchHeight = true
			};
			GUIStyleState[] array = (GUIStyleState[])(object)new GUIStyleState[8] { val.normal, val.hover, val.active, val.focused, val.onNormal, val.onHover, val.onActive, val.onFocused };
			foreach (GUIStyleState obj in array)
			{
				obj.background = tex;
				obj.textColor = color;
			}
			val.hover.textColor = (Color)((color == Ink) ? new Color(0.25f, 0.14f, 0.04f) : Color.white);
			val.active.textColor = new Color(1f, 0.75f, 0.3f);
			val.focused.textColor = color;
			return val;
		}

		internal BoardUIArt(GUISkin source)
		{
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Expected O, but got Unknown
			//IL_0129: Expected O, but got Unknown
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Expected O, but got Unknown
			//IL_0171: Expected O, but got Unknown
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Expected O, but got Unknown
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Expected O, but got Unknown
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Expected O, but got Unknown
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Expected O, but got Unknown
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e0: Expected O, but got Unknown
			//IL_02e0: Expected O, but got Unknown
			//IL_0306: Unknown result type (might be due to invalid IL or missing references)
			//IL_0311: Unknown result type (might be due to invalid IL or missing references)
			//IL_031a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0324: Expected O, but got Unknown
			//IL_0324: Expected O, but got Unknown
			title = Load("engraved-header", 12, 168, 2160, 555, 1024);
			board = Load("hh_board_panel", 17, 16, 1519, 1008, 1024);
			paper = Load("hh_parchment_panel", 21, 14, 1512, 1008, 768);
			Texture2D tex = (woodButton = Load("hh_wood_button", 51, 121, 2120, 601, 512));
			Texture2D tex2 = Load("hh_parchment_field", 17, 93, 2154, 628, 512);
			Texture2D tex3 = (squareButton = Load("hh_square_button", 101, 105, 1153, 1156, 128));
			Skin = Object.Instantiate<GUISkin>(source);
			Skin.button = Style(source.button, tex, Ivory, 16, new RectOffset(12, 12, 8, 8), new RectOffset(5, 5, 2, 2));
			Skin.button.fontStyle = (FontStyle)1;
			Skin.textField = Style(source.textField, tex2, Ink, 18, new RectOffset(14, 14, 14, 14), new RectOffset(9, 9, 4, 4));
			Skin.textArea = Clear(new GUIStyle(Skin.textField)
			{
				wordWrap = true,
				alignment = (TextAnchor)0,
				padding = new RectOffset(),
				border = new RectOffset(),
				contentOffset = Vector2.zero
			});
			Skin.toggle = new GUIStyle(source.toggle)
			{
				fontSize = 17,
				richText = false,
				wordWrap = true
			};
			GUIStyleState[] array = (GUIStyleState[])(object)new GUIStyleState[8]
			{
				Skin.toggle.normal,
				Skin.toggle.hover,
				Skin.toggle.active,
				Skin.toggle.focused,
				Skin.toggle.onNormal,
				Skin.toggle.onHover,
				Skin.toggle.onActive,
				Skin.toggle.onFocused
			};
			for (int i = 0; i < array.Length; i++)
			{
				array[i].textColor = Ink;
			}
			Row = Style(source.button, tex2, Ink, 17, new RectOffset(14, 14, 14, 14), new RectOffset(12, 12, 5, 5));
			Row.wordWrap = true;
			Row.alignment = (TextAnchor)3;
			Square = Style(source.button, tex3, Ivory, 20, new RectOffset(8, 8, 8, 8), new RectOffset(3, 3, 3, 3));
		}

		internal void CarvedText(Rect rect, string text, int size, bool dark)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: 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_001d: 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)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: 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_00b5: 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)
			GUIStyle val = new GUIStyle(GUI.skin.label)
			{
				fontSize = size,
				fontStyle = (FontStyle)1,
				alignment = (TextAnchor)4,
				richText = false,
				clipping = (TextClipping)1
			};
			Rect val2 = rect;
			((Rect)(ref val2)).x = ((Rect)(ref val2)).x + 1.5f;
			((Rect)(ref val2)).y = ((Rect)(ref val2)).y + 1.5f;
			val.normal.textColor = (dark ? new Color(0.85f, 0.51f, 0.2f) : new Color(0.06f, 0.025f, 0.008f));
			GUI.Label(val2, text, val);
			val.normal.textColor = (dark ? new Color(0.19f, 0.075f, 0.018f) : new Color(0.93f, 0.76f, 0.47f));
			GUI.Label(rect, text, val);
		}

		internal void Title()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			GUI.DrawTexture(new Rect(240f, -34f, 620f, 112f), (Texture)(object)title, (ScaleMode)2, true);
		}

		internal string Note(Rect rect, string text, int limit)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: 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_0026: Expected O, but got Unknown
			//IL_0026: Expected O, but got Unknown
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			Slice(paper, rect, new RectOffset(55, 55, 85, 40), new RectOffset(12, 12, 12, 12));
			return GUI.TextArea(new Rect(((Rect)(ref rect)).x + 14f, ((Rect)(ref rect)).y + 12f, ((Rect)(ref rect)).width - 28f, ((Rect)(ref rect)).height - 24f), text, limit, Skin.textArea);
		}

		internal void Plaque(Rect rect, string text, int size = 19)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: 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_0024: Expected O, but got Unknown
			//IL_0024: Expected O, but got Unknown
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			Slice(woodButton, rect, new RectOffset(35, 35, 24, 24), new RectOffset(10, 10, 8, 8));
			CarvedText(rect, text, size, dark: false);
		}

		internal bool Button(Rect rect, string text, GUIStyle custom = null)
		{
			//IL_0009: 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_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: 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_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Expected O, but got Unknown
			//IL_00ed: Expected O, but got Unknown
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			if (custom == Row)
			{
				return GUI.Button(rect, text, Row);
			}
			if (clearButton == null)
			{
				clearButton = Clear(Skin.button);
				clearSquare = Clear(Square);
			}
			bool flag = custom == Square;
			Color color = GUI.color;
			bool flag2 = ((Rect)(ref rect)).Contains(Event.current.mousePosition);
			GUI.color = (Color)((!GUI.enabled) ? new Color(0.65f, 0.65f, 0.65f, 0.8f) : (flag2 ? new Color(1f, 0.9f, 0.7f) : Color.white));
			Slice(flag ? squareButton : woodButton, rect, flag ? new RectOffset(20, 20, 20, 20) : new RectOffset(35, 35, 24, 24), new RectOffset(10, 10, 8, 8));
			GUI.color = color;
			GUIStyle val = (flag ? clearSquare : clearButton);
			bool result = GUI.Button(rect, GUIContent.none, val);
			CarvedText(rect, text, val.fontSize, dark: false);
			return result;
		}

		private static GUIStyle Clear(GUIStyle source)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			GUIStyle val = new GUIStyle(source);
			GUIStyleState[] array = (GUIStyleState[])(object)new GUIStyleState[8] { val.normal, val.hover, val.active, val.focused, val.onNormal, val.onHover, val.onActive, val.onFocused };
			for (int i = 0; i < array.Length; i++)
			{
				array[i].background = null;
			}
			return val;
		}

		internal void Background()
		{
			//IL_001a: 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_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Expected O, but got Unknown
			//IL_0044: Expected O, but got Unknown
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Expected O, but got Unknown
			//IL_0082: Expected O, but got Unknown
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Expected O, but got Unknown
			//IL_00c0: Expected O, but got Unknown
			Slice(board, new Rect(-25f, -50f, 1150f, 840f), new RectOffset(60, 60, 162, 84), new RectOffset(50, 50, 142, 65));
			Slice(paper, new Rect(15f, 94f, 382f, 565f), new RectOffset(55, 55, 85, 40), new RectOffset(20, 20, 38, 20));
			Slice(paper, new Rect(399f, 94f, 670f, 581f), new RectOffset(55, 55, 85, 40), new RectOffset(20, 20, 38, 20));
		}

		private static void Slice(Texture2D t, Rect r, RectOffset src, RectOffset dst)
		{
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			float[] array = new float[4]
			{
				0f,
				src.left,
				((Texture)t).width - src.right,
				((Texture)t).width
			};
			float[] array2 = new float[4]
			{
				0f,
				src.top,
				((Texture)t).height - src.bottom,
				((Texture)t).height
			};
			float[] array3 = new float[4]
			{
				((Rect)(ref r)).x,
				((Rect)(ref r)).x + (float)dst.left,
				((Rect)(ref r)).xMax - (float)dst.right,
				((Rect)(ref r)).xMax
			};
			float[] array4 = new float[4]
			{
				((Rect)(ref r)).y,
				((Rect)(ref r)).y + (float)dst.top,
				((Rect)(ref r)).yMax - (float)dst.bottom,
				((Rect)(ref r)).yMax
			};
			for (int i = 0; i < 3; i++)
			{
				for (int j = 0; j < 3; j++)
				{
					GUI.DrawTextureWithTexCoords(new Rect(array3[j], array4[i], array3[j + 1] - array3[j], array4[i + 1] - array4[i]), (Texture)(object)t, new Rect(array[j] / (float)((Texture)t).width, 1f - array2[i + 1] / (float)((Texture)t).height, (array[j + 1] - array[j]) / (float)((Texture)t).width, (array2[i + 1] - array2[i]) / (float)((Texture)t).height), true);
				}
			}
		}

		internal void Dispose()
		{
			foreach (Texture2D item in owned)
			{
				Object.Destroy((Object)(object)item);
			}
			owned.Clear();
			if (Object.op_Implicit((Object)(object)Skin))
			{
				Object.Destroy((Object)(object)Skin);
			}
		}
	}
	internal static class BoardVisuals
	{
		internal static void Build(GameObject go, Sign sign, OwnedArt assets, ZNetScene scene, Texture2D atlas = null)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Expected O, but got Unknown
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Expected O, but got Unknown
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_031c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0330: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_023d: Unknown result type (might be due to invalid IL or missing references)
			//IL_041b: Unknown result type (might be due to invalid IL or missing references)
			//IL_042a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0453: Unknown result type (might be due to invalid IL or missing references)
			//IL_0462: Unknown result type (might be due to invalid IL or missing references)
			//IL_048b: Unknown result type (might be due to invalid IL or missing references)
			//IL_049a: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_050a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0533: Unknown result type (might be due to invalid IL or missing references)
			//IL_0542: Unknown result type (might be due to invalid IL or missing references)
			//IL_0614: Unknown result type (might be due to invalid IL or missing references)
			//IL_063a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0587: Unknown result type (might be due to invalid IL or missing references)
			//IL_0596: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05df: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_039b: Unknown result type (might be due to invalid IL or missing references)
			//IL_03af: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0686: Unknown result type (might be due to invalid IL or missing references)
			//IL_069a: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0703: Unknown result type (might be due to invalid IL or missing references)
			//IL_071b: Unknown result type (might be due to invalid IL or missing references)
			//IL_072c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0731: Unknown result type (might be due to invalid IL or missing references)
			//IL_0745: Unknown result type (might be due to invalid IL or missing references)
			//IL_0795: Unknown result type (might be due to invalid IL or missing references)
			//IL_079a: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0801: Unknown result type (might be due to invalid IL or missing references)
			//IL_0806: Unknown result type (might be due to invalid IL or missing references)
			//IL_0823: Unknown result type (might be due to invalid IL or missing references)
			//IL_0828: Unknown result type (might be due to invalid IL or missing references)
			//IL_0845: Unknown result type (might be due to invalid IL or missing references)
			//IL_084a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0867: Unknown result type (might be due to invalid IL or missing references)
			//IL_086c: Unknown result type (might be due to invalid IL or missing references)
			//IL_08cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0903: Unknown result type (might be due to invalid IL or missing references)
			//IL_0908: Unknown result type (might be due to invalid IL or missing references)
			//IL_0921: Unknown result type (might be due to invalid IL or missing references)
			//IL_0926: Unknown result type (might be due to invalid IL or missing references)
			//IL_0939: Unknown result type (might be due to invalid IL or missing references)
			//IL_093e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0957: Unknown result type (might be due to invalid IL or missing references)
			//IL_095c: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)atlas))
			{
				BuildAtlas(go, sign, assets, scene, atlas);
			}
			else
			{
				if (Object.op_Implicit((Object)(object)go.transform.Find("HH carved board")))
				{
					return;
				}
				GameObject val = new GameObject("HH carved board");
				val.transform.SetParent(go.transform, false);
				MeshRenderer componentInChildren = go.GetComponentInChildren<MeshRenderer>(true);
				Shader val2 = Shader.Find("Custom/StaticRock");
				if (!Object.op_Implicit((Object)(object)val2))
				{
					val2 = Shader.Find("Standard");
				}
				Material val3 = assets.Own<Material>((Object.op_Implicit((Object)(object)componentInChildren) && Object.op_Implicit((Object)(object)((Renderer)componentInChildren).sharedMaterial)) ? new Material(((Renderer)componentInChildren).sharedMaterial) : new Material(val2));
				Material val4 = assets.Own<Material>(new Material(val3));
				val4.mainTexture = (Texture)(object)Texture2D.whiteTexture;
				if (val4.HasProperty("_BumpMap"))
				{
					val4.SetTexture("_BumpMap", (Texture)null);
				}
				val4.color = new Color(0.78f, 0.64f, 0.39f);
				val4.SetFloat("_Glossiness", 0.05f);
				Material val5 = Tint(val4, new Color(0.105f, 0.115f, 0.12f), assets);
				Material leaf = Tint(val4, new Color(0.16f, 0.25f, 0.09f), assets);
				Material pale = Tint(val4, new Color(0.34f, 0.37f, 0.17f), assets);
				Material val6 = Tint(val4, new Color(0.46f, 0.32f, 0.17f), assets);
				Material mat = Tint(val4, new Color(0.35f, 0.15f, 0.34f), assets);
				Material mat2 = Tint(val4, new Color(0.43f, 0.065f, 0.04f), assets);
				Material mat3 = Tint(val4, new Color(0.76f, 0.68f, 0.47f), assets);
				new Color(0.19f, 0.12f, 0.065f);
				for (int i = 0; i < 7; i++)
				{
					Beam(val.transform, "backing plank " + i, new Vector3((i % 2 == 0) ? 0.002f : (-0.003f), -0.202f + (float)i * 0.057f, 0.068f), new Vector3(0.87f, 0.055f, 0.039f), val3, assets);
				}
				Beam(val.transform, "broad carved header", new Vector3(0f, 0.206f, 0.098f), new Vector3(0.97f, 0.115f, 0.067f), val3, assets);
				Beam(val.transform, "bottom carved rail", new Vector3(0f, -0.235f, 0.096f), new Vector3(0.96f, 0.048f, 0.063f), val3, assets);
				Beam(val.transform, "left stile", new Vector3(-0.447f, -0.025f, 0.085f), new Vector3(0.043f, 0.405f, 0.05f), val3, assets);
				Beam(val.transform, "right stile", new Vector3(0.447f, -0.025f, 0.085f), new Vector3(0.043f, 0.405f, 0.05f), val3, assets);
				float[] array = new float[2] { -0.449f, 0.449f };
				foreach (float num in array)
				{
					float[] array2 = new float[2] { -0.229f, 0.225f };
					foreach (float num2 in array2)
					{
						Beam(val.transform, "forged frame strap", new Vector3(num, num2, 0.134f), new Vector3(0.029f, 0.056f, 0.009f), val5, assets);
						Disk(val.transform, "iron frame rivet", new Vector3(num, num2, 0.141f), 0.007f, val5, assets);
					}
				}
				Panel(val.transform, "community kitchen", new Vector3(-0.251f, -0.027f, 0.109f), new Vector2(0.247f, 0.287f), val4, val5, assets);
				Panel(val.transform, "garden", new Vector3(0.014f, 0.041f, 0.111f), new Vector2(0.234f, 0.158f), val4, val5, assets);
				Panel(val.transform, "todays meal", new Vector3(0.014f, -0.137f, 0.113f), new Vector2(0.234f, 0.134f), val4, val5, assets);
				Panel(val.transform, "needed", new Vector3(0.262f, 0.029f, 0.111f), new Vector2(0.194f, 0.182f), val4, val5, assets);
				Panel(val.transform, "notes", new Vector3(0.262f, -0.147f, 0.114f), new Vector2(0.194f, 0.113f), val4, val5, assets);
				Panel(val.transform, "tucked recipe scrap", new Vector3(-0.294f, -0.189f, 0.106f), new Vector2(0.13f, 0.066f), val4, val5, assets);
				if (Object.op_Implicit((Object)(object)sign.m_textWidget))
				{
					((Behaviour)sign.m_textWidget).enabled = false;
					Label(val.transform, "HEARTH & HARVEST", new Vector3(0.0006f, 0.2153f, 0.132f), new Vector2(0.82f, 0.065f), sign, new Color(0.49f, 0.35f, 0.2f), assets);
					Label(val.transform, "HEARTH & HARVEST", new Vector3(0f, 0.216f, 0.1326f), new Vector2(0.82f, 0.065f), sign, new Color(0.085f, 0.052f, 0.026f), assets);
				}
				Herbs(val.transform, new Vector3(-0.405f, 0.128f, 0.145f), leaf, pale, val6, assets);
				Herbs(val.transform, new Vector3(0.411f, 0.116f, 0.145f), leaf, pale, val6, assets);
				for (int l = 0; l < 12; l++)
				{
					float num3 = -0.405f + (float)(l % 3 - 1) * 0.01f;
					Bulb(val.transform, "hanging purple blossom", new Vector3(num3, 0.05f - (float)l * 0.011f, 0.159f), new Vector3(0.005f, 0.007f, 0.004f), mat, assets);
				}
				Vector3 val7 = default(Vector3);
				for (int m = 0; m < 3; m++)
				{
					((Vector3)(ref val7))..ctor(0.4f + (float)(m % 2) * 0.014f, 0.018f - (float)m * 0.037f, 0.166f);
					Bulb(val.transform, "ribbed garlic bulb", val7, new Vector3(0.012f, 0.014f, 0.009f), mat3, assets);
					Beam(val.transform, "garlic neck", val7 + new Vector3(0f, 0.016f, 0f), new Vector3(0.004f, 0.017f, 0.004f), mat3, assets);
				}
				for (int n = 0; n < 9; n++)
				{
					Bulb(val.transform, "hanging berry", new Vector3(0.424f + (float)(n % 2) * 0.009f, 0.026f - (float)n * 0.012f, 0.165f), Vector3.one * 0.0055f, mat2, assets);
				}
				for (int num4 = -1; num4 <= 1; num4 += 2)
				{
					for (int num5 = 0; num5 < 5; num5++)
					{
						float num6 = (float)num4 * (0.032f + (float)num5 * 0.019f);
						Polygon(val.transform, "header grain carving", (Vector3[])(object)new Vector3[4]
						{
							new Vector3(num6, 0.163f, 0.133f),
							new Vector3(num6 + (float)num4 * 0.015f, 0.17f, 0.133f),
							new Vector3(num6 + (float)num4 * 0.023f, 0.172f, 0.133f),
							new Vector3(num6 + (float)num4 * 0.013f, 0.162f, 0.133f)
						}, val6, assets);
					}
				}
				for (int num7 = -1; num7 <= 1; num7++)
				{
					float num8 = (float)num7 * 0.05f;
					Polygon(val.transform, "rail knot upper", (Vector3[])(object)new Vector3[6]
					{
						new Vector3(num8 - 0.033f, -0.235f, 0.129f),
						new Vector3(num8, -0.219f, 0.129f),
						new Vector3(num8 + 0.033f, -0.235f, 0.129f),
						new Vector3(num8 + 0.026f, -0.235f, 0.129f),
						new Vector3(num8, -0.224f, 0.129f),
						new Vector3(num8 - 0.026f, -0.235f, 0.129f)
					}, val6, assets);
				}
				AddTextAnchors(val.transform, sign, assets);
				CombineDecorations(val.transform, assets);
			}
		}

		private static Vector3 AtlasPoint(float px, float py, float z)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			return new Vector3(0.5f - px / 1774f, 0.25f - py / 1774f, z);
		}

		private static void BuildAtlas(GameObject go, Sign sign, OwnedArt assets, ZNetScene scene, Texture2D atlas)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Expected O, but got Unknown
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Expected O, but got Unknown
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: 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_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Expected O, but got Unknown
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Expected O, but got Unknown
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_031e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0344: Unknown result type (might be due to invalid IL or missing references)
			//IL_0358: Unknown result type (might be due to invalid IL or missing references)
			//IL_0381: Unknown result type (might be due to invalid IL or missing references)
			//IL_0386: Unknown result type (might be due to invalid IL or missing references)
			//IL_0397: Unknown result type (might be due to invalid IL or missing references)
			//IL_039c: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03de: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0405: Unknown result type (might be due to invalid IL or missing references)
			//IL_040a: Unknown result type (might be due to invalid IL or missing references)
			//IL_041b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0420: Unknown result type (might be due to invalid IL or missing references)
			//IL_0454: Unknown result type (might be due to invalid IL or missing references)
			//IL_0459: Unknown result type (might be due to invalid IL or missing references)
			//IL_046a: Unknown result type (might be due to invalid IL or missing references)
			//IL_046f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0480: Unknown result type (might be due to invalid IL or missing references)
			//IL_0485: Unknown result type (might be due to invalid IL or missing references)
			//IL_0496: Unknown result type (might be due to invalid IL or missing references)
			//IL_049b: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0500: Unknown result type (might be due to invalid IL or missing references)
			//IL_0511: Unknown result type (might be due to invalid IL or missing references)
			//IL_0516: Unknown result type (might be due to invalid IL or missing references)
			//IL_0527: Unknown result type (might be due to invalid IL or missing references)
			//IL_052c: Unknown result type (might be due to invalid IL or missing references)
			//IL_053d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0542: Unknown result type (might be due to invalid IL or missing references)
			//IL_0576: Unknown result type (might be due to invalid IL or missing references)
			//IL_057b: Unknown result type (might be due to invalid IL or missing references)
			//IL_058c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0591: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0608: Unknown result type (might be due to invalid IL or missing references)
			//IL_060d: Unknown result type (might be due to invalid IL or missing references)
			//IL_061e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0623: Unknown result type (might be due to invalid IL or missing references)
			//IL_0634: Unknown result type (might be due to invalid IL or missing references)
			//IL_0639: Unknown result type (might be due to invalid IL or missing references)
			//IL_064a: Unknown result type (might be due to invalid IL or missing references)
			//IL_064f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0660: Unknown result type (might be due to invalid IL or missing references)
			//IL_0665: Unknown result type (might be due to invalid IL or missing references)
			//IL_0676: Unknown result type (might be due to invalid IL or missing references)
			//IL_067b: Unknown result type (might be due to invalid IL or missing references)
			//IL_068c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0691: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06de: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_070a: Unknown result type (might be due to invalid IL or missing references)
			//IL_070f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0720: Unknown result type (might be due to invalid IL or missing references)
			//IL_0725: Unknown result type (might be due to invalid IL or missing references)
			//IL_0736: Unknown result type (might be due to invalid IL or missing references)
			//IL_073b: Unknown result type (might be due to invalid IL or missing references)
			//IL_074c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0751: Unknown result type (might be due to invalid IL or missing references)
			//IL_0762: Unknown result type (might be due to invalid IL or missing references)
			//IL_0767: Unknown result type (might be due to invalid IL or missing references)
			//IL_0778: Unknown result type (might be due to invalid IL or missing references)
			//IL_077d: Unknown result type (might be due to invalid IL or missing references)
			//IL_078e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0793: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_07aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_07bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0801: Unknown result type (might be due to invalid IL or missing references)
			//IL_0806: Unknown result type (might be due to invalid IL or missing references)
			//IL_0818: Unknown result type (might be due to invalid IL or missing references)
			//IL_081d: Unknown result type (might be due to invalid IL or missing references)
			//IL_082f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0834: Unknown result type (might be due to invalid IL or missing references)
			//IL_0846: Unknown result type (might be due to invalid IL or missing references)
			//IL_084b: Unknown result type (might be due to invalid IL or missing references)
			//IL_085d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0862: Unknown result type (might be due to invalid IL or missing references)
			//IL_0874: Unknown result type (might be due to invalid IL or missing references)
			//IL_0879: Unknown result type (might be due to invalid IL or missing references)
			//IL_088b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0890: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_08de: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_090a: Unknown result type (might be due to invalid IL or missing references)
			//IL_090f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0920: Unknown result type (might be due to invalid IL or missing references)
			//IL_0925: Unknown result type (might be due to invalid IL or missing references)
			//IL_0936: Unknown result type (might be due to invalid IL or missing references)
			//IL_093b: Unknown result type (might be due to invalid IL or missing references)
			//IL_094c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0951: Unknown result type (might be due to invalid IL or missing references)
			//IL_0962: Unknown result type (might be due to invalid IL or missing references)
			//IL_0967: Unknown result type (might be due to invalid IL or missing references)
			//IL_0978: Unknown result type (might be due to invalid IL or missing references)
			//IL_097d: Unknown result type (might be due to invalid IL or missing references)
			//IL_098e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0993: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_09aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_09bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a01: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a06: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a18: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a1d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a54: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a59: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a6a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a6f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a80: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a85: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a96: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a9b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aac: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0add: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b04: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b09: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b1b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b20: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b32: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b37: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b49: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b4e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b60: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b65: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b77: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b7c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b8e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b93: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ba5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0baa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bbc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bc1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c0f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c14: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c25: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c2a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c3b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c40: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c51: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c56: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c67: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c6c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c7d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c82: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c93: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c98: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ca9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cae: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cbf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cc4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cd6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cdb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ced: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cf2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d04: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d09: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d1b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d20: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d32: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d37: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d6e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d73: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d84: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d89: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d9a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d9f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0db0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0db5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dc6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dcb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ddc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0de1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0df2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0df7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e08: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e0d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e1e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e23: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e35: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e3a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e4c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e51: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e63: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e68: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e7a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e7f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eab: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eb0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ec1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ec6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ed7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0edc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ef2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f03: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f08: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f19: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f1e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f2f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f34: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f45: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f4a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f5b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f60: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f72: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f77: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f89: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f8e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fa0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fa5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fb7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fbc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fce: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fd3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fe3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fe8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ff0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ff7: Unknown result type (might be due to invalid IL or missing references)
			//IL_1003: Unknown result type (might be due to invalid IL or missing references)
			//IL_1008: Unknown result type (might be due to invalid IL or missing references)
			//IL_1016: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)go.transform.Find("HH carved board")))
			{
				GameObject val = new GameObject("HH carved board");
				val.transform.SetParent(go.transform, false);
				MeshRenderer componentInChildren = go.GetComponentInChildren<MeshRenderer>(true);
				Material val2 = assets.Own<Material>(new Material(((Renderer)componentInChildren).sharedMaterial));
				Material val3 = assets.Own<Material>(new Material(val2));
				val3.mainTexture = (Texture)(object)atlas;
				val3.mainTextureScale = Vector2.one;
				val3.mainTextureOffset = Vector2.zero;
				val3.color = Color.white;
				if (val3.HasProperty("_BumpMap"))
				{
					val3.SetTexture("_BumpMap", (Texture)null);
				}
				if (val3.HasProperty("_Glossiness"))
				{
					val3.SetFloat("_Glossiness", 0.03f);
				}
				Material val4 = assets.Own<Material>(new Material(val3));
				((Object)val4).name = "HH matte parchment";
				val4.color = new Color(0.72f, 0.72f, 0.72f, 1f);
				Matte(val4);
				Material val5 = assets.Own<Material>(new Material(val2));
				val5.mainTexture = (Texture)(object)Texture2D.whiteTexture;
				if (val5.HasProperty("_BumpMap"))
				{
					val5.SetTexture("_BumpMap", (Texture)null);
				}
				Material iron = Tint(val5, new Color(0.09f, 0.1f, 0.105f), assets);
				Material edge = Tint(val5, new Color(0.55f, 0.4f, 0.22f), assets);
				Tint(val5, new Color(0.16f, 0.25f, 0.09f), assets);
				Tint(val5, new Color(0.34f, 0.37f, 0.17f), assets);
				Material rope = Tint(val5, new Color(0.46f, 0.32f, 0.17f), assets);
				Tint(val5, new Color(0.35f, 0.15f, 0.34f), assets);
				Tint(val5, new Color(0.43f, 0.065f, 0.04f), assets);
				Tint(val5, new Color(0.76f, 0.68f, 0.47f), assets);
				for (int i = 0; i < 8; i++)
				{
					Beam(val.transform, "back plank " + i, new Vector3(0f, -0.202f + (float)i * 0.048f, 0.071f), new Vector3(0.952f, 0.047f, 0.036f), val2, assets);
				}
				Beam(val.transform, "deep header rail", AtlasPoint(887f, 104f, 0.103f), new Vector3(0.998f, 0.117f, 0.058f), val2, assets);
				Beam(val.transform, "deep lower rail", AtlasPoint(887f, 846f, 0.103f), new Vector3(0.998f, 0.045f, 0.058f), val2, assets);
				Beam(val.transform, "left wooden stile", AtlasPoint(34f, 506f, 0.093f), new Vector3(0.036f, 0.34f, 0.05f), val2, assets);
				Beam(val.transform, "right wooden stile", AtlasPoint(1740f, 506f, 0.093f), new Vector3(0.036f, 0.34f, 0.05f), val2, assets);
				AtlasFace(val.transform, "carved header face", (Vector2[])(object)new Vector2[8]
				{
					new Vector2(12f, 9f),
					new Vector2(1757f, 9f),
					new Vector2(1770f, 32f),
					new Vector2(1770f, 193f),
					new Vector2(1757f, 210f),
					new Vector2(13f, 210f),
					new Vector2(3f, 192f),
					new Vector2(3f, 31f)
				}, 0.133f, 0f, val3, null, assets);
				AtlasFace(val.transform, "carved bottom face", (Vector2[])(object)new Vector2[6]
				{
					new Vector2(9f, 809f),
					new Vector2(1765f, 809f),
					new Vector2(1770f, 873f),
					new Vector2(1756f, 884f),
					new Vector2(12f, 884f),
					new Vector2(3f, 870f)
				}, 0.133f, 0f, val3, null, assets);
				AtlasFace(val.transform, "left stile grain", (Vector2[])(object)new Vector2[4]
				{
					new Vector2(5f, 210f),
					new Vector2(63f, 210f),
					new Vector2(63f, 809f),
					new Vector2(5f, 809f)
				}, 0.119f, 0f, val3, null, assets);
				AtlasFace(val.transform, "right stile grain", (Vector2[])(object)new Vector2[4]
				{
					new Vector2(1712f, 210f),
					new Vector2(1770f, 210f),
					new Vector2(1770f, 809f),
					new Vector2(1712f, 809f)
				}, 0.119f, 0f, val3, null, assets);
				AtlasFace(val.transform, "recipe scrap", (Vector2[])(object)new Vector2[9]
				{
					new Vector2(114f, 659f),
					new Vector2(171f, 650f),
					new Vector2(364f, 679f),
					new Vector2(374f, 728f),
					new Vector2(378f, 783f),
					new Vector2(300f, 791f),
					new Vector2(121f, 787f),
					new Vector2(111f, 746f),
					new Vector2(106f, 687f)
				}, 0.108f, 0.002f, val4, edge, assets);
				AtlasFace(val.transform, "community kitchen sheet", (Vector2[])(object)new Vector2[21]
				{
					new Vector2(180f, 229f),
					new Vector2(584f, 230f),
					new Vector2(589f, 297f),
					new Vector2(581f, 317f),
					new Vector2(592f, 346f),
					new Vector2(589f, 436f),
					new Vector2(584f, 500f),
					new Vector2(590f, 548f),
					new Vector2(591f, 674f),
					new Vector2(553f, 680f),
					new Vector2(514f, 676f),
					new Vector2(472f, 687f),
					new Vector2(225f, 680f),
					new Vector2(215f, 651f),
					new Vector2(181f, 648f),
					new Vector2(165f, 552f),
					new Vector2(177f, 515f),
					new Vector2(165f, 458f),
					new Vector2(164f, 355f),
					new Vector2(173f, 311f),
					new Vector2(169f, 275f)
				}, 0.118f, 0.0025f, val4, edge, assets);
				AtlasFace(val.transform, "garden sheet", (Vector2[])(object)new Vector2[15]
				{
					new Vector2(683f, 239f),
					new Vector2(741f, 232f),
					new Vector2(1090f, 234f),
					new Vector2(1127f, 244f),
					new Vector2(1134f, 294f),
					new Vector2(1145f, 412f),
					new Vector2(1143f, 498f),
					new Vector2(1097f, 502f),
					new Vector2(1009f, 503f),
					new Vector2(902f, 503f),
					new Vector2(833f, 499f),
					new Vector2(678f, 494f),
					new Vector2(668f, 461f),
					new Vector2(670f, 349f),
					new Vector2(680f, 297f)
				}, 0.12f, 0.002f, val4, edge, assets);
				AtlasFace(val.transform, "todays meal sheet", (Vector2[])(object)new Vector2[18]
				{
					new Vector2(654f, 538f),
					new Vector2(699f, 532f),
					new Vector2(817f, 531f),
					new Vector2(909f, 534f),
					new Vector2(995f, 530f),
					new Vector2(1150f, 535f),
					new Vector2(1157f, 551f),
					new Vector2(1148f, 613f),
					new Vector2(1152f, 754f),
					new Vector2(1138f, 772f),
					new Vector2(1060f, 775f),
					new Vector2(986f, 775f),
					new Vector2(920f, 769f),
					new Vector2(858f, 775f),
					new Vector2(647f, 774f),
					new Vector2(648f, 683f),
					new Vector2(654f, 638f),
					new Vector2(650f, 577f)
				}, 0.119f, 0.0025f, val4, edge, assets);
				AtlasFace(val.transform, "needed sheet", (Vector2[])(object)new Vector2[14]
				{
					new Vector2(1236f, 233f),
					new Vector2(1597f, 233f),
					new Vector2(1603f, 310f),
					new Vector2(1606f, 405f),
					new Vector2(1602f, 459f),
					new Vector2(1610f, 502f),
					new Vector2(1539f, 509f),
					new Vector2(1447f, 512f),
					new Vector2(1337f, 509f),
					new Vector2(1230f, 502f),
					new Vector2(1222f, 457f),
					new Vector2(1228f, 397f),
					new Vector2(1224f, 309f),
					new Vector2(1225f, 257f)
				}, 0.12f, 0.002f, val4, edge, assets);
				AtlasFace(val.transform, "notes sh