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(); } 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[" + Plugin.MenuKeyLabel + "] " + 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 _held = new Dictionary(); 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 item in _held) { item.Key.m_onChanged = item.Value; } foreach (KeyValuePair 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 Entries = new List(64); private static readonly Dictionary ById = new Dictionary(); private static readonly Dictionary ByInventory = new Dictionary(); private static readonly List Scratch = new List(32); private static readonly Comparison 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((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 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() != (Object)null && (Object)(object)container.m_wagon == (Object)null && !container.m_autoDestroyEmpty && (Object)(object)((Component)container).GetComponentInParent() == (Object)null) { return (Object)(object)((Component)container).GetComponentInParent() == (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 States = new Dictionary(); private static readonly List Found = new List(32); private static readonly List Usable = new List(32); private static readonly List Scratch = new List(32); private static readonly List Producers = new List(16); private static readonly Dictionary Picks = new Dictionary(StringComparer.Ordinal); private static readonly List Barrels = new List(16); private static readonly HashSet Live = new HashSet(); 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 DistanceFromCenter = Comparer.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 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(RecipeFor) : new Func(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 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 list = null; foreach (int key in States.Keys) { if (!Live.Contains(key)) { (list ?? (list = new List())).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 ByFromShared = new Dictionary(StringComparer.Ordinal); private static readonly List Conversions = new List(16); private static readonly List Live = new List(16); private static bool _built; internal static IReadOnlyList 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 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 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()?.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 CheckAccessImpl = Bind>(typeof(Container), "CheckAccess", new Type[1] { typeof(long) }); private static readonly FieldInfo ContainerView = AccessTools.Field(typeof(Container), "m_nview"); private static readonly Func ContainerLoad = Bind>(typeof(Container), "Load", Array.Empty()); 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 ContentNameImpl = Bind>(typeof(Fermenter), "GetContentName", Array.Empty()); 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 AddItemRpc = Bind>(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); } return false; } } internal static List Stations => StationList?.GetValue(null) as List; 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(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 IconRects = new Dictionary(); private static readonly Dictionary TitleFits = new Dictionary(); 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(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(); 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 Base64 = new Dictionary { { "wood", "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAQDAwQDAwQEBAQFBQQFBwsHBwYGBw4KCggLEA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e4NlMoL+TqPb0pD55D6O+WWC5GUPKWy7kWuKc70gg1sCslkUlIAIR8OcDSaj2KO6ogPvggVwo1JqfnSiwkmcgAB4c9OHL9Wvqt5wN2bXWt/dYIMDg0" + "smZTJQVfWapQqRrOPzTWe14wA75Lr166VqRiJQAzkE1LPLHXR7mucfM+183iwK6tLMLabEWpprEv6+DAoItGxCBi/f5Mnpnx9vsXlioSAO3pi88trtaPM5N/" + "cG83qg1NI70ODANzuRCRYQiCnQ7bRsYZaqARMUYfcPH0oQQARtxTODe9yv86vyxSMfHjckNfofUJyb507IV6qH//3af2hJ8e63EK5RAxT+DDlRCTMzUs5iME" + "kQ0IW5qSlIRMQuLwgz7Gh1yEmuG7CrliPXzxr9NOtRa+UqqHxxiQ63taEkEnPeeVZMz91re/OBw8MtLlVOualFz7IF81KFY1yCZGbecADANxT6AnIeFIoBEy" + "4r7CSqEevvT2VefDpcrsg9nYE/+dK+Zb54QJAEZGuroLN2ovMejoU48/gC89lo1cR4pAGwKDrARtp+giOFIYEJuz06vitXevi1ItnE4l1XcWc7XTzeNgQ7c/" + "U0AE9CS9E9WG+elINuEc3pfB6FASvWmPHSVgn+u4O7RhFMohXV0q48JMHlPXipBEJwcy7gtT86XcuvHv9FYEAPBwJvHoR+Xge5ExX4vHnLFst+8lYwrG2FHt" + "dgGAiBBEGkurdS5Vw1lm/DOd8P60XKi8hY2LEKbdaym3PK1y6tQx+YPn/nxgtWIG1l+wsZa++zRSKqaKXxjvu/DamYVqi+E/1ub8H3lbLleqM0HvAAAAAElF" + "TkSuQmCC" }, { "button_hover", "iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAYAAADuFn/PAAAHZ0lEQVR42u1cW2xcVxVd+9zXeMbPsceO3byah0MSEkycF7RqQ6FJEyrUl8tDUCqB+kH5aalK" + "haokVfmBQiUQEqpKP2gRkCZEVG0KpCmlilBt6jhKqganTuI0df0cx/PyzNy595zNx4yTIRk7NpkoRTpb2n8z87HW7LX22XefSygdBgAJAEI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mCC" }, { "scroll_thumb", "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB2klEQVR42t2TvWsUURTFz3nzsZOd3WgUleCipkgQwcJCBCurNKZZccTCzj/CSpcgFmIZ/QPE" + "bgcFsRabxFKSQlOJESWCYf1IzDo7O+8di9nsgtEUlp7mwX3c37v3vHuJgSSQhFYeNRuT48HdblbM5X3VHQTfsBivhYvdbv/miatPltRqGc7POwDgTjIArKXJ" + "Ed+4lx8/bU+tvvsO6wQSEICjh6o4PT2R0cdco/n4udqJxyupNeX7iSEh39Od9c/Z1NLKxubPXoG8b5HlFnlu8ebt1+LVaifqZXqgdhIiaTsAMGXpqdXytXhz" + "K7v8oaPX52dnFwIPAClDgiRq1cB/v/7DZT0706l6Z0hK7cQzGJrgBZLGJPajuNrFb5LKkwDhmfpOfASwFQF0oOgK62EPibC7AQAkEQBIai8ArOMfAf+i/xXA" + "gZl/N3F07w+DRUUARcBV4mpvF3SQonIYRt9IQmonHs4tbNXiYHFfVJx88fTZdQeWQzNI7uXW7a+HCAPT8YtoWQKRpK5sITklEqqE/o3pY3HQOMiZfl9yEpyE" + "wgr1ODQXzk6asci7NdF8+A1puT/DXtSC4TzcWju5GPq4v/ElO57lFiRgDHX4QLRtPHO7cSm9J7UMWa7zL+SI0FXM7GhQAAAAAElFTkSuQmCC" } }; } internal sealed class HudWindow : MonoBehaviour { private struct PanelRow { internal CraftingStation Station; internal StationJob Job; internal float Distance; } private const float PanelMaxWidth = 1040f; private const float PanelMaxHeight = 700f; private const float OrderRowHeight = 104f; private const float PickerRowHeight = 54f; private const float PanelRowHeight = 64f; private const float ContentTop = 138f; private const float ContentBottom = 44f; private const float PanelRange = 150f; private const float RefreshSeconds = 0.5f; private const float UnlinkWidth = 66f; private int _tab; private CraftingStation _station; private bool _picking; private bool _focusSearch; private string _search = string.Empty; private Vector2 _scrollOrders; private Vector2 _scrollPicker; private Vector2 _scrollPanel; private string _status; private float _statusUntil; private readonly List _after = new List(); private readonly List _panel = new List(32); private float _panelRead = -10f; private readonly List _pickable = new List(64); private int _pickableStation = -1; private string _pickableSearch; private int _pickableOrders = -1; private int _pickableGeneration = -1; private float _pickableRead = -10f; internal bool Typing { get; private set; } private void Awake() { ((Behaviour)this).enabled = false; } internal void OnOpened(CraftingStation station) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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) _station = station; _tab = ((!((Object)(object)station != (Object)null)) ? 1 : 0); _picking = false; _status = null; _search = string.Empty; _scrollOrders = Vector2.zero; _scrollPicker = Vector2.zero; _scrollPanel = Vector2.zero; _panelRead = -10f; _pickableRead = -10f; _after.Clear(); } private void Update() { if (Hud.IsOpen) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || ((Character)localPlayer).IsDead() || ((Character)localPlayer).IsTeleporting() || Menu.IsVisible() || InventoryGui.IsVisible() || Console.IsVisible() || Input.GetKeyDown((KeyCode)27)) { Hud.Close(); } } } private void OnGUI() { if (!Hud.IsOpen) { return; } try { Draw(); } catch (ExitGUIException) { throw; } catch (Exception arg) { Plugin.Log.LogError((object)$"The HUD failed and was closed: {arg}"); Hud.Close(); } } private void Draw() { //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) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) HudStyle.Ensure(); GUI.depth = -100; Typing = false; GUISkin skin = GUI.skin; GUI.skin = HudStyle.Skin; float num = Mathf.Clamp((float)Screen.height / 1080f, 0.75f, 3f) * Plugin.HudScale.Value; GUI.matrix = Matrix4x4.Scale(new Vector3(num, num, 1f)); float num2 = (float)Screen.width / num; float num3 = (float)Screen.height / num; float num4 = Mathf.Min(1040f, num2 - 40f); float num5 = Mathf.Min(700f, num3 - 40f); GUI.BeginGroup(new Rect((num2 - num4) / 2f, (num3 - num5) / 2f, num4, num5)); try { DrawFrame(num4, num5); DrawTabs(); Rect val = default(Rect); ((Rect)(ref val))..ctor(28f, 138f, num4 - 56f, num5 - 138f - 44f); GUI.BeginGroup(val); try { if (_tab == 0) { DrawStationTab(((Rect)(ref val)).width, ((Rect)(ref val)).height); } else { DrawPanelTab(((Rect)(ref val)).width, ((Rect)(ref val)).height); } } finally { GUI.EndGroup(); } DrawFooter(num4, num5); } finally { GUI.EndGroup(); GUI.matrix = Matrix4x4.identity; GUI.skin = skin; } RunQueued(); } private void RunQueued() { if (_after.Count != 0) { Action[] array = _after.ToArray(); _after.Clear(); Action[] array2 = array; for (int i = 0; i < array2.Length; i++) { array2[i](); } } } private void DrawFrame(float width, float height) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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) HudStyle.Frame(new Rect(0f, 0f, width, height)); HudStyle.DrawTitle(new Rect(70f, 18f, width - 140f, 50f), Text.HudTitle); HudStyle.Divider(60f, width - 60f, 74f); if (GUI.Button(new Rect(width - 66f, 24f, 38f, 34f), "X", HudStyle.Button)) { Hud.Close(); } } private void DrawTabs() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) string[] array = new string[2] { Text.TabStation, Text.TabPanel }; for (int i = 0; i < array.Length; i++) { if (GUI.Button(new Rect(28f + (float)i * 178f, 90f, 170f, 36f), array[i], (_tab == i) ? HudStyle.TabOn : HudStyle.Button)) { _tab = i; _picking = false; } } } private void DrawFooter(float width, float height) { //IL_0016: 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) HudStyle.Shadowed(new Rect(32f, height - 36f, 300f, 26f), Text.FooterHint(Plugin.MenuKeyLabel), HudStyle.Small); if (_status != null && Time.unscaledTime < _statusUntil) { HudStyle.Shadowed(new Rect(340f, height - 36f, width - 380f, 26f), _status, HudStyle.Notice); } } private void Say(string message) { _status = message; _statusUntil = Time.unscaledTime + 4f; } private void Persist(CraftingStation station, StationJob job) { if (!StationJobs.Save(station, job)) { Say(Text.SaveFailed); } } private void DrawStationTab(float width, float height) { //IL_0044: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) CraftingStation station = _station; ZNetView val = (((Object)(object)station != (Object)null) ? GameAccess.NetViewOf(station) : null); if ((Object)(object)station == (Object)null || (Object)(object)val == (Object)null || !val.IsValid()) { HudStyle.Shadowed(new Rect(0f, 0f, width, 60f), Text.NoStation(Plugin.MenuKeyLabel), HudStyle.Wrap); return; } StationJob stationJob = StationJobs.Get(station); StationState stationState = Crafter.StateOf(station); string name = Localization.instance.Localize(station.m_name); float num = width - 396f; HudStyle.Shadowed(new Rect(0f, 0f, num - 190f - 8f - 66f - 8f, 30f), Text.StationHeader(name, station.GetLevel(true)), HudStyle.Heading); if (stationJob != null && (stationJob.Orders.Count > 0 || stationJob.Ferment)) { bool enabled = stationJob.Enabled; if (GUI.Button(new Rect(width - 190f, 0f, 190f, 34f), enabled ? Text.StationOn : Text.StationOff, enabled ? HudStyle.TabOn : HudStyle.Button)) { stationJob.Enabled = !stationJob.Enabled; Persist(station, stationJob); } } bool flag = stationJob?.Ferment ?? false; if (GameAccess.FermenterReady && GUI.Button(new Rect(width - 380f - 8f, 0f, 190f, 34f), Text.FermentLabel(flag), flag ? HudStyle.TabOn : HudStyle.Button)) { StationJob stationJob2 = stationJob ?? new StationJob(); stationJob2.Ferment = !stationJob2.Ferment; if (stationJob2.Orders.Count == 0 && stationJob2.Ferment) { stationJob2.Enabled = true; } Persist(station, stationJob2); } DrawLinkButtons(station, stationJob, new Rect(num - 190f - 8f, 0f, 190f, 34f), withUnlink: true); string text = Text.ChestsInRange(stationState?.Chests ?? 0, Plugin.Radius.Value, stationState?.Barrels ?? 0, flag); if (stationState != null && stationState.Remote) { text += Text.RunBy(stationState.Runner); } if (stationJob != null && stationJob.HasChest) { text = text + " - " + Text.LinkInfo(LinkedChestAvailable(stationJob, station, out var meters), meters); } HudStyle.Shadowed(new Rect(0f, 34f, width, 24f), text, HudStyle.Small); if (_picking) { DrawPicker(station, stationJob, width, height); } else { DrawOrders(station, stationJob, stationState, width, height); } } private void DrawLinkButtons(CraftingStation station, StationJob job, Rect rect, bool withUnlink) { //IL_0037: 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) bool flag = ChestLink.IsWaitingFor(station); bool flag2 = job != null && job.HasChest; if (GUI.Button(rect, Text.LinkButton(flag2, flag), (flag || flag2) ? HudStyle.TabOn : HudStyle.Button)) { if (flag) { ChestLink.Cancel(); } else { ChestLink.Begin(station); Hud.Close(); } } if (withUnlink && flag2 && !flag && GUI.Button(new Rect(((Rect)(ref rect)).x - 66f - 8f, ((Rect)(ref rect)).y, 66f, ((Rect)(ref rect)).height), Text.UnlinkButton, HudStyle.Button)) { _after.Add(delegate { ChestLink.Unlink(station, job); }); } } private static bool LinkedChestAvailable(StationJob job, CraftingStation station, out float meters) { //IL_004d: 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) meters = 0f; Player localPlayer = Player.m_localPlayer; if (job == null || !job.HasChest || (Object)(object)localPlayer == (Object)null) { return false; } Container val = ChestRegistry.FindByNetworkId(job.ChestUser, job.ChestId, localPlayer.GetPlayerID()); if ((Object)(object)val == (Object)null) { return false; } meters = Vector3.Distance(((Component)val).transform.position, ((Component)station).transform.position); return true; } private void DrawOrders(CraftingStation station, StationJob job, StationState state, float width, float height) { //IL_0098: 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) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) int num = ((job != null) ? job.Orders.Count : 0); Rect view = default(Rect); ((Rect)(ref view))..ctor(0f, 66f, width, height - 66f - 48f); if (num == 0) { HudStyle.Shadowed(new Rect(((Rect)(ref view)).x + 2f, ((Rect)(ref view)).y, ((Rect)(ref view)).width, 40f), Text.NoOrders, HudStyle.Wrap); } else { VirtualRows(view, ref _scrollOrders, num, 104f, delegate(int i, Rect rect) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) DrawOrderRow(station, job, state, i, rect); }); } bool flag = num >= 8; Color color = GUI.color; if (flag) { GUI.color = new Color(1f, 1f, 1f, 0.55f); } if (GUI.Button(new Rect(0f, height - 42f, 240f, 36f), Text.AddRecipe, HudStyle.Button)) { if (flag) { Say(Text.ListFull); } else { _picking = true; _focusSearch = true; _scrollPicker = Vector2.zero; } } GUI.color = color; } private void DrawOrderRow(CraftingStation station, StationJob job, StationState state, int index, Rect rect) { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_035e: 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_0308: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_046c: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04d6: Unknown result type (might be due to invalid IL or missing references) if (index >= job.Orders.Count) { return; } Order order = job.Orders[index]; RecipeRow recipeRow = RecipeIndex.Find(station.m_name, order.Recipe); CraftStatus status = ((state != null) ? state.Orders[index] : CraftStatus.Idle); if (!job.Enabled) { status = CraftStatus.Disabled; } else if (order.Paused) { status = CraftStatus.Paused; } GUI.Box(rect, GUIContent.none, HudStyle.Slot); HudStyle.SlotIcon(new Rect(((Rect)(ref rect)).x + 8f, ((Rect)(ref rect)).y + 9f, 52f, 52f), recipeRow?.Icon); float num = ((Rect)(ref rect)).xMax - 8f; Rect val = default(Rect); ((Rect)(ref val))..ctor(num - 40f, ((Rect)(ref rect)).y + 8f, 40f, 32f); if (GUI.Button(val, "X", HudStyle.Button)) { int at = index; _after.Add(delegate { if (at < job.Orders.Count) { job.Orders.RemoveAt(at); Persist(station, job); } }); } Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(((Rect)(ref val)).x - 6f - 104f, ((Rect)(ref rect)).y + 8f, 104f, 32f); if (GUI.Button(val2, order.Paused ? Text.Resume : Text.Pause, order.Paused ? HudStyle.TabOn : HudStyle.Button)) { order.Paused = !order.Paused; Persist(station, job); } float num2 = ((Rect)(ref val2)).x - 8f - 268f; if (order.Mode != OrderMode.Endless) { DrawCounter(station, job, order, num2, ((Rect)(ref rect)).y + 8f); } Rect val3 = default(Rect); ((Rect)(ref val3))..ctor(num2 - 8f - 140f, ((Rect)(ref rect)).y + 8f, 140f, 32f); if (GUI.Button(val3, Text.ModeName(order.Mode), HudStyle.Button)) { OrderRules.SetMode(order, OrderRules.NextMode(order.Mode)); Persist(station, job); } FermentIndex.Conversion conversion = default(FermentIndex.Conversion); bool flag = recipeRow != null && FermentIndex.TryGetByShared(recipeRow.Shared, out conversion); float num3 = ((Rect)(ref rect)).y + 42f; if (order.Mode == OrderMode.Stock) { if (flag && GUI.Button(new Rect(((Rect)(ref val3)).x, num3, 170f, 26f), Text.CountEndLabel(order.CountEnd), HudStyle.Button)) { order.CountEnd = !order.CountEnd; Persist(station, job); } if (GUI.Button(new Rect(((Rect)(ref val3)).x + 179f, num3, 170f, 26f), Text.CapLabel(order.Cap), HudStyle.Button)) { order.Cap = !order.Cap; Persist(station, job); } } if (GUI.Button(new Rect(((Rect)(ref val3)).x + 358f, num3, 170f, 26f), Text.CraftMissingLabel(order.CraftMissing), HudStyle.Button)) { order.CraftMissing = !order.CraftMissing; Persist(station, job); } float num4 = ((Rect)(ref rect)).y + 72f; HudStyle.Shadowed(new Rect(((Rect)(ref val3)).x, num4, num2 - 8f - ((Rect)(ref val3)).x, 26f), Text.ReserveLabel, HudStyle.Small); DrawReserve(station, job, order, num2, num4); float num5 = ((Rect)(ref rect)).x + 70f; float num6 = ((Rect)(ref val3)).x - 12f - num5; string text = ((recipeRow != null) ? recipeRow.Display : order.Recipe); if (flag) { text = text + " > " + Text.FermentsInto(conversion.Produced, Localization.instance.Localize(conversion.ToShared)); } HudStyle.Shadowed(new Rect(num5, ((Rect)(ref rect)).y + 6f, num6, 28f), text, HudStyle.Label); string detail = ((state != null) ? state.Detail[index] : null); int stock = ((state != null) ? state.Stock[index] : 0); bool making = state != null && state.Making[index]; Color contentColor = GUI.contentColor; GUI.contentColor = StatusColor(status); HudStyle.Shadowed(new Rect(num5, ((Rect)(ref rect)).y + 38f, num6, 28f), Text.OrderLine(order, status, stock, detail, making), HudStyle.PlainSmall); GUI.contentColor = contentColor; } private void DrawCounter(CraftingStation station, StationJob job, Order order, float x, float y) { //IL_000e: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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_0100: Unknown result type (might be due to invalid IL or missing references) if (GUI.Button(new Rect(x, y, 44f, 32f), "-10", HudStyle.Button)) { Step(station, job, order, -10); } if (GUI.Button(new Rect(x + 48f, y, 44f, 32f), "-1", HudStyle.Button)) { Step(station, job, order, -1); } Rect val = default(Rect); ((Rect)(ref val))..ctor(x + 96f, y, 76f, 32f); GUI.Box(val, GUIContent.none, HudStyle.Slot); Color contentColor = GUI.contentColor; GUI.contentColor = HudStyle.GoldBright; HudStyle.Shadowed(val, order.Target.ToString(), HudStyle.Center); GUI.contentColor = contentColor; if (GUI.Button(new Rect(x + 176f, y, 44f, 32f), "+1", HudStyle.Button)) { Step(station, job, order, 1); } if (GUI.Button(new Rect(x + 224f, y, 44f, 32f), "+10", HudStyle.Button)) { Step(station, job, order, 10); } } private void Step(CraftingStation station, StationJob job, Order order, int delta) { int num = OrderRules.ClampTarget(order.Target + delta); if (num != order.Target) { order.Target = num; Persist(station, job); } } private void DrawReserve(CraftingStation station, StationJob job, Order order, float x, float y) { //IL_000e: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_010f: Unknown result type (might be due to invalid IL or missing references) if (GUI.Button(new Rect(x, y, 44f, 26f), "-10", HudStyle.Button)) { StepReserve(station, job, order, -10); } if (GUI.Button(new Rect(x + 48f, y, 44f, 26f), "-1", HudStyle.Button)) { StepReserve(station, job, order, -1); } Rect val = new Rect(x + 96f, y, 76f, 26f); GUI.Box(val, GUIContent.none, HudStyle.Slot); Color contentColor = GUI.contentColor; GUI.contentColor = ((order.Reserve > 0) ? HudStyle.GoldBright : HudStyle.Dim); HudStyle.Shadowed(val, Text.ReserveValue(order.Reserve), HudStyle.Center); GUI.contentColor = contentColor; if (GUI.Button(new Rect(x + 176f, y, 44f, 26f), "+1", HudStyle.Button)) { StepReserve(station, job, order, 1); } if (GUI.Button(new Rect(x + 224f, y, 44f, 26f), "+10", HudStyle.Button)) { StepReserve(station, job, order, 10); } } private void StepReserve(CraftingStation station, StationJob job, Order order, int delta) { int num = OrderRules.ClampReserve(order.Reserve + delta); if (num != order.Reserve) { order.Reserve = num; Persist(station, job); } } private static Color StatusColor(CraftStatus status) { //IL_004a: 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) //IL_0050: Unknown result type (might be due to invalid IL or missing references) switch (status) { case CraftStatus.Working: return HudStyle.GoldBright; case CraftStatus.Idle: case CraftStatus.Paused: case CraftStatus.CountComplete: case CraftStatus.StockReached: case CraftStatus.CapReached: case CraftStatus.Disabled: case CraftStatus.ReserveReached: return HudStyle.Dim; default: return HudStyle.Orange; } } private void DrawPicker(CraftingStation station, StationJob job, float width, float height) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) GUI.SetNextControlName("search"); _search = GUI.TextField(new Rect(0f, 62f, width, 34f), _search, 60, HudStyle.Field); if (_focusSearch) { GUI.FocusControl("search"); _focusSearch = false; } Typing = GUI.GetNameOfFocusedControl() == "search"; HudStyle.Shadowed(new Rect(2f, 98f, width, 22f), Text.SearchHint, HudStyle.Small); RefreshPickable(station, job); Rect view = default(Rect); ((Rect)(ref view))..ctor(0f, 126f, width, height - 126f - 48f); if (_pickable.Count == 0) { HudStyle.Shadowed(new Rect(((Rect)(ref view)).x + 2f, ((Rect)(ref view)).y, ((Rect)(ref view)).width, 30f), Text.NoRecipes, HudStyle.Small); } else { VirtualRows(view, ref _scrollPicker, _pickable.Count, 54f, delegate(int i, Rect rect) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) DrawPickRow(station, _pickable[i], rect); }); } if (GUI.Button(new Rect(0f, height - 42f, 160f, 36f), Text.Done, HudStyle.Button)) { GUI.FocusControl(string.Empty); _picking = false; } } private void DrawPickRow(CraftingStation station, RecipeRow row, Rect rect) { //IL_001b: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) GUI.Box(rect, GUIContent.none, HudStyle.Slot); HudStyle.SlotIcon(new Rect(((Rect)(ref rect)).x + 5f, ((Rect)(ref rect)).y + 2f, ((Rect)(ref rect)).height - 4f, ((Rect)(ref rect)).height - 4f), row.Icon); float num = ((Rect)(ref rect)).x + ((Rect)(ref rect)).height + 8f; float num2 = ((Rect)(ref rect)).width - num - 20f; string text = row.Display; if (FermentIndex.TryGetByShared(row.Shared, out var conversion)) { text = text + " > " + Text.FermentsInto(conversion.Produced, Localization.instance.Localize(conversion.ToShared)); } HudStyle.Shadowed(new Rect(num, ((Rect)(ref rect)).y + 3f, num2, 24f), text, HudStyle.Label); HudStyle.Shadowed(new Rect(num, ((Rect)(ref rect)).y + 28f, num2, 20f), row.Ingredients, HudStyle.Small); if (GUI.Button(rect, GUIContent.none, HudStyle.Row)) { GUI.FocusControl(string.Empty); _after.Add(delegate { AddOrder(station, row); }); } } private void AddOrder(CraftingStation station, RecipeRow row) { StationJob stationJob = StationJobs.Get(station) ?? new StationJob(); if (stationJob.Orders.Count == 0) { stationJob.Enabled = true; } FermentIndex.Conversion conversion; bool flag = FermentIndex.TryGetByShared(row.Shared, out conversion); if (OrderRules.AddOrder(stationJob, row.Prefab, flag ? OrderMode.Stock : OrderMode.Count, 10, countEnd: true) == null) { Say(Text.ListFull); return; } if (flag && GameAccess.FermenterReady) { stationJob.Ferment = true; } Persist(station, stationJob); Say(Text.OrderAdded(row.Display)); } private void RefreshPickable(CraftingStation station, StationJob job) { int instanceID = ((Object)station).GetInstanceID(); int num = job?.Orders.Count ?? 0; float unscaledTime = Time.unscaledTime; if (_pickableStation == instanceID && _pickableSearch == _search && _pickableOrders == num && _pickableGeneration == RecipeIndex.Generation && unscaledTime - _pickableRead < 2f) { return; } _pickable.Clear(); string[] array = _search.ToLowerInvariant().Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries); Player localPlayer = Player.m_localPlayer; foreach (RecipeRow item in RecipeIndex.ForStation(station.m_name)) { if (((Object)(object)localPlayer != (Object)null && !localPlayer.IsRecipeKnown(item.Shared)) || (job != null && OrderRules.FindOrder(job, item.Prefab) != null)) { continue; } bool flag = true; string[] array2 = array; foreach (string value in array2) { if (!item.Search.Contains(value)) { flag = false; break; } } if (flag) { _pickable.Add(item); } } _pickableStation = instanceID; _pickableSearch = _search; _pickableOrders = num; _pickableGeneration = RecipeIndex.Generation; _pickableRead = unscaledTime; } private void DrawPanelTab(float width, float height) { //IL_001a: 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_00cc: 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) RefreshPanel(); if (GUI.Button(new Rect(0f, 0f, 190f, 34f), Text.EnableAll, HudStyle.Button)) { _after.Add(delegate { SetAll(on: true); }); } if (GUI.Button(new Rect(198f, 0f, 190f, 34f), Text.DisableAll, HudStyle.Button)) { _after.Add(delegate { SetAll(on: false); }); } if (_panel.Count == 0) { HudStyle.Shadowed(new Rect(2f, 48f, width, 30f), Text.PanelEmpty, HudStyle.Small); return; } VirtualRows(new Rect(0f, 44f, width, height - 44f), ref _scrollPanel, _panel.Count, 64f, delegate(int i, Rect rect) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) DrawPanelRow(_panel[i], rect); }); } private void DrawPanelRow(PanelRow row, Rect rect) { //IL_0033: 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) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: 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_0223: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) CraftingStation station = row.Station; if ((Object)(object)station == (Object)null) { return; } bool num = HasWork(row.Job); GUI.Box(rect, GUIContent.none, HudStyle.Slot); HudStyle.SlotIcon(new Rect(((Rect)(ref rect)).x + 7f, ((Rect)(ref rect)).y + 6f, 50f, 50f), station.m_icon); float num2 = ((Rect)(ref rect)).xMax - 8f; Rect val = default(Rect); ((Rect)(ref val))..ctor(num2 - 110f, ((Rect)(ref rect)).y + 14f, 110f, 34f); if (GUI.Button(val, Text.Edit, HudStyle.Button)) { _station = station; _tab = 0; _picking = false; _scrollOrders = Vector2.zero; } float num3 = ((Rect)(ref val)).x - 6f; if (num) { bool enabled = row.Job.Enabled; Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(num3 - 120f, ((Rect)(ref rect)).y + 14f, 120f, 34f); if (GUI.Button(val2, enabled ? Text.PanelOn : Text.PanelOff, enabled ? HudStyle.TabOn : HudStyle.Button)) { StationJob job = row.Job; _after.Add(delegate { job.Enabled = !job.Enabled; Persist(station, job); }); } num3 = ((Rect)(ref val2)).x - 6f; } Rect rect2 = default(Rect); ((Rect)(ref rect2))..ctor(num3 - 160f, ((Rect)(ref rect)).y + 14f, 160f, 34f); DrawLinkButtons(station, row.Job, rect2, withUnlink: false); float num4 = ((Rect)(ref rect2)).x - 12f; float num5 = ((Rect)(ref rect)).x + 66f; HudStyle.Shadowed(text: Localization.instance.Localize(station.m_name) + " " + Text.Distance(row.Distance), rect: new Rect(num5, ((Rect)(ref rect)).y + 4f, num4 - num5, 28f), style: HudStyle.Label); string text = (num ? Text.Summary(Crafter.Summarize(row.Job, Crafter.StateOf(station))) : Text.NoJob); if (row.Job != null && row.Job.HasChest) { text = text + " - " + Text.LinkShort(LinkedChestAvailable(row.Job, station, out var meters), meters); } HudStyle.Shadowed(new Rect(num5, ((Rect)(ref rect)).y + 32f, num4 - num5, 26f), text, HudStyle.Small); } private void SetAll(bool on) { foreach (PanelRow item in _panel) { if ((Object)(object)item.Station != (Object)null && HasWork(item.Job) && item.Job.Enabled != on) { item.Job.Enabled = on; Persist(item.Station, item.Job); } } } private void RefreshPanel() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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) float unscaledTime = Time.unscaledTime; Player localPlayer = Player.m_localPlayer; List stations = GameAccess.Stations; if (unscaledTime - _panelRead < 0.5f || (Object)(object)localPlayer == (Object)null || stations == null) { return; } _panelRead = unscaledTime; _panel.Clear(); Vector3 position = ((Component)localPlayer).transform.position; foreach (CraftingStation item in stations) { if ((Object)(object)item == (Object)null) { continue; } float num = Vector3.Distance(position, ((Component)item).transform.position); if (!(num > 150f)) { StationJob job = StationJobs.Get(item); if (HasWork(job) || RecipeIndex.ForStation(item.m_name).Count > 0) { _panel.Add(new PanelRow { Station = item, Job = job, Distance = num }); } } } _panel.Sort(delegate(PanelRow a, PanelRow b) { bool flag = HasWork(a.Job); bool flag2 = HasWork(b.Job); if (flag == flag2) { return a.Distance.CompareTo(b.Distance); } return (!flag) ? 1 : (-1); }); } private static bool HasWork(StationJob job) { if (job != null) { if (job.Orders.Count <= 0) { return job.Ferment; } return true; } return false; } private static void VirtualRows(Rect view, ref Vector2 scroll, int count, float rowHeight, Action drawRow) { //IL_0023: 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_002a: 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_008d: Unknown result type (might be due to invalid IL or missing references) Rect val = default(Rect); ((Rect)(ref val))..ctor(0f, 0f, ((Rect)(ref view)).width - 16f, (float)count * rowHeight); scroll = GUI.BeginScrollView(view, scroll, val); try { int num = Mathf.Clamp(Mathf.FloorToInt(scroll.y / rowHeight), 0, Mathf.Max(0, count - 1)); int num2 = Mathf.Clamp(Mathf.CeilToInt((scroll.y + ((Rect)(ref view)).height) / rowHeight), 0, count - 1); for (int i = num; i <= num2; i++) { drawRow(i, new Rect(0f, (float)i * rowHeight, ((Rect)(ref val)).width, rowHeight - 4f)); } } finally { GUI.EndScrollView(); } } } internal enum OrderMode { Count, Stock, Endless } internal sealed class Order { internal const int MaxTarget = 9999; internal string Recipe = string.Empty; internal OrderMode Mode; internal int Target = 10; internal bool CountEnd = true; internal int Done; internal bool Paused; internal bool Cap = true; internal bool CraftMissing = true; internal int Reserve; } internal sealed class StationJob { internal const int MaxOrders = 8; internal bool Enabled = true; internal bool Ferment; internal long ChestUser; internal uint ChestId; internal readonly List Orders = new List(); internal bool HasChest => ChestId != 0; internal void LinkChest(long user, uint id) { ChestUser = user; ChestId = id; } internal void UnlinkChest() { ChestUser = 0L; ChestId = 0u; } } internal static class JobCodec { private const string Header = "AC1"; private const string LinkTag = "L:"; internal static string Serialize(StationJob job) { StringBuilder stringBuilder = new StringBuilder("AC1"); bool num = job.Enabled; int num2 = (job.Ferment ? 2 : 0); stringBuilder.Append(';').Append(((num ? 1 : 0) | num2).ToString(CultureInfo.InvariantCulture)); if (job.HasChest) { stringBuilder.Append(';').Append("L:").Append(job.ChestUser.ToString(CultureInfo.InvariantCulture)) .Append(':') .Append(job.ChestId.ToString(CultureInfo.InvariantCulture)); } foreach (Order order in job.Orders) { StringBuilder stringBuilder2 = stringBuilder.Append(';').Append(Escape(order.Recipe)).Append(','); int mode = (int)order.Mode; stringBuilder2.Append(mode.ToString(CultureInfo.InvariantCulture)).Append(',').Append(order.Target.ToString(CultureInfo.InvariantCulture)) .Append(',') .Append(order.CountEnd ? '1' : '0') .Append(',') .Append(order.Done.ToString(CultureInfo.InvariantCulture)) .Append(',') .Append(order.Paused ? '1' : '0') .Append(',') .Append(order.Cap ? '1' : '0') .Append(',') .Append(order.CraftMissing ? '1' : '0') .Append(',') .Append(order.Reserve.ToString(CultureInfo.InvariantCulture)); } return stringBuilder.ToString(); } internal static StationJob Parse(string text) { if (string.IsNullOrEmpty(text)) { return null; } string[] array = text.Split(';'); if (array.Length < 2 || array[0] != "AC1") { return null; } int.TryParse(array[1], NumberStyles.None, CultureInfo.InvariantCulture, out var result); StationJob stationJob = new StationJob { Enabled = ((result & 1) != 0), Ferment = ((result & 2) != 0) }; for (int i = 2; i < array.Length; i++) { if (stationJob.Orders.Count >= 8) { break; } if (array[i].StartsWith("L:", StringComparison.Ordinal)) { ParseLink(array[i], stationJob); continue; } Order order = ParseOrder(array[i]); if (order != null) { stationJob.Orders.Add(order); } } return stationJob; } private static void ParseLink(string text, StationJob job) { string[] array = text.Substring("L:".Length).Split(':'); if (array.Length == 2 && long.TryParse(array[0], NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture, out var result) && uint.TryParse(array[1], NumberStyles.None, CultureInfo.InvariantCulture, out var result2) && result2 != 0) { job.LinkChest(result, result2); } } private static Order ParseOrder(string text) { string[] array = text.Split(','); if (array.Length < 6 || array.Length > 9) { return null; } string text2 = Unescape(array[0]); if (text2.Length == 0) { return null; } int.TryParse(array[1], NumberStyles.None, CultureInfo.InvariantCulture, out var result); int.TryParse(array[2], NumberStyles.None, CultureInfo.InvariantCulture, out var result2); int.TryParse(array[4], NumberStyles.None, CultureInfo.InvariantCulture, out var result3); int result4 = 0; if (array.Length > 8) { int.TryParse(array[8], NumberStyles.None, CultureInfo.InvariantCulture, out result4); } return new Order { Recipe = text2, Mode = ((result >= 0 && result <= 2) ? ((OrderMode)result) : OrderMode.Count), Target = OrderRules.ClampTarget(result2), CountEnd = (array[3] != "0"), Done = Math.Max(0, Math.Min(9999, result3)), Paused = (array[5] == "1"), Cap = (array.Length < 7 || array[6] != "0"), CraftMissing = (array.Length < 8 || array[7] != "0"), Reserve = OrderRules.ClampReserve(result4) }; } internal static string Escape(string value) { if (string.IsNullOrEmpty(value)) { return string.Empty; } StringBuilder stringBuilder = new StringBuilder(value.Length); foreach (char c in value) { if (c == '%' || c == ',' || c == ';' || c < ' ') { StringBuilder stringBuilder2 = stringBuilder.Append('%'); int num = c; stringBuilder2.Append(num.ToString("X2", CultureInfo.InvariantCulture)); } else { stringBuilder.Append(c); } } return stringBuilder.ToString(); } internal static string Unescape(string value) { if (string.IsNullOrEmpty(value) || value.IndexOf('%') < 0) { return value ?? string.Empty; } StringBuilder stringBuilder = new StringBuilder(value.Length); for (int i = 0; i < value.Length; i++) { if (value[i] == '%' && i + 2 < value.Length && TryHex(value, i + 1, out var decoded)) { stringBuilder.Append(decoded); i += 2; } else { stringBuilder.Append(value[i]); } } return stringBuilder.ToString(); } private static bool TryHex(string value, int index, out char decoded) { decoded = '\0'; if (!int.TryParse(value.Substring(index, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture, out var result)) { return false; } decoded = (char)result; return true; } } internal enum OrderVerdict { Ready, Paused, CountComplete, StockReached, CapReached } internal static class OrderRules { internal static OrderVerdict Evaluate(Order order, int stock, int unitsPerCraft) { if (order.Paused) { return OrderVerdict.Paused; } switch (order.Mode) { case OrderMode.Count: if (order.Done < order.Target) { return OrderVerdict.Ready; } return OrderVerdict.CountComplete; case OrderMode.Stock: if (stock >= order.Target) { return OrderVerdict.StockReached; } if (!order.Cap || (long)stock + (long)Math.Max(1, unitsPerCraft) <= order.Target) { return OrderVerdict.Ready; } return OrderVerdict.CapReached; default: return OrderVerdict.Ready; } } internal static int UnitsPerCraft(int yield, int fermentedPerItem, bool countEnd) { int num = Math.Max(1, yield); if (!countEnd || fermentedPerItem <= 0) { return num; } return num * fermentedPerItem; } internal static int StockUnits(int product, int end, int fermentingBarrels, int producedPerItem, bool countEnd) { if (!countEnd || producedPerItem <= 0) { return product; } long num = ((long)product + (long)fermentingBarrels) * producedPerItem + end; if (num <= int.MaxValue) { return (int)num; } return int.MaxValue; } internal static int ClampTarget(int value) { return Math.Max(1, Math.Min(9999, value)); } internal static int ClampReserve(int value) { return Math.Max(0, Math.Min(9999, value)); } internal static string UnderReserve(IReadOnlyList needs, Func have, int reserve) { if (reserve <= 0) { return null; } foreach (IngredientNeed need in needs) { if ((long)have(need.Item) - (long)need.Amount < reserve) { return need.Item; } } return null; } internal static OrderMode NextMode(OrderMode mode) { return (OrderMode)((int)(mode + 1) % 3); } internal static void SetMode(Order order, OrderMode mode) { if (order.Mode != mode) { order.Mode = mode; order.Done = 0; } } internal static Order AddOrder(StationJob job, string recipe, OrderMode mode, int target, bool countEnd) { if (job.Orders.Count >= 8 || string.IsNullOrEmpty(recipe) || FindOrder(job, recipe) != null) { return null; } Order order = new Order { Recipe = recipe, Mode = mode, Target = ClampTarget(target), CountEnd = countEnd }; job.Orders.Add(order); return order; } internal static Order FindOrder(StationJob job, string recipe) { foreach (Order order in job.Orders) { if (string.Equals(order.Recipe, recipe, StringComparison.OrdinalIgnoreCase)) { return order; } } return null; } } [HarmonyPatch(typeof(Container), "Awake")] internal static class ContainerAwakePatch { private static bool _reported; private static void Postfix(Container __instance) { try { ChestRegistry.Register(__instance); } catch (Exception arg) { if (!_reported) { _reported = true; Plugin.Log.LogError((object)$"Could not register a container: {arg}"); } } } } [HarmonyPatch(typeof(InventoryGui), "Show")] internal static class ChestOpenedPatch { private static bool _reported; private static void Postfix(Container container) { try { ChestLink.OnChestOpened(container); } catch (Exception arg) { if (!_reported) { _reported = true; Plugin.Log.LogError((object)$"Could not link the chest that was opened: {arg}"); } } } } [HarmonyPatch(typeof(Fermenter), "Awake")] internal static class FermenterAwakePatch { private static bool _reported; private static void Postfix(Fermenter __instance) { try { FermentIndex.Register(__instance); } catch (Exception arg) { if (!_reported) { _reported = true; Plugin.Log.LogError((object)$"Could not register a fermenter: {arg}"); } } } } [HarmonyPatch(typeof(TextInput), "IsVisible")] internal static class TextInputVisiblePatch { private static void Postfix(ref bool __result) { if (Hud.Blocking) { __result = true; } } } [HarmonyPatch(typeof(ZInput), "GetMouseScrollWheel")] internal static class ScrollWheelPatch { private static void Postfix(ref float __result) { if (Hud.Blocking) { __result = 0f; } } } [HarmonyPatch(typeof(CraftingStation), "GetHoverText")] internal static class StationHoverTextPatch { private static bool _reported; private static void Postfix(CraftingStation __instance, ref string __result) { if (!Plugin.ShowOnHover.Value) { return; } try { string text = Actions.HoverLine(__instance); if (text != null) { __result += text; } } catch (Exception arg) { if (!_reported) { _reported = true; Plugin.Log.LogError((object)$"Could not build the station label: {arg}"); } } } } internal struct IngredientNeed { internal string Item; internal int Amount; } internal static class Planner { internal const int MaxDepth = 3; internal static string Resolve(string recipe, Func> needsOf, Func have, Func recipeFor, int maxDepth) { HashSet visiting = new HashSet(StringComparer.Ordinal) { recipe }; return Walk(recipe, needsOf, have, recipeFor, maxDepth, visiting); } private static string Walk(string recipe, Func> needsOf, Func have, Func recipeFor, int depth, HashSet visiting) { IReadOnlyList readOnlyList = needsOf(recipe); if (!AnyMissing(readOnlyList, have)) { return recipe; } if (depth <= 0) { return null; } string text = null; foreach (IngredientNeed item in readOnlyList) { if (have(item.Item) < item.Amount) { string text2 = recipeFor(item.Item); if (text2 == null || !visiting.Add(text2)) { return null; } string text3 = Walk(text2, needsOf, have, recipeFor, depth - 1, visiting); visiting.Remove(text2); if (text3 == null) { return null; } if (text == null) { text = text3; } } } return text; } private static bool AnyMissing(IReadOnlyList needs, Func have) { foreach (IngredientNeed need in needs) { if (have(need.Item) < need.Amount) { return true; } } return false; } } [BepInPlugin("com.despr0grammer.autocrafter", "AutoCrafter", "0.2.0")] public class Plugin : BaseUnityPlugin { public const string PluginGuid = "com.despr0grammer.autocrafter"; public const string PluginName = "AutoCrafter"; public const string PluginVersion = "0.2.0"; private const float PruneInterval = 30f; internal static ManualLogSource Log; internal static ConfigEntry MenuKey; internal static ConfigEntry HudScale; internal static ConfigEntry Enabled; internal static ConfigEntry Radius; internal static ConfigEntry CraftSeconds; internal static ConfigEntry CountPlayerInventory; internal static ConfigEntry PlayEffects; internal static ConfigEntry ShowOnHover; internal static ConfigEntry RequireKnownRecipes; private Harmony _harmony; private float _nextPrune; private bool _tickReported; private static readonly Type[] CorePatches = new Type[2] { typeof(ContainerAwakePatch), typeof(FermenterAwakePatch) }; private static readonly Type[] HudPatches = new Type[1] { typeof(TextInputVisiblePatch) }; private static readonly Type[] OptionalPatches = new Type[3] { typeof(ScrollWheelPatch), typeof(StationHoverTextPatch), typeof(ChestOpenedPatch) }; internal static string MenuKeyLabel { get; private set; } = "H"; private void Awake() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; BindConfig(); if (!GameAccess.Ready) { ((BaseUnityPlugin)this).Logger.LogError((object)"Valheim internals changed (Container.CheckAccess, CraftingStation.m_allStations or the network views not found); mod disabled."); ((Behaviour)this).enabled = false; return; } _harmony = new Harmony("com.despr0grammer.autocrafter"); if (!ApplyPatches()) { ((Behaviour)this).enabled = false; return; } Hud.Window = ((Component)this).gameObject.AddComponent(); ChestRegistry.SeedFromScene(); Fermenter[] array = Object.FindObjectsByType((FindObjectsSortMode)0); for (int i = 0; i < array.Length; i++) { FermentIndex.Register(array[i]); } ((BaseUnityPlugin)this).Logger.LogInfo((object)("AutoCrafter 0.2.0 loaded (" + MenuKeyLabel + " opens the " + (Hud.Available ? "HUD" : "HUD (unavailable)") + ", " + $"chests within {Radius.Value:0} m)")); } private void BindConfig() { //IL_0017: 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) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Expected O, but got Unknown //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Expected O, but got Unknown MenuKey = ((BaseUnityPlugin)this).Config.Bind("Keys", "MenuKey", new KeyboardShortcut((KeyCode)104, Array.Empty()), "Opens the HUD. Look at a crafting station first to edit its orders; without one it opens the panel of all the stations loaded nearby."); MenuKeyLabel = ((object)MenuKey.Value/*cast due to .constrained prefix*/).ToString(); MenuKey.SettingChanged += delegate { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) MenuKeyLabel = ((object)MenuKey.Value/*cast due to .constrained prefix*/).ToString(); }; HudScale = ((BaseUnityPlugin)this).Config.Bind("Hud", "HudScale", 1f, new ConfigDescription("Size of the HUD. 1 is sized for the screen height; raise it if the text is too small.", (AcceptableValueBase)(object)new AcceptableValueRange(0.5f, 2.5f), Array.Empty())); ShowOnHover = ((BaseUnityPlugin)this).Config.Bind("Hud", "ShowOrdersOnHover", true, "Show the key and the number of orders when you look at a crafting station."); Enabled = ((BaseUnityPlugin)this).Config.Bind("Crafting", "Enabled", true, "Master switch. Off, no station crafts on its own (orders are kept)."); Radius = ((BaseUnityPlugin)this).Config.Bind("Crafting", "Radius", 50f, new ConfigDescription("How far from a station (in metres) its chests are used: ingredients come from them and what it makes goes into them.", (AcceptableValueBase)(object)new AcceptableValueRange(5f, 100f), Array.Empty())); CraftSeconds = ((BaseUnityPlugin)this).Config.Bind("Crafting", "CraftSeconds", 3f, new ConfigDescription("Seconds a station rests after each craft.", (AcceptableValueBase)(object)new AcceptableValueRange(0.5f, 60f), Array.Empty())); CountPlayerInventory = ((BaseUnityPlugin)this).Config.Bind("Crafting", "CountPlayerInventory", false, "Stock orders also count what you carry. Off, only the chests around the station count."); PlayEffects = ((BaseUnityPlugin)this).Config.Bind("Crafting", "PlayEffects", true, "Play the station's own crafting sound and effect after each craft."); RequireKnownRecipes = ((BaseUnityPlugin)this).Config.Bind("Sharing", "RequireKnownRecipes", false, "A station's orders were added by a player who knew the recipe, so by default they are run as they are, even by a game whose character has not learned that recipe. Turn on to craft only recipes this character knows (an order for another recipe then says \"recipe not known\")."); } private bool ApplyPatches() { Type[] corePatches = CorePatches; foreach (Type type in corePatches) { try { _harmony.PatchAll(type); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)("Required patch " + type.Name + " failed, mod disabled: " + ex.Message)); _harmony.UnpatchSelf(); return false; } } bool available = true; corePatches = HudPatches; foreach (Type type2 in corePatches) { try { _harmony.PatchAll(type2); } catch (Exception ex2) { available = false; ((BaseUnityPlugin)this).Logger.LogWarning((object)("HUD patch " + type2.Name + " failed (" + ex2.Message + "); the HUD is off, the stations keep their orders.")); } } Hud.Available = available; corePatches = OptionalPatches; foreach (Type type3 in corePatches) { try { _harmony.PatchAll(type3); } catch (Exception ex3) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Optional patch " + type3.Name + " failed (" + ex3.Message + "); that feature is off.")); } } return true; } private void OnDestroy() { Hud.Close(); Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } private void Update() { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) if (Time.unscaledTime >= _nextPrune) { _nextPrune = Time.unscaledTime + 30f; ChestRegistry.Prune(); } Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || ((Character)localPlayer).IsDead() || ((Character)localPlayer).IsTeleporting()) { return; } if (Enabled.Value) { try { Crafter.Tick(localPlayer); } catch (Exception arg) { if (!_tickReported) { _tickReported = true; ((BaseUnityPlugin)this).Logger.LogError((object)$"The crafter failed (further errors are not logged): {arg}"); } } } KeyboardShortcut value = MenuKey.Value; bool flag = ((KeyboardShortcut)(ref value)).IsDown(); if (Hud.IsOpen) { if (flag && (!((Object)(object)Hud.Window != (Object)null) || !Hud.Window.Typing)) { Hud.Close(); } } else if (flag && InputAllowed()) { try { Actions.OpenHud(); } catch (Exception arg2) { ((BaseUnityPlugin)this).Logger.LogError((object)$"Action failed: {arg2}"); } } } private static bool InputAllowed() { if ((!((Object)(object)Chat.instance != (Object)null) || !Chat.instance.HasFocus()) && !Console.IsVisible() && !TextInput.IsVisible() && !Menu.IsVisible() && !Minimap.IsOpen() && !InventoryGui.IsVisible() && !StoreGui.IsVisible() && !UnifiedPopup.IsVisible()) { return !Hud.IsPieceSelectionVisible(); } return false; } } internal sealed class RecipeRow { internal Recipe Recipe; internal string Prefab; internal string Shared; internal string Display; internal string Search; internal Sprite Icon; internal string Ingredients; internal IngredientNeed[] Needs; internal int Yield; } internal static class RecipeIndex { private static readonly List NoRows = new List(); private static readonly Dictionary> ByStation = new Dictionary>(StringComparer.Ordinal); private static int _recipeCount = -1; private static string _language; internal static int Generation { get; private set; } internal static IReadOnlyList ForStation(string stationName) { Refresh(); if (stationName == null || !ByStation.TryGetValue(stationName, out var value)) { return NoRows; } return value; } internal static RecipeRow Find(string stationName, string prefab) { foreach (RecipeRow item in ForStation(stationName)) { if (string.Equals(item.Prefab, prefab, StringComparison.OrdinalIgnoreCase)) { return item; } } return null; } internal static RecipeRow FindByShared(string stationName, string sharedName) { foreach (RecipeRow item in ForStation(stationName)) { if (item.Shared == sharedName) { return item; } } return null; } private static void Refresh() { ObjectDB instance = ObjectDB.instance; if (!((Object)(object)instance == (Object)null) && instance.m_recipes != null && instance.m_recipes.Count != 0 && Localization.instance != null && (_recipeCount != instance.m_recipes.Count || _language != Text.Language)) { Build(instance); } } private static void Build(ObjectDB db) { ByStation.Clear(); foreach (Recipe recipe in db.m_recipes) { if ((Object)(object)recipe == (Object)null || !recipe.m_enabled || (Object)(object)recipe.m_item == (Object)null || (Object)(object)recipe.m_craftingStation == (Object)null || recipe.m_noCraftOnlyUpgrade || recipe.m_requireOnlyOneIngredient || recipe.m_amount <= 0) { continue; } SharedData val = recipe.m_item.m_itemData?.m_shared; if (val == null || string.IsNullOrEmpty(val.m_name)) { continue; } string name = recipe.m_craftingStation.m_name; if (!ByStation.TryGetValue(name, out var value)) { value = new List(32); ByStation[name] = value; } string prefab = ((Object)recipe.m_item).name; if (!value.Exists((RecipeRow existing) => existing.Prefab == prefab)) { string text = Localization.instance.Localize(val.m_name); if (string.IsNullOrEmpty(text)) { text = prefab; } IngredientNeed[] needs = BuildNeeds(recipe); value.Add(new RecipeRow { Recipe = recipe, Prefab = prefab, Shared = val.m_name, Display = text, Search = (text + " " + prefab).ToLowerInvariant(), Icon = ((val.m_icons != null && val.m_icons.Length != 0) ? val.m_icons[0] : null), Needs = needs, Ingredients = DescribeIngredients(needs), Yield = recipe.m_amount }); } } foreach (List value2 in ByStation.Values) { value2.Sort((RecipeRow a, RecipeRow b) => string.Compare(a.Display, b.Display, StringComparison.CurrentCultureIgnoreCase)); } _recipeCount = db.m_recipes.Count; _language = Text.Language; Generation++; } private static IngredientNeed[] BuildNeeds(Recipe recipe) { List list = new List(4); if (recipe.m_resources != null) { Requirement[] resources = recipe.m_resources; foreach (Requirement val in resources) { string name = val.m_resItem?.m_itemData?.m_shared?.m_name; int amount = val.GetAmount(1); if (!string.IsNullOrEmpty(name) && amount > 0) { int num = list.FindIndex((IngredientNeed existing) => existing.Item == name); if (num >= 0) { list[num] = new IngredientNeed { Item = name, Amount = list[num].Amount + amount }; } else { list.Add(new IngredientNeed { Item = name, Amount = amount }); } } } } return list.ToArray(); } private static string DescribeIngredients(IngredientNeed[] needs) { List list = new List(needs.Length); for (int i = 0; i < needs.Length; i++) { IngredientNeed ingredientNeed = needs[i]; list.Add(ingredientNeed.Amount + "x " + Localization.instance.Localize(ingredientNeed.Item)); } return string.Join(", ", list); } } internal struct OrderReport { internal int Status; internal int Stock; internal bool Making; internal string Detail; } internal sealed class SharedState { internal string Runner = string.Empty; internal long Beat; internal int Chests; internal int Barrels; internal readonly List Orders = new List(); } internal enum RunnerAction { Follow, Wait, Takeover } internal static class StateCodec { internal const double StaleSeconds = 30.0; internal const double UnreportedGraceSeconds = 15.0; internal const double BeatSeconds = 10.0; internal const double MinChangeSeconds = 3.0; private const string Header = "S1"; internal static string Serialize(SharedState state) { StringBuilder stringBuilder = new StringBuilder("S1"); stringBuilder.Append(';').Append(JobCodec.Escape(state.Runner)).Append(';') .Append(state.Beat.ToString(CultureInfo.InvariantCulture)) .Append(';') .Append(state.Chests.ToString(CultureInfo.InvariantCulture)) .Append(';') .Append(state.Barrels.ToString(CultureInfo.InvariantCulture)); foreach (OrderReport order in state.Orders) { stringBuilder.Append(';').Append(order.Status.ToString(CultureInfo.InvariantCulture)).Append(',') .Append(order.Stock.ToString(CultureInfo.InvariantCulture)) .Append(',') .Append(order.Making ? '1' : '0') .Append(',') .Append(JobCodec.Escape(order.Detail)); } return stringBuilder.ToString(); } internal static SharedState Parse(string text) { if (string.IsNullOrEmpty(text)) { return null; } string[] array = text.Split(';'); if (array.Length < 5 || array[0] != "S1") { return null; } long.TryParse(array[2], NumberStyles.None, CultureInfo.InvariantCulture, out var result); int.TryParse(array[3], NumberStyles.None, CultureInfo.InvariantCulture, out var result2); int.TryParse(array[4], NumberStyles.None, CultureInfo.InvariantCulture, out var result3); SharedState sharedState = new SharedState { Runner = JobCodec.Unescape(array[1]), Beat = result, Chests = result2, Barrels = result3 }; for (int i = 5; i < array.Length; i++) { if (sharedState.Orders.Count >= 8) { break; } string[] array2 = array[i].Split(','); if (array2.Length != 4) { sharedState.Orders.Add(default(OrderReport)); continue; } int.TryParse(array2[0], NumberStyles.None, CultureInfo.InvariantCulture, out var result4); int.TryParse(array2[1], NumberStyles.None, CultureInfo.InvariantCulture, out var result5); string text2 = JobCodec.Unescape(array2[3]); sharedState.Orders.Add(new OrderReport { Status = result4, Stock = result5, Making = (array2[2] == "1"), Detail = ((text2.Length == 0) ? null : text2) }); } return sharedState; } internal static string ContentKey(SharedState state) { long beat = state.Beat; state.Beat = 0L; string result = Serialize(state); state.Beat = beat; return result; } internal static bool IsFresh(double secondsSinceBeatChanged) { return secondsSinceBeatChanged < 30.0; } internal static bool ShouldPublish(bool changed, double secondsSinceLastWrite) { if (!(secondsSinceLastWrite >= 10.0)) { if (changed) { return secondsSinceLastWrite >= 3.0; } return false; } return true; } internal static RunnerAction Decide(SharedState reported, double secondsSinceBeatChanged, double unreportedSeconds) { if (reported != null) { if (!IsFresh(secondsSinceBeatChanged)) { return RunnerAction.Takeover; } return RunnerAction.Follow; } if (!(unreportedSeconds >= 15.0)) { return RunnerAction.Wait; } return RunnerAction.Takeover; } internal static bool ShouldReclaim(SharedState reported, double secondsUseless, bool localHasChests) { if (reported != null && reported.Chests == 0 && localHasChests) { return secondsUseless >= 15.0; } return false; } } internal static class StationJobs { private sealed class Entry { internal string Raw; internal StationJob Job; } private const string Key = "despr0grammer_autocrafter"; private static readonly Dictionary Cache = new Dictionary(); internal static StationJob Get(CraftingStation station) { ZNetView val = GameAccess.NetViewOf(station); if ((Object)(object)val == (Object)null || !val.IsValid()) { return null; } string text = val.GetZDO().GetString("despr0grammer_autocrafter", string.Empty); int instanceID = ((Object)station).GetInstanceID(); if (Cache.TryGetValue(instanceID, out var value) && value.Raw == text) { return value.Job; } StationJob stationJob = JobCodec.Parse(text); Cache[instanceID] = new Entry { Raw = text, Job = stationJob }; return stationJob; } internal static bool Save(CraftingStation station, StationJob job) { ZNetView val = GameAccess.NetViewOf(station); if ((Object)(object)val == (Object)null || !val.IsValid()) { return false; } ChestAccess.Own(val); string text = JobCodec.Serialize(job); val.GetZDO().Set("despr0grammer_autocrafter", text); Cache[((Object)station).GetInstanceID()] = new Entry { Raw = text, Job = job }; return true; } internal static void Prune(HashSet liveStations) { List list = null; foreach (int key in Cache.Keys) { if (!liveStations.Contains(key)) { (list ?? (list = new List())).Add(key); } } if (list == null) { return; } foreach (int item in list) { Cache.Remove(item); } } } internal static class Text { internal static string Language { get { if (Localization.instance == null) { return string.Empty; } return Localization.instance.GetSelectedLanguage(); } } internal static bool Spanish => Language == "Spanish"; internal static string HoverIdle => T("Crafteo automático", "Auto-crafting"); internal static string HudTitle => T("CRAFTEO AUTOMÁTICO", "AUTO-CRAFTER"); internal static string TabStation => T("MESA", "STATION"); internal static string TabPanel => T("PANEL", "PANEL"); internal static string SaveFailed => T("No se pudo guardar en la mesa", "Could not save to the station"); internal static string StationOn => T("Mesa activa: SÍ", "Station on: YES"); internal static string StationOff => T("Mesa activa: NO", "Station on: NO"); internal static string NoOrders => T("Esta mesa no tiene órdenes. Usa «Añadir receta» para que fabrique algo sola.", "This station has no orders. Use \"Add recipe\" to make it craft on its own."); internal static string AddRecipe => T("+ Añadir receta", "+ Add recipe"); internal static string ListFull => T("La mesa ya tiene el máximo de órdenes", "The station already has the maximum number of orders"); internal static string Done => T("Listo", "Done"); internal static string SearchHint => T("Escribe para buscar. Clic en una receta para añadirla. Solo salen las que ya conoces.", "Type to search. Click a recipe to add it. Only recipes you already know are listed."); internal static string NoRecipes => T("No hay recetas que puedas añadir.", "There are no recipes you can add."); internal static string UnlinkButton => T("Quitar", "Unlink"); internal static string LinkCancelled => T("Vinculación cancelada", "Link cancelled"); internal static string LinkNotStorage => T("Ese no es un cofre de almacenaje; abre otro", "That is not a storage chest; open another one"); internal static string Pause => T("Pausar", "Pause"); internal static string Resume => T("Reanudar", "Resume"); internal static string ReserveLabel => T("Dejar en cofres", "Keep in chests"); internal static string PanelEmpty => T("No hay mesas de trabajo cargadas cerca.", "There are no crafting stations loaded nearby."); internal static string EnableAll => T("Activar todas", "Turn all on"); internal static string DisableAll => T("Apagar todas", "Turn all off"); internal static string Edit => T("Editar", "Edit"); internal static string PanelOn => T("Activa", "On"); internal static string PanelOff => T("Apagada", "Off"); internal static string NoJob => T("Sin órdenes", "No orders"); internal static string HoverJob(int orders, bool enabled) { string text = ((!Spanish) ? ((orders == 1) ? "1 order" : (orders + " orders")) : ((orders == 1) ? "1 orden" : (orders + " órdenes"))); return T("Crafteo automático: " + text, "Auto-crafting: " + text) + (enabled ? string.Empty : T(" (apagado)", " (off)")); } internal static string FooterHint(string key) { return T("Esc o " + key + " para cerrar", "Esc or " + key + " to close"); } internal static string NoStation(string key) { return T("No estás mirando ninguna mesa de trabajo. Mira una y pulsa " + key + ", o elige una en el PANEL.", "You are not looking at a crafting station. Look at one and press " + key + ", or pick one in the PANEL."); } internal static string StationHeader(string name, int level) { return T($"{name} (nivel {level})", $"{name} (level {level})"); } internal static string ChestsInRange(int chests, float radius, int barrels, bool fermenting) { string arg = radius.ToString("0"); string text = T($"Cofres usados en {arg} m: {chests}", $"Chests used within {arg} m: {chests}"); if (!fermenting) { return text; } return text + T($" - Barriles: {barrels}", $" - Barrels: {barrels}"); } internal static string RunBy(string name) { if (!string.IsNullOrEmpty(name)) { return T(" - Lo ejecuta " + name, " - Run by " + name); } return T(" - Lo ejecuta otro jugador", " - Run by another player"); } internal static string FermentLabel(bool on) { if (!on) { return T("Fermentar: NO", "Ferment: NO"); } return T("Fermentar: SÍ", "Ferment: YES"); } internal static string FermentsInto(int produced, string name) { return $"{produced}x {name}"; } internal static string OrderAdded(string name) { return T("Añadida: " + name, "Added: " + name); } internal static string LinkButton(bool linked, bool waiting) { if (waiting) { return T("Cancelar vínculo", "Cancel link"); } if (!linked) { return T("Vincular cofre", "Link chest"); } return T("Cofre vinculado", "Chest linked"); } internal static string LinkHint(string station, string key) { return T("Abre el cofre que quieres vincular a " + station + " (para cancelar: " + key + " y «Cancelar vínculo»)", "Open the chest you want to link to " + station + " (to cancel: " + key + " and \"Cancel link\")"); } internal static string Linked(string station) { return T("Cofre vinculado a " + station, "Chest linked to " + station); } internal static string Unlinked(string station) { return T("Cofre desvinculado de " + station, "Chest unlinked from " + station); } internal static string LinkInfo(bool available, float meters) { if (!available) { return T("Cofre vinculado: no disponible", "Linked chest: not available"); } return T($"Cofre vinculado: a {meters:0} m", $"Linked chest: {meters:0} m away"); } internal static string LinkShort(bool available, float meters) { if (!available) { return T("cofre no disponible", "chest not available"); } return T($"cofre a {meters:0} m", $"chest {meters:0} m away"); } internal static string ModeName(OrderMode mode) { return mode switch { OrderMode.Count => T("Cantidad", "Amount"), OrderMode.Stock => T("Máximo", "Up to max"), _ => T("Sin límite", "No limit"), }; } internal static string CountEndLabel(bool on) { if (!on) { return T("Fermentado: NO", "Fermented: NO"); } return T("Fermentado: SÍ", "Fermented: YES"); } internal static string CapLabel(bool on) { if (!on) { return T("Sin pasarse: NO", "No overshoot: NO"); } return T("Sin pasarse: SÍ", "No overshoot: YES"); } internal static string CraftMissingLabel(bool on) { if (!on) { return T("Fabricar falta: NO", "Make missing: NO"); } return T("Fabricar falta: SÍ", "Make missing: YES"); } internal static string ReserveValue(int reserve) { if (reserve > 0) { return ">= " + reserve; } return T("NO", "OFF"); } internal static string OrderLine(Order order, CraftStatus status, int stock, string detail, bool making) { string text = ((order.Mode == OrderMode.Count) ? $"{order.Done}/{order.Target}" : ((order.Mode == OrderMode.Stock) ? $"{stock}/{order.Target}" : null)); string text2 = StatusText(status, detail, making); if (text != null) { return text + " - " + text2; } return text2; } internal static string StatusText(CraftStatus status, string detail, bool making) { switch (status) { case CraftStatus.Working: if (!making || detail == null) { return T("Fabricando", "Crafting"); } return T("Fabricando ingrediente: ", "Making ingredient: ") + detail; case CraftStatus.Paused: return T("Pausada", "Paused"); case CraftStatus.CountComplete: return T("Completada", "Done"); case CraftStatus.StockReached: return T("Objetivo alcanzado, en pausa", "Goal reached, paused"); case CraftStatus.CapReached: if (detail == null) { return T("Máximo alcanzado", "Maximum reached"); } return T("Máximo alcanzado: otro crafteo sumaría " + detail, "Maximum reached: one more craft adds " + detail); case CraftStatus.MissingRecipe: return T("Esta mesa ya no la fabrica", "This station no longer makes it"); case CraftStatus.UnknownRecipe: return T("No conoces la receta", "Recipe not known"); case CraftStatus.NeedLevel: return T("La mesa necesita más nivel", "Station level too low"); case CraftStatus.NotUsable: return T("La mesa necesita techo o fuego", "The station needs a roof or a fire"); case CraftStatus.NoIngredients: if (detail == null) { return T("Faltan ingredientes", "Missing ingredients"); } return T("Faltan: ", "Missing: ") + detail; case CraftStatus.NoRoom: return T("Sin hueco en los cofres", "No room in the chests"); case CraftStatus.NotOwner: return T("Lo gestiona otro jugador", "Run by another player"); case CraftStatus.Disabled: return T("Mesa apagada", "Station off"); case CraftStatus.ChestUnavailable: return T("El cofre vinculado no está disponible (no cargado, abierto por otro o sin permiso)", "The linked chest is not available (not loaded, open by someone else, no access)"); case CraftStatus.ReserveReached: if (detail == null) { return T("Reserva alcanzada", "Reserve reached"); } return T("Reserva alcanzada: ", "Reserve reached: ") + detail; default: return T("En espera", "Waiting"); } } internal static string Distance(float meters) { return T($"a {meters:0} m", $"{meters:0} m away"); } internal static string Summary(StationSummary summary) { List list = new List(5); list.Add((!Spanish) ? ((summary.Orders == 1) ? "1 order" : (summary.Orders + " orders")) : ((summary.Orders == 1) ? "1 orden" : (summary.Orders + " órdenes"))); Add(list, summary.Working, "fabricando", "crafting"); Add(list, summary.Waiting, "esperando", "waiting"); Add(list, summary.Finished, "terminadas", "finished"); Add(list, summary.Paused, "en pausa", "paused"); return string.Join(", ", list); } private static void Add(List parts, int count, string spanish, string english) { if (count > 0) { parts.Add(count + " " + (Spanish ? spanish : english)); } } private static string T(string spanish, string english) { if (!Spanish) { return english; } return spanish; } } }