Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of AutoCrafter v0.2.0
despr0grammer.AutoCrafter.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Runtime.CompilerServices; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyVersion("0.0.0.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 despr0grammer.AutoCrafter { internal static class Actions { internal static CraftingStation HoveredStation(Player player) { GameObject hoverObject = ((Humanoid)player).GetHoverObject(); if (!((Object)(object)hoverObject != (Object)null)) { return null; } return hoverObject.GetComponentInParent<CraftingStation>(); } internal static void OpenHud() { Hud.Open(HoveredStation(Player.m_localPlayer)); } internal static string HoverLine(CraftingStation station) { if ((Object)(object)Player.m_localPlayer == (Object)null || RecipeIndex.ForStation(station.m_name).Count == 0) { return null; } StationJob stationJob = StationJobs.Get(station); string text = ((stationJob == null || stationJob.Orders.Count == 0) ? Text.HoverIdle : Text.HoverJob(stationJob.Orders.Count, stationJob.Enabled)); return "\n[<color=yellow><b>" + Plugin.MenuKeyLabel + "</b></color>] " + text; } internal static void Notify(string message, bool center = false) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null) { ((Character)localPlayer).Message((MessageType)((!center) ? 1 : 2), message, 0, (Sprite)null, false); } } } internal static class ChestAccess { internal static bool InUse(Container container) { if (container.IsInUse()) { return true; } ZNetView val = ChestRegistry.NetViewOf(container); if ((Object)(object)val != (Object)null && val.IsValid()) { return val.GetZDO().GetInt(ZDOVars.s_inUse, 0) == 1; } return false; } internal static bool TryAdd(Inventory inventory, string prefab, int amount, long crafterId, string crafterName) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) return inventory.AddItem(prefab, amount, 1, 0, crafterId, crafterName, new Vector2i(-1, -1), false, false, false) != null; } internal static void Own(ZNetView view) { if ((Object)(object)view != (Object)null && !view.IsOwner()) { view.ClaimOwnership(); } } } internal sealed class ChangeBatch { private readonly Dictionary<Inventory, Action> _held = new Dictionary<Inventory, Action>(); internal void Hold(Inventory inventory) { if (inventory != null && !_held.ContainsKey(inventory)) { _held[inventory] = inventory.m_onChanged; inventory.m_onChanged = null; } } internal void Release() { foreach (KeyValuePair<Inventory, Action> item in _held) { item.Key.m_onChanged = item.Value; } foreach (KeyValuePair<Inventory, Action> item2 in _held) { try { item2.Value?.Invoke(); } catch (Exception ex) { Plugin.Log.LogWarning((object)("An inventory handler failed after crafting: " + ex.Message)); } } _held.Clear(); } } internal static class ChestLink { private const float WaitSeconds = 120f; private static CraftingStation _station; private static float _until; internal static bool IsWaitingFor(CraftingStation station) { if ((Object)(object)station != (Object)null && (Object)(object)_station == (Object)(object)station) { return Time.unscaledTime < _until; } return false; } internal static void Begin(CraftingStation station) { _station = station; _until = Time.unscaledTime + 120f; Actions.Notify(Text.LinkHint(StationName(station), Plugin.MenuKeyLabel), center: true); } internal static void Cancel() { if ((Object)(object)_station != (Object)null && Time.unscaledTime < _until) { Actions.Notify(Text.LinkCancelled); } _station = null; } internal static void OnChestOpened(Container container) { if ((Object)(object)_station == (Object)null || (Object)(object)container == (Object)null) { return; } CraftingStation station = _station; if (Time.unscaledTime >= _until) { _station = null; return; } if (!ChestRegistry.IsStorage(container) || !ChestRegistry.TryGetNetworkId(container, out var user, out var id)) { Actions.Notify(Text.LinkNotStorage); return; } StationJob stationJob = StationJobs.Get(station) ?? new StationJob(); stationJob.LinkChest(user, id); _station = null; if (StationJobs.Save(station, stationJob)) { Actions.Notify(Text.Linked(StationName(station))); } else { Actions.Notify(Text.SaveFailed); } } internal static void Unlink(CraftingStation station, StationJob job) { if (job != null && job.HasChest) { job.UnlinkChest(); if (StationJobs.Save(station, job)) { Actions.Notify(Text.Unlinked(StationName(station))); } } } private static string StationName(CraftingStation station) { return Localization.instance.Localize(station.m_name); } } internal static class ChestRegistry { private sealed class Entry { internal int Id; internal Container Container; internal Inventory Inventory; internal Transform Transform; internal ZNetView NetView; internal int Storage = -1; } private struct Candidate { internal Container Container; internal float SqrDistance; } private static readonly List<Entry> Entries = new List<Entry>(64); private static readonly Dictionary<int, Entry> ById = new Dictionary<int, Entry>(); private static readonly Dictionary<Inventory, Entry> ByInventory = new Dictionary<Inventory, Entry>(); private static readonly List<Candidate> Scratch = new List<Candidate>(32); private static readonly Comparison<Candidate> ByDistance = (Candidate a, Candidate b) => a.SqrDistance.CompareTo(b.SqrDistance); internal static void Register(Container container) { if (!((Object)(object)container == (Object)null) && !ById.ContainsKey(((Object)container).GetInstanceID())) { Entry entry = new Entry { Id = ((Object)container).GetInstanceID(), Container = container, Inventory = container.GetInventory(), Transform = ((Component)container).transform, NetView = GameAccess.NetViewOf(container) }; Entries.Add(entry); ById[entry.Id] = entry; if (entry.Inventory != null) { ByInventory[entry.Inventory] = entry; } } } internal static void SeedFromScene() { Container[] array = Object.FindObjectsByType<Container>((FindObjectsSortMode)0); for (int i = 0; i < array.Length; i++) { Register(array[i]); } } internal static void Prune() { for (int num = Entries.Count - 1; num >= 0; num--) { if ((Object)(object)Entries[num].Container == (Object)null) { RemoveAt(num); } } } internal static bool IsStorage(Container container) { Entry entry = Ensure(container); if (entry == null) { return false; } if (entry.Storage < 0) { entry.Storage = (ComputeStorage(container) ? 1 : 0); } return entry.Storage == 1; } internal static ZNetView NetViewOf(Container container) { return Ensure(container)?.NetView; } internal static bool TryGetByInventory(Inventory inventory, out Container container) { if (inventory != null && ByInventory.TryGetValue(inventory, out var value) && (Object)(object)value.Container != (Object)null) { container = value.Container; return true; } container = null; return false; } internal static bool CanUse(Container container, long playerId) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (!GameAccess.CheckAccess(container, playerId)) { return false; } if (container.m_checkGuardStone) { return PrivateArea.CheckAccess(((Component)container).transform.position, 0f, false, false); } return true; } internal static void Find(Vector3 center, float radius, long playerId, List<Container> result) { //IL_004b: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) result.Clear(); Scratch.Clear(); float num = radius * radius; for (int num2 = Entries.Count - 1; num2 >= 0; num2--) { Entry entry = Entries[num2]; if ((Object)(object)entry.Container == (Object)null) { RemoveAt(num2); } else { Vector3 val = entry.Transform.position - center; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (!(sqrMagnitude > num) && IsUsable(entry, playerId)) { Scratch.Add(new Candidate { Container = entry.Container, SqrDistance = sqrMagnitude }); } } } Scratch.Sort(ByDistance); for (int i = 0; i < Scratch.Count; i++) { result.Add(Scratch[i].Container); } } internal static bool TryGetNetworkId(Container container, out long user, out uint id) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) ZNetView val = NetViewOf(container); if ((Object)(object)val != (Object)null && val.IsValid()) { ZDOID uid = val.GetZDO().m_uid; user = ((ZDOID)(ref uid)).UserID; id = ((ZDOID)(ref uid)).ID; return id != 0; } user = 0L; id = 0u; return false; } internal static Container FindByNetworkId(long user, uint id, long playerId) { //IL_0057: 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) for (int num = Entries.Count - 1; num >= 0; num--) { Entry entry = Entries[num]; if ((Object)(object)entry.Container == (Object)null) { RemoveAt(num); } else if (!((Object)(object)entry.NetView == (Object)null) && entry.NetView.IsValid()) { ZDOID uid = entry.NetView.GetZDO().m_uid; if (((ZDOID)(ref uid)).ID == id && ((ZDOID)(ref uid)).UserID == user) { if (!IsUsable(entry, playerId)) { return null; } return entry.Container; } } } return null; } private static bool IsUsable(Entry entry, long playerId) { if ((Object)(object)entry.NetView == (Object)null || !entry.NetView.IsValid() || entry.Container.GetInventory() == null) { return false; } if (IsStorage(entry.Container)) { return CanUse(entry.Container, playerId); } return false; } private static bool ComputeStorage(Container container) { if ((Object)(object)((Component)container).GetComponentInParent<Piece>() != (Object)null && (Object)(object)container.m_wagon == (Object)null && !container.m_autoDestroyEmpty && (Object)(object)((Component)container).GetComponentInParent<TombStone>() == (Object)null) { return (Object)(object)((Component)container).GetComponentInParent<Incinerator>() == (Object)null; } return false; } private static Entry Ensure(Container container) { if ((Object)(object)container == (Object)null) { return null; } int instanceID = ((Object)container).GetInstanceID(); if (!ById.TryGetValue(instanceID, out var value)) { Register(container); ById.TryGetValue(instanceID, out value); } return value; } private static void RemoveAt(int index) { Entry entry = Entries[index]; ById.Remove(entry.Id); if (entry.Inventory != null) { ByInventory.Remove(entry.Inventory); } int index2 = Entries.Count - 1; Entries[index] = Entries[index2]; Entries.RemoveAt(index2); } } internal enum CraftStatus { Idle, Working, Paused, CountComplete, StockReached, CapReached, MissingRecipe, UnknownRecipe, NeedLevel, NotUsable, NoIngredients, NoRoom, NotOwner, Disabled, ReserveReached, ChestUnavailable } internal sealed class StationState { internal readonly CraftStatus[] Orders = new CraftStatus[8]; internal readonly int[] Stock = new int[8]; internal readonly string[] Detail = new string[8]; internal readonly bool[] Making = new bool[8]; internal float NextCraft; internal string LastCrafted; internal int Chests; internal int Barrels; internal bool Remote; internal string Runner; internal float WatchSince = -1f; internal long LastBeat = -1L; internal float BeatChangedAt; internal float UselessSince = -1f; internal string LastPublished; internal float LastPublishedAt = -100f; } internal struct StationSummary { internal int Orders; internal int Working; internal int Waiting; internal int Finished; internal int Paused; } internal static class Crafter { private sealed class Pick { internal CraftingStation Station; internal RecipeRow Row; internal bool Intermediate; } private const float TickInterval = 1f; private const float PruneInterval = 30f; private static readonly Dictionary<int, StationState> States = new Dictionary<int, StationState>(); private static readonly List<Container> Found = new List<Container>(32); private static readonly List<Container> Usable = new List<Container>(32); private static readonly List<CraftingStation> Scratch = new List<CraftingStation>(32); private static readonly List<CraftingStation> Producers = new List<CraftingStation>(16); private static readonly Dictionary<string, Pick> Picks = new Dictionary<string, Pick>(StringComparer.Ordinal); private static readonly List<Fermenter> Barrels = new List<Fermenter>(16); private static readonly HashSet<int> Live = new HashSet<int>(); private static Player _player; private static Vector3 _center; private static Container _linked; private static bool _linkUnavailable; private static float _nextTick; private static float _nextPrune; private static bool _reported; private const string StateKey = "despr0grammer_autocrafter_state"; private static readonly IComparer<CraftingStation> DistanceFromCenter = Comparer<CraftingStation>.Create(delegate(CraftingStation a, CraftingStation b) { //IL_0006: 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) //IL_0010: 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_0026: 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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)a).transform.position - _center; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; val = ((Component)b).transform.position - _center; return sqrMagnitude.CompareTo(((Vector3)(ref val)).sqrMagnitude); }); internal static StationState StateOf(CraftingStation station) { if (!((Object)(object)station != (Object)null) || !States.TryGetValue(((Object)station).GetInstanceID(), out var value)) { return null; } return value; } internal static StationSummary Summarize(StationJob job, StationState state) { StationSummary result = new StationSummary { Orders = (job?.Orders.Count ?? 0) }; for (int i = 0; i < result.Orders; i++) { switch ((state != null) ? state.Orders[i] : CraftStatus.Idle) { case CraftStatus.Idle: case CraftStatus.Working: result.Working++; break; case CraftStatus.CountComplete: case CraftStatus.StockReached: case CraftStatus.CapReached: result.Finished++; break; case CraftStatus.Paused: case CraftStatus.Disabled: result.Paused++; break; default: result.Waiting++; break; } } return result; } internal static void Tick(Player player) { if (Time.time < _nextTick) { return; } _nextTick = Time.time + 1f; List<CraftingStation> stations = GameAccess.Stations; if (stations == null) { return; } Scratch.Clear(); Scratch.AddRange(stations); foreach (CraftingStation item in Scratch) { if ((Object)(object)item == (Object)null) { continue; } try { RunStation(player, item); } catch (Exception arg) { if (!_reported) { _reported = true; Plugin.Log.LogError((object)$"The crafter failed on a station (further errors are not logged): {arg}"); } } } if (Time.time >= _nextPrune) { _nextPrune = Time.time + 30f; Prune(); } } private static void RunStation(Player player, CraftingStation station) { StationJob stationJob = StationJobs.Get(station); if (stationJob == null) { return; } StationState stationState = StateFor(station); bool flag = stationJob.Ferment && GameAccess.FermenterReady; if (!stationJob.Enabled || (stationJob.Orders.Count == 0 && !flag)) { SetAll(stationState, stationJob.Orders.Count, CraftStatus.Disabled); stationState.Barrels = 0; StopWatching(stationState); return; } ZNetView val = GameAccess.NetViewOf(station); if ((Object)(object)val == (Object)null || !val.IsValid()) { StopWatching(stationState); return; } if (!val.IsOwner()) { if (!FollowOrTakeOver(player, station, val, stationJob, stationState)) { return; } stationState.LastPublished = null; stationState.LastPublishedAt = -100f; } StopWatching(stationState); try { RunAsOwner(player, station, stationJob, stationState, flag); } finally { PublishState(player, val, stationJob, stationState); } } private static void RunAsOwner(Player player, CraftingStation station, StationJob job, StationState state, bool fermenting) { //IL_0006: 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) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)station).transform.position; ChestRegistry.Find(position, Plugin.Radius.Value, player.GetPlayerID(), Found); Container val = (job.HasChest ? ChestRegistry.FindByNetworkId(job.ChestUser, job.ChestId, player.GetPlayerID()) : null); if ((Object)(object)val != (Object)null && !Found.Contains(val)) { Found.Add(val); } Usable.Clear(); foreach (Container item in Found) { GameAccess.RefreshContainer(item); if (!ChestAccess.InUse(item)) { Usable.Add(item); } } state.Chests = Usable.Count; _linked = (((Object)(object)val != (Object)null && Usable.Contains(val)) ? val : null); _linkUnavailable = job.HasChest && (Object)(object)_linked == (Object)null; if (fermenting) { RunFermenters(position, state); } else { state.Barrels = 0; } if (job.Orders.Count == 0) { return; } bool flag = Time.time < state.NextCraft; _player = player; _center = position; if (!flag) { BuildProducers(station); } bool flag2 = false; bool flag3 = false; for (int i = 0; i < job.Orders.Count; i++) { Order order = job.Orders[i]; state.Detail[i] = null; state.Making[i] = false; RecipeRow recipeRow = RecipeIndex.Find(station.m_name, order.Recipe); if (recipeRow == null) { state.Orders[i] = CraftStatus.MissingRecipe; continue; } FermentIndex.Conversion conversion = default(FermentIndex.Conversion); bool flag4 = order.CountEnd && FermentIndex.TryGetByShared(recipeRow.Shared, out conversion); int unitsPerCraft = OrderRules.UnitsPerCraft(recipeRow.Yield, flag4 ? conversion.Produced : 0, flag4); int num = ((order.Mode == OrderMode.Stock) ? StockOf(player, position, recipeRow, flag4, conversion) : 0); state.Stock[i] = num; OrderVerdict orderVerdict = OrderRules.Evaluate(order, num, unitsPerCraft); if (orderVerdict != OrderVerdict.Ready) { state.Orders[i] = orderVerdict switch { OrderVerdict.CapReached => CraftStatus.CapReached, OrderVerdict.CountComplete => CraftStatus.CountComplete, OrderVerdict.Paused => CraftStatus.Paused, _ => CraftStatus.StockReached, }; if (orderVerdict == OrderVerdict.CapReached) { state.Detail[i] = unitsPerCraft.ToString(); } continue; } if (flag2 || flag) { state.Orders[i] = ((flag && order.Recipe == state.LastCrafted) ? CraftStatus.Working : CraftStatus.Idle); continue; } bool intermediate; CraftStatus craftStatus = Attempt(player, station, order, recipeRow, state, i, out intermediate); state.Orders[i] = craftStatus; if (craftStatus != CraftStatus.Working) { state.Making[i] = false; continue; } flag2 = true; state.LastCrafted = order.Recipe; if (!intermediate && order.Mode == OrderMode.Count) { order.Done++; flag3 = true; } } if (flag2) { state.NextCraft = Time.time + Plugin.CraftSeconds.Value; } if (flag3) { StationJobs.Save(station, job); } } private static long NowTicks() { if (!((Object)(object)ZNet.instance != (Object)null)) { return DateTime.UtcNow.Ticks; } return ZNet.instance.GetTime().Ticks; } private static void StopWatching(StationState state) { state.Remote = false; state.Runner = null; state.WatchSince = -1f; state.LastBeat = -1L; state.UselessSince = -1f; } private static bool CanUseChestsAt(Player player, CraftingStation station) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) ChestRegistry.Find(((Component)station).transform.position, Plugin.Radius.Value, player.GetPlayerID(), Found); foreach (Container item in Found) { if (!ChestAccess.InUse(item)) { return true; } } return false; } private static bool FollowOrTakeOver(Player player, CraftingStation station, ZNetView view, StationJob job, StationState state) { SharedState sharedState = StateCodec.Parse(view.GetZDO().GetString("despr0grammer_autocrafter_state", string.Empty)); float time = Time.time; long num = sharedState?.Beat ?? (-1); if (state.WatchSince < 0f) { state.WatchSince = time; state.LastBeat = num; state.BeatChangedAt = time; } else if (num != state.LastBeat) { state.LastBeat = num; state.BeatChangedAt = time; } RunnerAction runnerAction = StateCodec.Decide(sharedState, time - state.BeatChangedAt, time - state.WatchSince); string text = null; switch (runnerAction) { case RunnerAction.Follow: { state.WatchSince = time; if (sharedState.Chests == 0) { if (state.UselessSince < 0f) { state.UselessSince = time; } } else { state.UselessSince = -1f; } double num2 = ((state.UselessSince < 0f) ? 0.0 : ((double)(time - state.UselessSince))); if (num2 >= 15.0 && StateCodec.ShouldReclaim(sharedState, num2, CanUseChestsAt(player, station))) { runnerAction = RunnerAction.Takeover; text = sharedState.Runner + " could use no chest there"; break; } ShowReport(state, sharedState, job.Orders.Count); return false; } case RunnerAction.Takeover: text = ((sharedState != null) ? ("the report of " + sharedState.Runner + " stopped") : "nobody reported on it"); break; } if (runnerAction == RunnerAction.Takeover && CanUseChestsAt(player, station)) { ChestAccess.Own(view); if (view.IsOwner()) { Plugin.Log.LogInfo((object)("Took over a " + station.m_name + ": " + text + ".")); return true; } } state.Remote = false; state.Runner = null; SetAll(state, job.Orders.Count, CraftStatus.NotOwner); return false; } private static void ShowReport(StationState state, SharedState reported, int orderCount) { state.Remote = true; state.Runner = reported.Runner; state.Chests = reported.Chests; state.Barrels = reported.Barrels; for (int i = 0; i < state.Orders.Length; i++) { state.Stock[i] = 0; state.Making[i] = false; state.Detail[i] = null; if (i >= orderCount) { state.Orders[i] = CraftStatus.Idle; } else if (i < reported.Orders.Count) { OrderReport orderReport = reported.Orders[i]; state.Orders[i] = (Enum.IsDefined(typeof(CraftStatus), orderReport.Status) ? ((CraftStatus)orderReport.Status) : CraftStatus.NotOwner); state.Stock[i] = orderReport.Stock; state.Making[i] = orderReport.Making; state.Detail[i] = orderReport.Detail; } else { state.Orders[i] = CraftStatus.NotOwner; } } } private static void PublishState(Player player, ZNetView view, StationJob job, StationState state) { SharedState sharedState = new SharedState { Runner = player.GetPlayerName(), Chests = state.Chests, Barrels = state.Barrels }; for (int i = 0; i < job.Orders.Count; i++) { sharedState.Orders.Add(new OrderReport { Status = (int)state.Orders[i], Stock = state.Stock[i], Making = state.Making[i], Detail = state.Detail[i] }); } string text = StateCodec.ContentKey(sharedState); if (StateCodec.ShouldPublish(text != state.LastPublished, Time.time - state.LastPublishedAt)) { sharedState.Beat = NowTicks(); view.GetZDO().Set("despr0grammer_autocrafter_state", StateCodec.Serialize(sharedState)); state.LastPublished = text; state.LastPublishedAt = Time.time; } } private static CraftStatus Attempt(Player player, CraftingStation station, Order order, RecipeRow row, StationState state, int index, out bool intermediate) { intermediate = false; if (!RecipeAllowed(player, row)) { return CraftStatus.UnknownRecipe; } CraftStatus? craftStatus = StationProblem(player, station, row); if (craftStatus.HasValue) { return craftStatus.Value; } Pick pick = Choose(station, row, order.CraftMissing); if (pick == null) { state.Detail[index] = MissingText(row); return CraftStatus.NoIngredients; } string text = OrderRules.UnderReserve(pick.Row.Needs, CountIn, order.Reserve); if (text != null) { state.Detail[index] = Localization.instance.Localize(text) + " (" + CountIn(text) + ")"; return CraftStatus.ReserveReached; } intermediate = pick.Intermediate; state.Making[index] = pick.Intermediate; state.Detail[index] = (pick.Intermediate ? pick.Row.Display : null); CraftStatus craftStatus2 = CraftOne(player, pick.Station, pick.Row); if (craftStatus2 != CraftStatus.Working) { state.Detail[index] = ((craftStatus2 == CraftStatus.NoIngredients) ? MissingText(row) : null); } return craftStatus2; } private static bool RecipeAllowed(Player player, RecipeRow row) { if (Plugin.RequireKnownRecipes.Value) { return player.IsRecipeKnown(row.Shared); } return true; } private static CraftStatus? StationProblem(Player player, CraftingStation station, RecipeRow row) { if (!station.CheckUsable(player, false)) { return CraftStatus.NotUsable; } if (station.GetLevel(true) < row.Recipe.GetRequiredStationLevel(1)) { return CraftStatus.NeedLevel; } return null; } private static Pick Choose(CraftingStation station, RecipeRow mainRow, bool allowSub) { Picks.Clear(); string text = KeyOf(station, mainRow); Picks[text] = new Pick { Station = station, Row = mainRow, Intermediate = false }; string text2 = Planner.Resolve(text, NeedsOf, HaveOf, allowSub ? new Func<string, string>(RecipeFor) : new Func<string, string>(NoRecipe), 3); if (text2 == null || !Picks.TryGetValue(text2, out var value)) { return null; } return value; } private static string KeyOf(CraftingStation station, RecipeRow row) { return ((Object)station).GetInstanceID() + "|" + row.Prefab; } private static IReadOnlyList<IngredientNeed> NeedsOf(string key) { return Picks[key].Row.Needs; } private static int HaveOf(string item) { return CountIn(item); } private static string NoRecipe(string item) { return null; } private static string RecipeFor(string item) { foreach (CraftingStation producer in Producers) { RecipeRow recipeRow = RecipeIndex.FindByShared(producer.m_name, item); if (recipeRow != null && RecipeAllowed(_player, recipeRow) && !StationProblem(_player, producer, recipeRow).HasValue) { string text = KeyOf(producer, recipeRow); if (!Picks.ContainsKey(text)) { Picks[text] = new Pick { Station = producer, Row = recipeRow, Intermediate = true }; } return text; } } return null; } private static void BuildProducers(CraftingStation station) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) Producers.Clear(); Producers.Add(station); float num = Plugin.Radius.Value * Plugin.Radius.Value; foreach (CraftingStation item in Scratch) { if ((Object)(object)item == (Object)null || (Object)(object)item == (Object)(object)station) { continue; } Vector3 val = ((Component)item).transform.position - _center; if (!(((Vector3)(ref val)).sqrMagnitude > num)) { ZNetView val2 = GameAccess.NetViewOf(item); if ((Object)(object)val2 != (Object)null && val2.IsValid()) { Producers.Add(item); } } } if (Producers.Count > 2) { Producers.Sort(1, Producers.Count - 1, DistanceFromCenter); } } private static string MissingText(RecipeRow row) { string text = null; IngredientNeed[] needs = row.Needs; for (int i = 0; i < needs.Length; i++) { IngredientNeed ingredientNeed = needs[i]; int num = CountIn(ingredientNeed.Item); if (num < ingredientNeed.Amount) { string text2 = ingredientNeed.Amount - num + "x " + Localization.instance.Localize(ingredientNeed.Item); text = ((text == null) ? text2 : (text + ", " + text2)); } } return text; } private static CraftStatus CraftOne(Player player, CraftingStation station, RecipeRow row) { IngredientNeed[] needs = row.Needs; for (int i = 0; i < needs.Length; i++) { IngredientNeed ingredientNeed = needs[i]; if (CountIn(ingredientNeed.Item) < ingredientNeed.Amount) { return CraftStatus.NoIngredients; } } GameObject val = (((Object)(object)ObjectDB.instance != (Object)null) ? ObjectDB.instance.GetItemPrefab(row.Prefab) : null); Container val2 = (((Object)(object)val != (Object)null) ? PickOutput(val, row.Shared, row.Yield) : null); if ((Object)(object)val2 == (Object)null) { if (!_linkUnavailable) { return CraftStatus.NoRoom; } return CraftStatus.ChestUnavailable; } ChangeBatch changeBatch = new ChangeBatch(); try { Inventory inventory = val2.GetInventory(); ChestAccess.Own(ChestRegistry.NetViewOf(val2)); changeBatch.Hold(inventory); if (!ChestAccess.TryAdd(inventory, row.Prefab, row.Yield, player.GetPlayerID(), player.GetPlayerName())) { return CraftStatus.NoRoom; } try { needs = row.Needs; for (int i = 0; i < needs.Length; i++) { IngredientNeed ingredientNeed2 = needs[i]; if (Consume(ingredientNeed2.Item, ingredientNeed2.Amount, changeBatch) > 0) { inventory.RemoveItem(row.Shared, row.Yield, -1, true); Plugin.Log.LogError((object)("Crafting " + row.Prefab + ": an ingredient (" + ingredientNeed2.Item + ") vanished between the check and the craft; the craft was undone.")); return CraftStatus.NoIngredients; } } } catch (Exception) { inventory.RemoveItem(row.Shared, row.Yield, -1, true); throw; } } finally { changeBatch.Release(); } PlayEffect(station); return CraftStatus.Working; } private static void RunFermenters(Vector3 center, StationState state) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) FermentIndex.Nearby(center, Plugin.Radius.Value, Barrels); state.Barrels = Barrels.Count; foreach (Fermenter barrel in Barrels) { ZNetView val = GameAccess.NetViewOf(barrel); if (!((Object)(object)val == (Object)null) && val.IsValid()) { switch (GameAccess.StatusOf(barrel)) { case 3: Tap(barrel, val); break; case 0: Fill(barrel, val); break; } } } } private static void Tap(Fermenter barrel, ZNetView view) { if (!FermentIndex.TryGetByShared(GameAccess.ContentOf(barrel), out var conversion)) { return; } GameObject val = (((Object)(object)ObjectDB.instance != (Object)null) ? ObjectDB.instance.GetItemPrefab(conversion.ToPrefab) : null); Container val2 = (((Object)(object)val != (Object)null) ? PickOutput(val, conversion.ToShared, conversion.Produced) : null); if ((Object)(object)val2 == (Object)null) { return; } ChestAccess.Own(view); if (!view.IsOwner()) { return; } ChangeBatch changeBatch = new ChangeBatch(); try { Inventory inventory = val2.GetInventory(); ChestAccess.Own(ChestRegistry.NetViewOf(val2)); changeBatch.Hold(inventory); if (!ChestAccess.TryAdd(inventory, conversion.ToPrefab, conversion.Produced, 0L, string.Empty)) { return; } try { GameAccess.EmptyBarrel(barrel); if (!string.IsNullOrEmpty(GameAccess.ContentOf(barrel))) { inventory.RemoveItem(conversion.ToShared, conversion.Produced, -1, true); Plugin.Log.LogError((object)("A finished barrel (" + conversion.FromPrefab + ") did not empty after its " + conversion.ToPrefab + " were stored; they were taken back out of the chest.")); } } catch (Exception) { inventory.RemoveItem(conversion.ToShared, conversion.Produced, -1, true); throw; } } finally { changeBatch.Release(); } } private static void Fill(Fermenter barrel, ZNetView view) { foreach (FermentIndex.Conversion item in FermentIndex.All) { if (CountIn(item.FromShared) <= 0) { continue; } ChestAccess.Own(view); if (!view.IsOwner()) { break; } ChangeBatch changeBatch = new ChangeBatch(); try { if (Consume(item.FromShared, 1, changeBatch) > 0) { continue; } GameAccess.AddToBarrel(barrel, item.FromPrefab); if (GameAccess.ContentOf(barrel) != item.FromShared) { Refund(item, changeBatch); } break; } finally { changeBatch.Release(); } } } private static void Refund(FermentIndex.Conversion conversion, ChangeBatch batch) { GameObject val = (((Object)(object)ObjectDB.instance != (Object)null) ? ObjectDB.instance.GetItemPrefab(conversion.FromPrefab) : null); Container val2 = (((Object)(object)val != (Object)null) ? PickAnyOutput(val, conversion.FromShared, 1) : null); if ((Object)(object)val2 == (Object)null) { Plugin.Log.LogError((object)("A barrel refused " + conversion.FromPrefab + " and no chest has room to give it back: one was lost.")); return; } ChestAccess.Own(ChestRegistry.NetViewOf(val2)); batch.Hold(val2.GetInventory()); if (!ChestAccess.TryAdd(val2.GetInventory(), conversion.FromPrefab, 1, 0L, string.Empty)) { Plugin.Log.LogError((object)("A barrel refused " + conversion.FromPrefab + " and the chest could not take it back: one was lost.")); } } private static Container PickOutput(GameObject prefab, string sharedName, int amount) { if (_linkUnavailable) { return null; } if ((Object)(object)_linked != (Object)null) { if (!_linked.GetInventory().CanAddItem(prefab, amount)) { return null; } return _linked; } return PickAnyOutput(prefab, sharedName, amount); } private static Container PickAnyOutput(GameObject prefab, string sharedName, int amount) { foreach (Container item in Usable) { Inventory inventory = item.GetInventory(); if (inventory.ContainsItemByName(sharedName) && inventory.CanAddItem(prefab, amount)) { return item; } } foreach (Container item2 in Usable) { if (item2.GetInventory().CanAddItem(prefab, amount)) { return item2; } } return null; } private static int Consume(string sharedName, int amount, ChangeBatch batch) { int num = amount; foreach (Container item in Usable) { if (num <= 0) { break; } Inventory inventory = item.GetInventory(); int num2 = Math.Min(inventory.CountItems(sharedName, -1, true), num); if (num2 > 0) { ChestAccess.Own(ChestRegistry.NetViewOf(item)); batch.Hold(inventory); inventory.RemoveItem(sharedName, num2, -1, true); num -= num2; } } return num; } private static int CountIn(string sharedName) { int num = 0; foreach (Container item in Usable) { num += item.GetInventory().CountItems(sharedName, -1, true); } return num; } private static int CountAll(string sharedName) { int num = 0; foreach (Container item in Found) { num += item.GetInventory().CountItems(sharedName, -1, true); } return num; } private static int StockOf(Player player, Vector3 center, RecipeRow row, bool useEnd, FermentIndex.Conversion conversion) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) bool value = Plugin.CountPlayerInventory.Value; int num = CountAll(row.Shared) + (value ? ((Humanoid)player).GetInventory().CountItems(row.Shared, -1, true) : 0); if (!useEnd) { return num; } int end = CountAll(conversion.ToShared) + (value ? ((Humanoid)player).GetInventory().CountItems(conversion.ToShared, -1, true) : 0); int fermentingBarrels = FermentIndex.CountBarrels(center, Plugin.Radius.Value, row.Shared); return OrderRules.StockUnits(num, end, fermentingBarrels, conversion.Produced, countEnd: true); } private static void PlayEffect(CraftingStation station) { //IL_0020: 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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.PlayEffects.Value) { return; } try { EffectList craftItemDoneEffects = station.m_craftItemDoneEffects; if (craftItemDoneEffects != null) { craftItemDoneEffects.Create(((Component)station).transform.position, Quaternion.identity, ((Component)station).transform, 1f, -1, default(ZDOID)); } } catch (Exception) { } } private static StationState StateFor(CraftingStation station) { int instanceID = ((Object)station).GetInstanceID(); if (!States.TryGetValue(instanceID, out var value)) { value = new StationState(); States[instanceID] = value; } return value; } private static void SetAll(StationState state, int count, CraftStatus status) { for (int i = 0; i < count && i < state.Orders.Length; i++) { state.Orders[i] = status; state.Detail[i] = null; state.Making[i] = false; } } private static void Prune() { Live.Clear(); foreach (CraftingStation item in Scratch) { if ((Object)(object)item != (Object)null) { Live.Add(((Object)item).GetInstanceID()); } } List<int> list = null; foreach (int key in States.Keys) { if (!Live.Contains(key)) { (list ?? (list = new List<int>())).Add(key); } } if (list != null) { foreach (int item2 in list) { States.Remove(item2); } } StationJobs.Prune(Live); } } internal static class FermentIndex { internal struct Conversion { internal string FromPrefab; internal string FromShared; internal string ToPrefab; internal string ToShared; internal int Produced; } private static readonly Dictionary<string, Conversion> ByFromShared = new Dictionary<string, Conversion>(StringComparer.Ordinal); private static readonly List<Conversion> Conversions = new List<Conversion>(16); private static readonly List<Fermenter> Live = new List<Fermenter>(16); private static bool _built; internal static IReadOnlyList<Conversion> All { get { EnsureBuilt(); return Conversions; } } internal static void Register(Fermenter fermenter) { if ((Object)(object)fermenter != (Object)null && !Live.Contains(fermenter)) { Live.Add(fermenter); } } internal static bool TryGetByShared(string sharedName, out Conversion conversion) { EnsureBuilt(); conversion = default(Conversion); if (!string.IsNullOrEmpty(sharedName)) { return ByFromShared.TryGetValue(sharedName, out conversion); } return false; } internal static void Nearby(Vector3 center, float radius, List<Fermenter> result) { //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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) result.Clear(); float num = radius * radius; for (int num2 = Live.Count - 1; num2 >= 0; num2--) { Fermenter val = Live[num2]; if ((Object)(object)val == (Object)null) { Live.RemoveAt(num2); } else { Vector3 val2 = ((Component)val).transform.position - center; if (((Vector3)(ref val2)).sqrMagnitude <= num) { result.Add(val); } } } } internal static int CountBarrels(Vector3 center, float radius, string sharedName) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) float num = radius * radius; int num2 = 0; for (int num3 = Live.Count - 1; num3 >= 0; num3--) { Fermenter val = Live[num3]; if ((Object)(object)val == (Object)null) { Live.RemoveAt(num3); } else { Vector3 val2 = ((Component)val).transform.position - center; if (!(((Vector3)(ref val2)).sqrMagnitude > num)) { try { if (GameAccess.ContentOf(val) == sharedName) { num2++; } } catch (Exception) { } } } } return num2; } private static void EnsureBuilt() { if (_built) { return; } List<ItemConversion> list = null; foreach (Fermenter item in Live) { if ((Object)(object)item != (Object)null && item.m_conversion != null && item.m_conversion.Count > 0) { list = item.m_conversion; break; } } if (list == null && (Object)(object)ZNetScene.instance != (Object)null) { GameObject prefab = ZNetScene.instance.GetPrefab("fermenter"); list = ((!((Object)(object)prefab != (Object)null)) ? null : prefab.GetComponent<Fermenter>()?.m_conversion); } if (list == null || list.Count == 0) { return; } foreach (ItemConversion item2 in list) { string text = item2.m_from?.m_itemData?.m_shared?.m_name; string text2 = item2.m_to?.m_itemData?.m_shared?.m_name; if (!string.IsNullOrEmpty(text) && !string.IsNullOrEmpty(text2) && !ByFromShared.ContainsKey(text)) { Conversion conversion = new Conversion { FromPrefab = ((Object)item2.m_from).name, FromShared = text, ToPrefab = ((Object)item2.m_to).name, ToShared = text2, Produced = item2.m_producedItems }; ByFromShared[text] = conversion; Conversions.Add(conversion); } } _built = ByFromShared.Count > 0; } } internal static class GameAccess { private static readonly Func<Container, long, bool> CheckAccessImpl = Bind<Func<Container, long, bool>>(typeof(Container), "CheckAccess", new Type[1] { typeof(long) }); private static readonly FieldInfo ContainerView = AccessTools.Field(typeof(Container), "m_nview"); private static readonly Func<Container, bool> ContainerLoad = Bind<Func<Container, bool>>(typeof(Container), "Load", Array.Empty<Type>()); private static readonly FieldInfo StationView = AccessTools.Field(typeof(CraftingStation), "m_nview"); private static readonly FieldInfo StationList = AccessTools.Field(typeof(CraftingStation), "m_allStations"); private static readonly Func<Fermenter, string> ContentNameImpl = Bind<Func<Fermenter, string>>(typeof(Fermenter), "GetContentName", Array.Empty<Type>()); private static readonly FieldInfo FermenterView = AccessTools.Field(typeof(Fermenter), "m_nview"); private static readonly MethodInfo FermenterStatus = AccessTools.Method(typeof(Fermenter), "GetStatus", (Type[])null, (Type[])null); private static readonly Action<Fermenter, long, int, bool> AddItemRpc = Bind<Action<Fermenter, long, int, bool>>(typeof(Fermenter), "RPC_AddItem", new Type[3] { typeof(long), typeof(int), typeof(bool) }); internal const int BarrelEmpty = 0; internal const int BarrelReady = 3; internal static bool FermenterReady { get { if (ContentNameImpl != null && FermenterView != null && FermenterView.FieldType == typeof(ZNetView) && FermenterStatus != null) { return AddItemRpc != null; } return false; } } internal static bool Ready { get { if (CheckAccessImpl != null && ContainerView != null && ContainerView.FieldType == typeof(ZNetView) && StationView != null && StationView.FieldType == typeof(ZNetView) && StationList != null) { return StationList.FieldType == typeof(List<CraftingStation>); } return false; } } internal static List<CraftingStation> Stations => StationList?.GetValue(null) as List<CraftingStation>; internal static bool CheckAccess(Container container, long playerId) { if (CheckAccessImpl == null) { return false; } try { return CheckAccessImpl(container, playerId); } catch (Exception) { return false; } } internal static ZNetView NetViewOf(Container container) { object? obj = ContainerView?.GetValue(container); return (ZNetView)((obj is ZNetView) ? obj : null); } internal static void RefreshContainer(Container container) { try { ContainerLoad?.Invoke(container); } catch (Exception) { } } internal static ZNetView NetViewOf(CraftingStation station) { object? obj = StationView?.GetValue(station); return (ZNetView)((obj is ZNetView) ? obj : null); } internal static string ContentOf(Fermenter fermenter) { return ContentNameImpl?.Invoke(fermenter); } internal static ZNetView NetViewOf(Fermenter fermenter) { object? obj = FermenterView?.GetValue(fermenter); return (ZNetView)((obj is ZNetView) ? obj : null); } internal static int StatusOf(Fermenter fermenter) { try { return (FermenterStatus == null) ? (-1) : Convert.ToInt32(FermenterStatus.Invoke(fermenter, null)); } catch (Exception) { return -1; } } internal static void AddToBarrel(Fermenter fermenter, string itemPrefab) { AddItemRpc?.Invoke(fermenter, 0L, StringExtensionMethods.GetStableHashCode(itemPrefab), arg4: false); } internal static bool EmptyBarrel(Fermenter fermenter) { ZNetView val = NetViewOf(fermenter); if ((Object)(object)val == (Object)null || !val.IsValid()) { return false; } ZDO zDO = val.GetZDO(); zDO.Set(ZDOVars.s_content, 0, false); zDO.Set(ZDOVars.s_startTime, 0, false); zDO.Set(ZDOVars.s_cheatedQueued, false); return true; } private static T Bind<T>(Type owner, string name, params Type[] args) where T : class { MethodInfo methodInfo = AccessTools.Method(owner, name, args, (Type[])null); if (!(methodInfo == null)) { return (T)(object)Delegate.CreateDelegate(typeof(T), methodInfo); } return null; } } internal static class Hud { private static int _blockUntilFrame = -1; internal static bool Available { get; set; } internal static bool IsOpen { get; private set; } internal static HudWindow Window { get; set; } internal static bool Blocking { get { if (!IsOpen) { return Time.frameCount <= _blockUntilFrame; } return true; } } internal static void Open(CraftingStation station) { if (!Available || (Object)(object)Window == (Object)null || IsOpen) { return; } IsOpen = true; try { Window.OnOpened(station); ((Behaviour)Window).enabled = true; } catch (Exception arg) { Plugin.Log.LogError((object)$"The HUD could not open: {arg}"); Close(); } } internal static void Close() { if (IsOpen) { IsOpen = false; _blockUntilFrame = Time.frameCount + 1; if ((Object)(object)Window != (Object)null) { ((Behaviour)Window).enabled = false; } } } } internal static class HudStyle { internal static readonly Color Gold = new Color(1f, 0.72f, 0.36f, 1f); internal static readonly Color GoldBright = new Color(1f, 0.84f, 0.35f, 1f); internal static readonly Color Body = new Color(0.93f, 0.89f, 0.8f, 1f); internal static readonly Color Dim = new Color(0.72f, 0.64f, 0.52f, 1f); internal static readonly Color Orange = new Color(1f, 0.65f, 0.16f, 1f); internal static GUIStyle Label; internal static GUIStyle Notice; internal static GUIStyle Small; internal static GUIStyle Heading; internal static GUIStyle Title; internal static GUIStyle TitleFallback; internal static GUIStyle Center; internal static GUIStyle Wrap; internal static GUIStyle Plain; internal static GUIStyle PlainRight; internal static GUIStyle PlainSmall; internal static GUIStyle Button; internal static GUIStyle TabOn; internal static GUIStyle Slot; internal static GUIStyle SlotOn; internal static GUIStyle Field; internal static GUIStyle Row; internal static GUISkin Skin; private static Texture2D _wood; private static Texture2D _stud; private static Texture2D _lock; private static Font _body; private static Font _title; private static bool _ready; private static readonly Dictionary<Sprite, Rect> IconRects = new Dictionary<Sprite, Rect>(); private static readonly Dictionary<string, bool> TitleFits = new Dictionary<string, bool>(); internal static Texture2D LockIcon { get { //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_lock != (Object)null)) { return _lock = Load("lock", new Color(0.9f, 0.7f, 0.3f, 1f)); } return _lock; } } internal static void Ensure() { if (!_ready) { _ready = true; try { Build(); } catch (Exception arg) { Plugin.Log.LogError((object)$"Could not build the HUD's Valheim look; using plain styles. {arg}"); } FillMissing(); } } private static void FillMissing() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) Label = (GUIStyle)(((object)Label) ?? ((object)new GUIStyle(GUI.skin.label))); Notice = (GUIStyle)(((object)Notice) ?? ((object)new GUIStyle(GUI.skin.label))); Small = (GUIStyle)(((object)Small) ?? ((object)new GUIStyle(GUI.skin.label))); Heading = (GUIStyle)(((object)Heading) ?? ((object)new GUIStyle(GUI.skin.label))); Title = (GUIStyle)(((object)Title) ?? ((object)new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)4, fontSize = 28 })); TitleFallback = TitleFallback ?? Title; Center = (GUIStyle)(((object)Center) ?? ((object)new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)4 })); Wrap = (GUIStyle)(((object)Wrap) ?? ((object)new GUIStyle(GUI.skin.label) { wordWrap = true })); Plain = (GUIStyle)(((object)Plain) ?? ((object)new GUIStyle(GUI.skin.label))); PlainRight = (GUIStyle)(((object)PlainRight) ?? ((object)new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)5 })); PlainSmall = (GUIStyle)(((object)PlainSmall) ?? ((object)new GUIStyle(GUI.skin.label) { fontSize = 14 })); Button = (GUIStyle)(((object)Button) ?? ((object)new GUIStyle(GUI.skin.button))); TabOn = (GUIStyle)(((object)TabOn) ?? ((object)new GUIStyle(GUI.skin.button) { fontStyle = (FontStyle)1 })); Slot = (GUIStyle)(((object)Slot) ?? ((object)new GUIStyle(GUI.skin.box))); SlotOn = (GUIStyle)(((object)SlotOn) ?? ((object)new GUIStyle(GUI.skin.box))); Field = (GUIStyle)(((object)Field) ?? ((object)new GUIStyle(GUI.skin.textField))); Row = (GUIStyle)(((object)Row) ?? ((object)new GUIStyle(GUI.skin.button))); Skin = (((Object)(object)Skin != (Object)null) ? Skin : GUI.skin); } private static void Build() { //IL_001e: 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_0066: 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_00a8: 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_00fe: 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_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Expected O, but got Unknown //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Expected O, but got Unknown //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Expected O, but got Unknown //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Expected O, but got Unknown //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Expected O, but got Unknown //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Expected O, but got Unknown //IL_03c0: Expected O, but got Unknown //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Expected O, but got Unknown //IL_0424: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_0477: Unknown result type (might be due to invalid IL or missing references) //IL_04cc: Unknown result type (might be due to invalid IL or missing references) //IL_04e3: Unknown result type (might be due to invalid IL or missing references) //IL_04ed: Expected O, but got Unknown //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Expected O, but got Unknown //IL_050c: 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_0520: Expected O, but got Unknown //IL_0525: Expected O, but got Unknown //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0580: Unknown result type (might be due to invalid IL or missing references) FindFonts(); _wood = Load("wood", new Color(0.42f, 0.29f, 0.19f, 1f)); _stud = Load("stud", new Color(0.5f, 0.36f, 0.24f, 1f)); Label = Make(GUI.skin.label, _body, 16, Body, (TextAnchor)3); Notice = Make(GUI.skin.label, _body, 16, Gold, (TextAnchor)3); Small = Make(GUI.skin.label, _body, 13, Dim, (TextAnchor)3); Heading = Make(GUI.skin.label, _body, 20, Gold, (TextAnchor)3); Title = Make(GUI.skin.label, ((Object)(object)_title != (Object)null) ? _title : _body, 30, Gold, (TextAnchor)4); TitleFallback = Make(GUI.skin.label, _body, 28, Gold, (TextAnchor)4); Center = Make(GUI.skin.label, _body, 16, Body, (TextAnchor)4); Plain = Make(GUI.skin.label, _body, 16, Color.white, (TextAnchor)3); PlainRight = Make(GUI.skin.label, _body, 16, Color.white, (TextAnchor)5); PlainSmall = Make(GUI.skin.label, _body, 14, Color.white, (TextAnchor)3); Wrap = Make(GUI.skin.label, _body, 16, Body, (TextAnchor)0); Wrap.wordWrap = true; Button = Make(GUI.skin.button, _body, 16, Body, (TextAnchor)4); Button.normal.background = Load("button", new Color(0.2f, 0.19f, 0.18f, 1f)); Button.hover.background = Load("button_hover", new Color(0.3f, 0.28f, 0.24f, 1f)); Button.active.background = Load("button_active", new Color(0.12f, 0.11f, 0.1f, 1f)); Button.focused.background = Button.normal.background; Button.hover.textColor = GoldBright; Button.active.textColor = Gold; Button.border = new RectOffset(12, 12, 12, 12); Button.padding = new RectOffset(10, 10, 4, 4); TabOn = new GUIStyle(Button); TabOn.normal.background = Button.hover.background; TabOn.normal.textColor = GoldBright; TabOn.focused.background = Button.hover.background; TabOn.focused.textColor = GoldBright; Slot = new GUIStyle(GUI.skin.box) { border = new RectOffset(14, 14, 14, 14), margin = new RectOffset(0, 0, 0, 0), padding = new RectOffset(0, 0, 0, 0) }; Slot.normal.background = Load("slot", new Color(0.28f, 0.19f, 0.12f, 0.9f)); SlotOn = new GUIStyle(Slot); SlotOn.normal.background = Load("slot_selected", new Color(0.4f, 0.28f, 0.15f, 0.95f)); Field = Make(GUI.skin.textField, _body, 16, Body, (TextAnchor)3); Field.normal.background = Load("field", new Color(0.13f, 0.09f, 0.07f, 1f)); Field.focused.background = Field.normal.background; Field.hover.background = Field.normal.background; Field.focused.textColor = GoldBright; Field.border = new RectOffset(14, 14, 14, 14); Field.padding = new RectOffset(10, 10, 4, 4); Row = new GUIStyle(GUI.skin.button) { border = new RectOffset(0, 0, 0, 0) }; Row.normal.background = null; Row.hover.background = Flat(new Color(1f, 0.85f, 0.5f, 0.1f)); Row.active.background = Flat(new Color(1f, 0.85f, 0.5f, 0.2f)); Row.focused.background = null; BuildSkin(); } internal static void Fill(Rect rect, Color color) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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) if ((int)Event.current.type == 7) { Color color2 = GUI.color; GUI.color = color; GUI.DrawTexture(rect, (Texture)(object)Texture2D.whiteTexture); GUI.color = color2; } } internal static void Border(Rect rect, Color color, float thickness = 2f) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) Fill(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width, thickness), color); Fill(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).yMax - thickness, ((Rect)(ref rect)).width, thickness), color); Fill(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, thickness, ((Rect)(ref rect)).height), color); Fill(new Rect(((Rect)(ref rect)).xMax - thickness, ((Rect)(ref rect)).y, thickness, ((Rect)(ref rect)).height), color); } internal static void Frame(Rect rect) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) if ((int)Event.current.type == 7) { if ((Object)(object)_wood != (Object)null) { GUI.DrawTexture(rect, (Texture)(object)_wood, (ScaleMode)0); } else { Fill(rect, new Color(0.42f, 0.29f, 0.19f, 1f)); } Border(rect, new Color(0.05f, 0.03f, 0.02f, 1f), 3f); Border(Inset(rect, 3f), new Color(0.23f, 0.15f, 0.09f, 1f), 7f); Border(Inset(rect, 10f), new Color(0.59f, 0.42f, 0.27f, 1f), 1f); Border(Inset(rect, 11f), new Color(0.13f, 0.09f, 0.055f, 1f), 1f); DrawStud(((Rect)(ref rect)).x + 11f, ((Rect)(ref rect)).y + 11f); DrawStud(((Rect)(ref rect)).xMax - 11f, ((Rect)(ref rect)).y + 11f); DrawStud(((Rect)(ref rect)).x + 11f, ((Rect)(ref rect)).yMax - 11f); DrawStud(((Rect)(ref rect)).xMax - 11f, ((Rect)(ref rect)).yMax - 11f); } } internal static void Divider(float left, float right, float y) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) if ((int)Event.current.type == 7) { float num = (left + right) / 2f; Color color = default(Color); ((Color)(ref color))..ctor(0.1f, 0.055f, 0.03f, 1f); Color color2 = default(Color); ((Color)(ref color2))..ctor(0.72f, 0.53f, 0.29f, 1f); Fill(new Rect(left, y, num - 14f - left, 3f), color); Fill(new Rect(left, y - 1f, num - 14f - left, 1f), color2); Fill(new Rect(num + 14f, y, right - num - 14f, 3f), color); Fill(new Rect(num + 14f, y - 1f, right - num - 14f, 1f), color2); Matrix4x4 matrix = GUI.matrix; GUIUtility.RotateAroundPivot(45f, new Vector2(num, y + 1f)); Fill(new Rect(num - 5f, y - 4f, 10f, 10f), color); Fill(new Rect(num - 4f, y - 3f, 8f, 8f), color2); GUI.matrix = matrix; } } internal static void Shadowed(Rect rect, string text, GUIStyle style) { //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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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) Color contentColor = GUI.contentColor; GUI.contentColor = new Color(0f, 0f, 0f, 0.75f * contentColor.a); GUI.Label(new Rect(((Rect)(ref rect)).x + 1f, ((Rect)(ref rect)).y + 1.5f, ((Rect)(ref rect)).width, ((Rect)(ref rect)).height), text, style); GUI.contentColor = contentColor; GUI.Label(rect, text, style); } internal static void DrawTitle(Rect rect, string text) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) if (!TitleFits.TryGetValue(text, out var value)) { value = (Object)(object)_title != (Object)null; int num = 0; while (value && num < text.Length) { value = text[num] == ' ' || _title.HasCharacter(text[num]); num++; } TitleFits[text] = value; } Shadowed(rect, text, value ? Title : TitleFallback); } internal static void SlotIcon(Rect rect, Sprite sprite) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) GUI.Box(rect, GUIContent.none, Slot); Icon(new Rect(((Rect)(ref rect)).x + 3f, ((Rect)(ref rect)).y + 3f, ((Rect)(ref rect)).width - 6f, ((Rect)(ref rect)).height - 6f), sprite); } internal static void Icon(Rect rect, Sprite sprite) { //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_0095: 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_0022: Invalid comparison between Unknown and I4 //IL_00a9: 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_0035: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)sprite == (Object)null || (Object)(object)sprite.texture == (Object)null || (int)Event.current.type != 7) { return; } if (!IconRects.TryGetValue(sprite, out var value)) { try { Rect textureRect = sprite.textureRect; Texture2D texture = sprite.texture; value = new Rect(((Rect)(ref textureRect)).x / (float)((Texture)texture).width, ((Rect)(ref textureRect)).y / (float)((Texture)texture).height, ((Rect)(ref textureRect)).width / (float)((Texture)texture).width, ((Rect)(ref textureRect)).height / (float)((Texture)texture).height); } catch (Exception) { value = Rect.zero; } IconRects[sprite] = value; } if (((Rect)(ref value)).width > 0f) { GUI.DrawTextureWithTexCoords(rect, (Texture)(object)sprite.texture, value); } } internal static Color WithAlpha(Color color, float alpha) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) return new Color(color.r, color.g, color.b, alpha); } private static Rect Inset(Rect rect, float by) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) return new Rect(((Rect)(ref rect)).x + by, ((Rect)(ref rect)).y + by, ((Rect)(ref rect)).width - 2f * by, ((Rect)(ref rect)).height - 2f * by); } private static void DrawStud(float x, float y) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_stud != (Object)null) { GUI.DrawTexture(new Rect(x - 8f, y - 8f, 16f, 16f), (Texture)(object)_stud); } } private static GUIStyle Make(GUIStyle basis, Font font, int size, Color color, TextAnchor anchor) { //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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_0023: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown GUIStyle val = new GUIStyle(basis) { font = font, fontSize = size, alignment = anchor, wordWrap = false, clipping = (TextClipping)1, richText = false }; val.normal.textColor = color; val.hover.textColor = color; val.active.textColor = color; val.focused.textColor = color; return val; } private static void BuildSkin() { //IL_0034: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown Skin = Object.Instantiate<GUISkin>(GUI.skin); ((Object)Skin).hideFlags = (HideFlags)61; Texture2D texture = Load("scroll_track", new Color(0.1f, 0.07f, 0.05f, 0.8f)); Texture2D texture2 = Load("scroll_thumb", new Color(0.6f, 0.43f, 0.21f, 1f)); Skin.verticalScrollbar = Bar(Skin.verticalScrollbar, texture, new RectOffset(5, 5, 5, 5)); Skin.verticalScrollbarThumb = Bar(Skin.verticalScrollbarThumb, texture2, new RectOffset(5, 5, 6, 6)); Skin.horizontalScrollbar = Bar(Skin.horizontalScrollbar, texture, new RectOffset(5, 5, 5, 5)); Skin.horizontalScrollbarThumb = Bar(Skin.horizontalScrollbarThumb, texture2, new RectOffset(6, 6, 5, 5)); Skin.verticalScrollbarUpButton = Hidden(Skin.verticalScrollbarUpButton); Skin.verticalScrollbarDownButton = Hidden(Skin.verticalScrollbarDownButton); Skin.horizontalScrollbarLeftButton = Hidden(Skin.horizontalScrollbarLeftButton); Skin.horizontalScrollbarRightButton = Hidden(Skin.horizontalScrollbarRightButton); } private static GUIStyle Bar(GUIStyle basis, Texture2D texture, RectOffset border) { //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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_003a: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown GUIStyle val = new GUIStyle(basis) { border = border, margin = new RectOffset(0, 0, 0, 0), padding = new RectOffset(0, 0, 0, 0), overflow = new RectOffset(0, 0, 0, 0) }; val.normal.background = texture; val.hover.background = texture; val.active.background = texture; val.focused.background = texture; return val; } private static GUIStyle Hidden(GUIStyle basis) { //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_0011: 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_0028: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown GUIStyle val = new GUIStyle(basis) { fixedWidth = 0f, fixedHeight = 0f }; val.normal.background = null; val.hover.background = null; val.active.background = null; val.focused.background = null; return val; } private static Texture2D Flat(Color color) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown Texture2D val = new Texture2D(1, 1, (TextureFormat)4, false) { hideFlags = (HideFlags)61 }; val.SetPixel(0, 0, color); val.Apply(); return val; } private static Texture2D Load(string name, Color fallback) { //IL_0013: 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_0021: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) try { if (HudTextures.Base64.TryGetValue(name, out var value)) { Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false) { hideFlags = (HideFlags)61 }; if (ImageConversion.LoadImage(val, Convert.FromBase64String(value))) { ((Texture)val).filterMode = (FilterMode)1; ((Texture)val).wrapMode = (TextureWrapMode)1; return val; } Object.Destroy((Object)(object)val); } } catch (Exception ex) { Plugin.Log.LogWarning((object)("HUD texture '" + name + "' could not be decoded (" + ex.Message + "); using a flat colour.")); } return Flat(fallback); } private static void FindFonts() { try { Font[] array = Resources.FindObjectsOfTypeAll<Font>(); StringBuilder stringBuilder = new StringBuilder(); Font[] array2 = array; foreach (Font val in array2) { if ((Object)(object)val != (Object)null) { stringBuilder.Append(((Object)val).name).Append(val.dynamic ? string.Empty : " (static)").Append("; "); } } _body = Pick(array, "AveriaSerif", "Regular", null) ?? Pick(array, "AveriaSerif", null, null); _title = Pick(array, null, null, "Norse") ?? Pick(array, "Norse", null, null); Plugin.Log.LogInfo((object)string.Format("HUD fonts: text = {0}, title = {1} (fonts in the game: {2})", ((Object)(object)_body != (Object)null) ? ((Object)_body).name : "default", ((Object)(object)_title != (Object)null) ? ((Object)_title).name : "default", stringBuilder)); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Could not look for the game's fonts (" + ex.Message + "); the HUD uses the default font.")); } } private static Font Pick(Font[] fonts, string contains, string and, string exact) { foreach (Font val in fonts) { if ((Object)(object)val == (Object)null || !val.dynamic) { continue; } string name = ((Object)val).name; bool num; if (exact == null) { if (name.IndexOf(contains, StringComparison.OrdinalIgnoreCase) < 0) { continue; } if (and == null) { goto IL_0053; } num = name.IndexOf(and, StringComparison.OrdinalIgnoreCase) >= 0; } else { num = string.Equals(name, exact, StringComparison.OrdinalIgnoreCase); } if (!num) { continue; } goto IL_0053; IL_0053: if (val.HasCharacter('A') && val.HasCharacter('a')) { return val; } } return null; } } internal static class HudTextures { internal static readonly Dictionary<string, string> Base64 = new Dictionary<string, string> { { "wood", "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAQDAwQDAwQEBAQFBQQFBwsHBwYGBw4KCggLEA4RERAOEA8SFBoWEhMYEw8QFh8XGBsbHR0dERYgIh8cIhocHRz/" + "2wBDAQUFBQcGBw0HBw0cEhASHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBz/wAARCAGAAgADASIAAhEBAxEB/8QA" + "GwAAAgMBAQEAAAAAAAAAAAAAAQMAAgQFBgf/xABEEAABAwEEBwYDBgMHBQEBAQABAAIRAwQTITESFEFRYXGRIjJCUoGhU2KSBRUjM0NyorHRNFRjgsHw8SRE" + "c6PhwpOy/8QAFwEBAQEBAAAAAAAAAAAAAAAAAAECBf/EAB0RAQEBAQEBAQEBAQAAA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