using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using Game.Data; using Game.UI; using HarmonyLib; using Il2CppInterop.Runtime; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSystem; using TMPro; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")] [assembly: AssemblyCompany("InfernoProtocol.BetterUI")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.9.5.0")] [assembly: AssemblyInformationalVersion("0.9.5+477d00f8c6e6102e4d9ad948d3169f90685e9781")] [assembly: AssemblyProduct("InfernoProtocol.BetterUI")] [assembly: AssemblyTitle("InfernoProtocol.BetterUI")] [assembly: AssemblyVersion("0.9.5.0")] namespace InfernoProtocol.BetterUI; public sealed class BetterUIController : MonoBehaviour { private readonly CraftingMenuOverhaul _craftingMenu = new CraftingMenuOverhaul(); private float _nextRefresh; private float _retryAt; private bool _sessionEnabled = true; private bool _craftingOpen; private bool _failureReported; public BetterUIController(IntPtr pointer) : base(pointer) { } private void Update() { //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown HandleToggle(); CraftingTableUI instance = MonoSingleton.instance; if (!_sessionEnabled || !BetterUIPlugin.Enabled.Value || !_craftingOpen || (Object)(object)instance == (Object)null) { _craftingMenu.SetVisible(visible: false); return; } _craftingMenu.SetVisible(visible: true); if (_craftingMenu.HandleInput()) { _nextRefresh = 0f; } _craftingMenu.RefreshCraftingProgress(instance); float unscaledTime = Time.unscaledTime; if (unscaledTime < _nextRefresh || unscaledTime < _retryAt) { return; } _nextRefresh = unscaledTime + BetterUIPlugin.RefreshSeconds; try { _craftingMenu.Apply(instance); _retryAt = 0f; _failureReported = false; } catch (Exception ex) { _retryAt = unscaledTime + 2f; if (!_failureReported) { _failureReported = true; ManualLogSource modLog = BetterUIPlugin.ModLog; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(45, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Could not style the crafting menu; retrying: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } modLog.LogWarning(val); } } } private void HandleToggle() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown Keyboard current = Keyboard.current; if (current != null && ((ButtonControl)current.f8Key).wasPressedThisFrame) { _sessionEnabled = !_sessionEnabled; if (!_sessionEnabled) { _craftingMenu.SetVisible(visible: false); } ManualLogSource modLog = BetterUIPlugin.ModLog; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(40, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("BetterUI crafting menu "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(_sessionEnabled ? "enabled" : "paused"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" for this session"); } modLog.LogInfo(val); _nextRefresh = 0f; } } internal void SetCraftingOpen(bool open) { _craftingOpen = open; _nextRefresh = 0f; if (!open) { _craftingMenu.SetVisible(visible: false); } } } [BepInPlugin("com.holden.infernoprotocol.betterui", "BetterUI", "0.9.5")] public sealed class BetterUIPlugin : BasePlugin { [HarmonyPatch] private static class CraftingVisibilityPatches { [HarmonyPostfix] [HarmonyPatch(typeof(CraftingTableUI), "Show")] private static void AfterShow() { SetCraftingOpen(open: true); } [HarmonyPostfix] [HarmonyPatch(typeof(CraftingTableUI), "Hide")] private static void AfterHide() { SetCraftingOpen(open: false); } [HarmonyPostfix] [HarmonyPatch(typeof(CraftingTableUI), "HideRaw")] private static void AfterHideRaw() { SetCraftingOpen(open: false); } } private static BetterUIController _controller; private Harmony _harmony; internal static ManualLogSource ModLog { get; private set; } internal static ConfigEntry Enabled { get; private set; } internal static ConfigEntry RefreshInterval { get; private set; } internal static ConfigEntry ColorPalette { get; private set; } internal static float RefreshSeconds => Sanitize(RefreshInterval.Value, 0.5f, 0.2f, 5f); internal static int PaletteIndex { get { if (ColorPalette == null) { return 0; } return Mathf.Clamp(ColorPalette.Value, 0, 4); } } public override void Load() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown ModLog = ((BasePlugin)this).Log; Enabled = ((BasePlugin)this).Config.Bind("General", "Enabled", true, "Enables the BetterUI crafting menu. F8 pauses or resumes it for the current session."); RefreshInterval = ((BasePlugin)this).Config.Bind("General", "RefreshInterval", 0.5f, new ConfigDescription("Seconds between lightweight crafting-menu state refreshes.", (AcceptableValueBase)(object)new AcceptableValueRange(0.2f, 5f), Array.Empty())); ColorPalette = ((BasePlugin)this).Config.Bind("Crafting", "ColorPalette", 0, new ConfigDescription("Remembered crafting-terminal palette: 0 green, 1 blue, 2 cyan, 3 violet, 4 amber.", (AcceptableValueBase)(object)new AcceptableValueRange(0, 4), Array.Empty())); _controller = ((BasePlugin)this).AddComponent(); _harmony = new Harmony("com.holden.infernoprotocol.betterui"); _harmony.PatchAll(typeof(CraftingVisibilityPatches)); ManualLogSource log = ((BasePlugin)this).Log; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(8, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("BetterUI"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("0.9.5"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" loaded"); } log.LogInfo(val); } public override bool Unload() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } _harmony = null; if ((Object)(object)_controller != (Object)null) { Object.Destroy((Object)(object)_controller); _controller = null; } return true; } internal static void SetCraftingOpen(bool open) { _controller?.SetCraftingOpen(open); } internal static void CyclePalette() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown if (ColorPalette != null) { ColorPalette.Value = (PaletteIndex + 1) % 5; string[] array = new string[5] { "green", "blue", "cyan", "violet", "amber" }; ManualLogSource modLog = ModLog; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(38, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("BetterUI crafting palette changed to "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(array[PaletteIndex]); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("."); } modLog.LogInfo(val); } } private static float Sanitize(float value, float fallback, float minimum, float maximum) { if (!float.IsNaN(value) && !float.IsInfinity(value)) { return Mathf.Clamp(value, minimum, maximum); } return fallback; } } internal enum ButtonVariant { Secondary, Primary, Danger } internal static class BetterUIStyler { internal static Image Surface(RectTransform rect, Color fill, Color border, bool addShadow = true) { //IL_002f: 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) if ((Object)(object)rect == (Object)null) { return null; } Image val = ((Component)rect).GetComponent(); if ((Object)(object)val == (Object)null) { val = ((Component)rect).gameObject.AddComponent(); ((Graphic)val).raycastTarget = false; } RoundedImage(val, fill); Effects((Graphic)(object)val, border, addShadow); return val; } internal static void RoundedImage(Image image, Color color) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)image == (Object)null)) { image.sprite = BetterUITheme.RoundedSprite; image.type = (Type)1; ((Graphic)image).color = color; } } internal static void Tint(Image image, Color color) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)image != (Object)null) { ((Graphic)image).color = color; } } internal static void Effects(Graphic target, Color border, bool addShadow) { //IL_0027: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target == (Object)null) { return; } Outline val = ((Component)target).GetComponent(); if ((Object)(object)val == (Object)null) { val = ((Component)target).gameObject.AddComponent(); } ((Shadow)val).effectColor = border; ((Shadow)val).effectDistance = new Vector2(1.25f, -1.25f); ((Shadow)val).useGraphicAlpha = true; Shadow val2 = null; Il2CppArrayBase components = ((Component)target).GetComponents(); for (int i = 0; i < components.Length; i++) { Shadow val3 = components[i]; if ((Object)(object)val3 != (Object)null && (Object)(object)((Il2CppObjectBase)val3).TryCast() == (Object)null) { val2 = val3; break; } } if (!addShadow) { if ((Object)(object)val2 != (Object)null && ColorsMatch(val2.effectColor, BetterUITheme.Shadow)) { ((Behaviour)val2).enabled = false; } return; } if ((Object)(object)val2 == (Object)null) { val2 = ((Component)target).gameObject.AddComponent(); } ((Behaviour)val2).enabled = true; val2.effectColor = BetterUITheme.Shadow; val2.effectDistance = new Vector2(0f, -4f); val2.useGraphicAlpha = true; } private static bool ColorsMatch(Color left, Color right) { //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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_004b: 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) if (Mathf.Abs(left.r - right.r) < 0.002f && Mathf.Abs(left.g - right.g) < 0.002f && Mathf.Abs(left.b - right.b) < 0.002f) { return Mathf.Abs(left.a - right.a) < 0.002f; } return false; } internal static void Text(TMP_Text text, float size, Color color, FontStyles style, bool preserveSize = false) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)text == (Object)null)) { text.enableAutoSizing = false; if (!preserveSize) { text.fontSize = size; } ((Graphic)text).color = color; text.fontStyle = style; ((Graphic)text).raycastTarget = false; } } internal static void Heading(TMP_Text text, float size) { //IL_0002: 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) Text(text, size, BetterUITheme.Text, (FontStyles)1); if (!((Object)(object)text == (Object)null)) { text.characterSpacing = 2.2f; text.outlineWidth = 0.12f; text.outlineColor = new Color32((byte)0, (byte)0, (byte)0, (byte)190); } } internal static void Button(MazeButton button, ButtonVariant variant) { //IL_0019: 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_002d: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_00c9: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)button == (Object)null) { return; } Color val = default(Color); Color slotHover = default(Color); Color border; Color val2; switch (variant) { case ButtonVariant.Primary: ((Color)(ref val))..ctor(BetterUITheme.Primary.r, BetterUITheme.Primary.g, BetterUITheme.Primary.b, 0.18f); ((Color)(ref slotHover))..ctor(BetterUITheme.PrimaryHover.r, BetterUITheme.PrimaryHover.g, BetterUITheme.PrimaryHover.b, 0.34f); border = BetterUITheme.Primary; val2 = BetterUITheme.PrimaryHover; break; case ButtonVariant.Danger: val = BetterUITheme.DangerSoft; ((Color)(ref slotHover))..ctor(BetterUITheme.Danger.r, BetterUITheme.Danger.g, BetterUITheme.Danger.b, 0.34f); border = BetterUITheme.Danger; val2 = BetterUITheme.Text; break; default: val = BetterUITheme.PanelSoft; slotHover = BetterUITheme.SlotHover; border = BetterUITheme.Border; val2 = BetterUITheme.TextMuted; break; } button.backgroundColor = val; button.hoverColor = slotHover; button.textColor = val2; button.hoverTextColor = BetterUITheme.Text; Graphic backgroundImage = button.backgroundImage; Image val3 = (((Object)(object)backgroundImage != (Object)null) ? ((Il2CppObjectBase)backgroundImage).TryCast() : null); if ((Object)(object)val3 != (Object)null) { RoundedImage(val3, val); Effects((Graphic)(object)val3, border, addShadow: false); Outline component = ((Component)val3).GetComponent(); if ((Object)(object)component != (Object)null) { ((Shadow)component).effectDistance = new Vector2(0.65f, -0.65f); } } if ((Object)(object)button.buttonText != (Object)null) { Text((TMP_Text)(object)button.buttonText, Mathf.Max(15f, ((TMP_Text)button.buttonText).fontSize), val2, (FontStyles)1); ((TMP_Text)button.buttonText).characterSpacing = 0.8f; } LayoutElement val4 = ((Component)button).GetComponent(); if ((Object)(object)val4 == (Object)null) { val4 = ((Component)button).gameObject.AddComponent(); } val4.minHeight = 42f; button.UpdateVisualState(true); } internal static void ToggleButton(MazeButton button, bool active) { //IL_0014: 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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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_0044: 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_0049: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)button == (Object)null) { return; } Color val = (active ? BetterUITheme.AccentSoft : BetterUITheme.PanelSoft); Color hoverColor = (active ? BetterUITheme.CraftingSelectedHover : BetterUITheme.SlotHover); Color border = (active ? BetterUITheme.Accent : BetterUITheme.BorderSoft); Color val2 = (active ? BetterUITheme.Text : BetterUITheme.TextMuted); button.backgroundColor = val; button.hoverColor = hoverColor; button.textColor = val2; button.hoverTextColor = BetterUITheme.Text; Graphic backgroundImage = button.backgroundImage; Image val3 = (((Object)(object)backgroundImage != (Object)null) ? ((Il2CppObjectBase)backgroundImage).TryCast() : null); if ((Object)(object)val3 != (Object)null) { RoundedImage(val3, val); Effects((Graphic)(object)val3, border, addShadow: false); Outline component = ((Component)val3).GetComponent(); if ((Object)(object)component != (Object)null) { ((Shadow)component).effectDistance = new Vector2(0.65f, -0.65f); } } if ((Object)(object)button.buttonText != (Object)null) { Text((TMP_Text)(object)button.buttonText, 14f, val2, (FontStyles)1); ((TMP_Text)button.buttonText).characterSpacing = 0.5f; } } internal static void InputField(TMP_InputField input) { //IL_003c: 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)input == (Object)null)) { Image component = ((Component)input).GetComponent(); if ((Object)(object)component != (Object)null) { RoundedImage(component, BetterUITheme.PanelElevated); Effects((Graphic)(object)component, BetterUITheme.Border, addShadow: false); } Text(input.textComponent, 16f, BetterUITheme.Text, (FontStyles)0); Text(((Object)(object)input.placeholder != (Object)null) ? ((Il2CppObjectBase)input.placeholder).TryCast() : null, 16f, BetterUITheme.TextDim, (FontStyles)2); input.selectionColor = BetterUITheme.AccentSoft; input.caretColor = BetterUITheme.Accent; input.caretWidth = 2; } } internal static void Scrollbars(Transform root) { //IL_003e: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_00b5: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)root == (Object)null) { return; } Il2CppArrayBase componentsInChildren = ((Component)root).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Scrollbar val = componentsInChildren[i]; if (!((Object)(object)val == (Object)null)) { Image component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { RoundedImage(component, new Color(BetterUITheme.PanelSoft.r, BetterUITheme.PanelSoft.g, BetterUITheme.PanelSoft.b, 0.62f)); } Image val2 = (((Object)(object)val.handleRect != (Object)null) ? ((Component)val.handleRect).GetComponent() : null); if ((Object)(object)val2 != (Object)null) { RoundedImage(val2, BetterUITheme.Accent); Effects((Graphic)(object)val2, new Color(1f, 1f, 1f, 0.24f), addShadow: false); } ColorBlock colors = ((Selectable)val).colors; ((ColorBlock)(ref colors)).normalColor = BetterUITheme.TextMuted; ((ColorBlock)(ref colors)).highlightedColor = BetterUITheme.Text; ((ColorBlock)(ref colors)).pressedColor = BetterUITheme.Accent; ((ColorBlock)(ref colors)).disabledColor = BetterUITheme.TextDim; ((ColorBlock)(ref colors)).fadeDuration = 0.08f; ((Selectable)val).colors = colors; } } } internal static ButtonVariant ClassifyButton(MazeButton button) { string text = (((Object)(object)button != (Object)null && (Object)(object)button.buttonText != (Object)null) ? ((TMP_Text)button.buttonText).text.ToUpperInvariant() : string.Empty); if (text.Contains("CLOSE") || text.Contains("DROP") || text.Contains("REMOVE") || text.Contains("DELETE")) { return ButtonVariant.Danger; } if (text.Contains("CRAFT") || text.Contains("PACK") || text.Contains("CONFIRM") || text.Contains("APPLY") || text.Contains("PLACE")) { return ButtonVariant.Primary; } return ButtonVariant.Secondary; } } internal static class BetterUITheme { private sealed class Palette { internal Color Scrim; internal Color Panel; internal Color PanelElevated; internal Color PanelSoft; internal Color CraftingCanvas; internal Color CraftingWell; internal Color CraftingReady; internal Color CraftingSelected; internal Color CraftingSelectedHover; internal Color Slot; internal Color SlotHover; internal Color SlotSelected; internal Color Border; internal Color BorderSoft; internal Color CardBorder; internal Color Accent; internal Color AccentSoft; internal Color Primary; internal Color PrimaryHover; internal Color PrimarySoft; internal Color Success; internal Color SuccessSoft; internal Color Text; internal Color TextMuted; internal Color TextUnavailable; internal Color TextDim; internal Color Shadow; } internal const int PaletteCount = 5; internal static readonly Color Danger = Hex("FFB45C", 1f); internal static readonly Color DangerSoft = Hex("FFB45C", 0.18f); internal static readonly Color CountBackground = Hex("010302", 0.94f); private static readonly Texture2D[] CategoryIcons = (Texture2D[])(object)new Texture2D[5]; private static int _cachedPaletteIndex = -1; private static Palette _current; private static Sprite _roundedSprite; private static Texture2D _scanlineTexture; private static Texture2D _colorWheelTexture; internal static Color Scrim => Current.Scrim; internal static Color Panel => Current.Panel; internal static Color PanelElevated => Current.PanelElevated; internal static Color PanelSoft => Current.PanelSoft; internal static Color CraftingCanvas => Current.CraftingCanvas; internal static Color CraftingWell => Current.CraftingWell; internal static Color CraftingReady => Current.CraftingReady; internal static Color CraftingSelected => Current.CraftingSelected; internal static Color CraftingSelectedHover => Current.CraftingSelectedHover; internal static Color Slot => Current.Slot; internal static Color SlotHover => Current.SlotHover; internal static Color SlotSelected => Current.SlotSelected; internal static Color Border => Current.Border; internal static Color BorderSoft => Current.BorderSoft; internal static Color CardBorder => Current.CardBorder; internal static Color Accent => Current.Accent; internal static Color AccentSoft => Current.AccentSoft; internal static Color Primary => Current.Primary; internal static Color PrimaryHover => Current.PrimaryHover; internal static Color PrimarySoft => Current.PrimarySoft; internal static Color Success => Current.Success; internal static Color SuccessSoft => Current.SuccessSoft; internal static Color Text => Current.Text; internal static Color TextMuted => Current.TextMuted; internal static Color TextUnavailable => Current.TextUnavailable; internal static Color TextDim => Current.TextDim; internal static Color Shadow => Current.Shadow; private static Palette Current { get { int paletteIndex = BetterUIPlugin.PaletteIndex; if (_current == null || _cachedPaletteIndex != paletteIndex) { _cachedPaletteIndex = paletteIndex; _current = BuildPalette(paletteIndex); } return _current; } } internal static Texture2D ScanlineTexture { get { if ((Object)(object)_scanlineTexture == (Object)null) { _scanlineTexture = CreateScanlineTexture(); } return _scanlineTexture; } } internal static Texture2D ColorWheelTexture { get { if ((Object)(object)_colorWheelTexture == (Object)null) { _colorWheelTexture = CreateColorWheelTexture(); } return _colorWheelTexture; } } internal static Sprite RoundedSprite { get { if ((Object)(object)_roundedSprite == (Object)null) { _roundedSprite = CreateRoundedSprite(); } return _roundedSprite; } } internal static Texture2D GetCategoryIconTexture(string label) { string text = label?.ToUpperInvariant() ?? string.Empty; int num = ((!text.Contains("WEAPON") && !text.Contains("COMBAT")) ? ((text.Contains("MED") || text.Contains("HEALTH")) ? 1 : ((text.Contains("TOOL") || text.Contains("FOOD")) ? 2 : (text.Contains("CLOTH") ? 3 : 4))) : 0); if ((Object)(object)CategoryIcons[num] == (Object)null) { CategoryIcons[num] = CreateCategoryIcon(num); } return CategoryIcons[num]; } private static Palette BuildPalette(int index) { //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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_010a: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: 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) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) float shift = Mathf.Clamp(index, 0, 4) switch { 1 => 0.25f, 2 => 0.13f, 3 => 0.43f, 4 => -0.23f, _ => 0f, }; return new Palette { Scrim = ShiftedHex("020704", 0.72f, shift), Panel = ShiftedHex("040C07", 0.88f, shift), PanelElevated = ShiftedHex("08140C", 0.9f, shift), PanelSoft = ShiftedHex("0C2113", 0.86f, shift), CraftingCanvas = ShiftedHex("020805", 0.8f, shift), CraftingWell = ShiftedHex("010403", 0.84f, shift), CraftingReady = ShiftedHex("07190C", 0.9f, shift), CraftingSelected = ShiftedHex("103A1C", 1f, shift), CraftingSelectedHover = ShiftedHex("165326", 1f, shift), Slot = ShiftedHex("07130B", 0.99f, shift), SlotHover = ShiftedHex("102B18", 1f, shift), SlotSelected = ShiftedHex("174923", 1f, shift), Border = ShiftedHex("2D6B3B", 0.9f, shift), BorderSoft = ShiftedHex("1C4327", 0.76f, shift), CardBorder = ShiftedHex("16331E", 0.68f, shift), Accent = ShiftedHex("6DFF83", 1f, shift), AccentSoft = ShiftedHex("6DFF83", 0.2f, shift), Primary = ShiftedHex("B8FF78", 1f, shift), PrimaryHover = ShiftedHex("DFFF9D", 1f, shift), PrimarySoft = ShiftedHex("B8FF78", 0.15f, shift), Success = ShiftedHex("66E97A", 1f, shift), SuccessSoft = ShiftedHex("66E97A", 0.18f, shift), Text = ShiftedHex("D9FFD7", 1f, shift), TextMuted = ShiftedHex("8FBC91", 1f, shift), TextUnavailable = ShiftedHex("688B6C", 1f, shift), TextDim = ShiftedHex("4F7556", 1f, shift), Shadow = ShiftedHex("000D03", 0.66f, shift) }; } private static Color ShiftedHex(string hex, float alpha, float shift) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_0041: 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) Color val = Hex(hex, alpha); if (Mathf.Abs(shift) < 0.001f) { return val; } float num = default(float); float num2 = default(float); float num3 = default(float); Color.RGBToHSV(val, ref num, ref num2, ref num3); Color result = Color.HSVToRGB(Mathf.Repeat(num + shift, 1f), num2, num3); result.a = alpha; return result; } private static Sprite CreateRoundedSprite() { //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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_0121: 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_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(64, 64, (TextureFormat)4, false) { name = "BetterUI_RoundedSurface", filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1, hideFlags = (HideFlags)61 }; Color32[] array = (Color32[])(object)new Color32[4096]; for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { float num = Mathf.Clamp((float)j + 0.5f, 13f, 51f); float num2 = Mathf.Clamp((float)i + 0.5f, 13f, 51f); float num3 = Vector2.Distance(new Vector2((float)j + 0.5f, (float)i + 0.5f), new Vector2(num, num2)); byte b = (byte)Mathf.RoundToInt(Mathf.Clamp01(13.75f - num3) * 255f); array[i * 64 + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, b); } } val.SetPixels32(Il2CppStructArray.op_Implicit(array)); val.Apply(false, true); Object.DontDestroyOnLoad((Object)(object)val); Sprite obj = Sprite.Create(val, new Rect(0f, 0f, 64f, 64f), new Vector2(0.5f, 0.5f), 100f, 0u, (SpriteMeshType)0, new Vector4(16f, 16f, 16f, 16f)); ((Object)obj).name = "BetterUI_RoundedSurfaceSprite"; ((Object)obj).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)(object)obj); return obj; } private static Texture2D CreateScanlineTexture() { //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_0014: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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) //IL_008a: 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_0092: 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) Texture2D val = new Texture2D(2, 4, (TextureFormat)4, false) { name = "BetterUI_TerminalScanlines", filterMode = (FilterMode)0, wrapMode = (TextureWrapMode)0, hideFlags = (HideFlags)61 }; Color32 val2 = default(Color32); ((Color32)(ref val2))..ctor(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)0); Color32 val3 = default(Color32); ((Color32)(ref val3))..ctor((byte)0, (byte)0, (byte)0, byte.MaxValue); val.SetPixels32(Il2CppStructArray.op_Implicit((Color32[])(object)new Color32[8] { val2, val2, val2, val2, val3, val3, val2, val2 })); val.Apply(false, true); Object.DontDestroyOnLoad((Object)(object)val); return val; } private static Texture2D CreateColorWheelTexture() { //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) //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) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_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) Texture2D val = NewIconTexture("BetterUI_ColorWheel", 32); Color32[] array = (Color32[])(object)new Color32[1024]; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(15.5f, 15.5f); for (int i = 0; i < 32; i++) { for (int j = 0; j < 32; j++) { Vector2 val3 = new Vector2((float)j, (float)i) - val2; float magnitude = ((Vector2)(ref val3)).magnitude; if (magnitude < 7f || magnitude > 14.5f) { array[i * 32 + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)0); continue; } float num = Mathf.Repeat(Mathf.Atan2(val3.y, val3.x) / ((float)Math.PI * 2f), 1f); array[i * 32 + j] = Color32.op_Implicit(Color.HSVToRGB(num, 0.86f, 1f)); } } val.SetPixels32(Il2CppStructArray.op_Implicit(array)); val.Apply(false, true); Object.DontDestroyOnLoad((Object)(object)val); return val; } private static Texture2D CreateCategoryIcon(int iconIndex) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_00fa: 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_012b: 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_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) Texture2D val = NewIconTexture($"BetterUI_CategoryIcon_{iconIndex}", 32); Color32[] array = (Color32[])(object)new Color32[1024]; Color32 color = default(Color32); ((Color32)(ref color))..ctor(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue); switch (iconIndex) { case 0: DrawLine(array, 32, 7, 6, 25, 25, 2, color); DrawLine(array, 32, 25, 6, 7, 25, 2, color); break; case 1: FillRect(array, 32, 13, 5, 19, 27, color); FillRect(array, 32, 5, 13, 27, 19, color); break; case 2: DrawLine(array, 32, 9, 25, 21, 11, 3, color); FillRect(array, 32, 15, 6, 27, 12, color); break; case 3: FillRect(array, 32, 10, 10, 22, 27, color); FillRect(array, 32, 5, 10, 12, 17, color); FillRect(array, 32, 20, 10, 27, 17, color); FillRect(array, 32, 13, 7, 19, 12, new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)0)); break; default: FillRect(array, 32, 6, 6, 13, 13, color); FillRect(array, 32, 19, 6, 26, 13, color); FillRect(array, 32, 6, 19, 13, 26, color); FillRect(array, 32, 19, 19, 26, 26, color); break; } val.SetPixels32(Il2CppStructArray.op_Implicit(array)); val.Apply(false, true); Object.DontDestroyOnLoad((Object)(object)val); return val; } private static Texture2D NewIconTexture(string name, int size) { //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_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown return new Texture2D(size, size, (TextureFormat)4, false) { name = name, filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1, hideFlags = (HideFlags)61 }; } private static void FillRect(Color32[] pixels, int size, int left, int bottom, int right, int top, Color32 color) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) for (int i = Mathf.Max(0, bottom); i < Mathf.Min(size, top); i++) { for (int j = Mathf.Max(0, left); j < Mathf.Min(size, right); j++) { pixels[i * size + j] = color; } } } private static void DrawLine(Color32[] pixels, int size, int startX, int startY, int endX, int endY, int thickness, Color32 color) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.Max(Mathf.Abs(endX - startX), Mathf.Abs(endY - startY)); for (int i = 0; i <= num; i++) { float num2 = ((num > 0) ? ((float)i / (float)num) : 0f); int num3 = Mathf.RoundToInt(Mathf.Lerp((float)startX, (float)endX, num2)); int num4 = Mathf.RoundToInt(Mathf.Lerp((float)startY, (float)endY, num2)); FillRect(pixels, size, num3 - thickness, num4 - thickness, num3 + thickness + 1, num4 + thickness + 1, color); } } private static Color Hex(string hex, float alpha) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) Color result = default(Color); ColorUtility.TryParseHtmlString("#" + hex, ref result); result.a = alpha; return result; } } internal sealed class CraftingMenuBuilder { private int _builtForRootId; internal GameObject ReplacementRoot { get; private set; } internal void Build(CraftingTableUI crafting) { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)crafting == (Object)null || _builtForRootId == ((Object)crafting).GetInstanceID()) { return; } Transform transform = ((Component)crafting).transform; Canvas componentInParent = ((Component)crafting).GetComponentInParent(); Canvas val = (((Object)(object)componentInParent != (Object)null) ? componentInParent.rootCanvas : null); Transform parent = (((Object)(object)val != (Object)null) ? ((Component)val).transform : (((Object)(object)componentInParent != (Object)null) ? ((Component)componentInParent).transform : transform)); List list = new List(); for (int i = 0; i < transform.childCount; i++) { list.Add(transform.GetChild(i)); } RectTransform root = CreateSurface("BetterUI_CraftingMenu", parent, BetterUITheme.CraftingCanvas); root.anchorMin = new Vector2(0.035f, 0.055f); root.anchorMax = new Vector2(0.965f, 0.945f); root.offsetMin = Vector2.zero; root.offsetMax = Vector2.zero; ((Transform)root).SetAsLastSibling(); ReplacementRoot = ((Component)root).gameObject; BetterUIStyler.Effects((Graphic)(object)((Component)root).GetComponent(), BetterUITheme.Accent, addShadow: true); RectTransform header = CreateSurface("BetterUI_Header", (Transform)(object)root, BetterUITheme.Panel); AnchorTop(header, 84f, 0f, 0f); HorizontalLayoutGroup obj = ((Component)header).gameObject.AddComponent(); ((LayoutGroup)obj).padding = Padding(20, 20, 12, 12); ((HorizontalOrVerticalLayoutGroup)obj).spacing = 12f; ((LayoutGroup)obj).childAlignment = (TextAnchor)4; ((HorizontalOrVerticalLayoutGroup)obj).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)obj).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)obj).childForceExpandWidth = false; ((HorizontalOrVerticalLayoutGroup)obj).childForceExpandHeight = false; RectTransform val2 = CreateRect("BetterUI_Body", (Transform)(object)root); val2.anchorMin = Vector2.zero; val2.anchorMax = Vector2.one; val2.offsetMin = new Vector2(14f, 64f); val2.offsetMax = new Vector2(-14f, -98f); RectTransform categoriesPanel = CreateSurface("BetterUI_Categories", (Transform)(object)val2, BetterUITheme.PanelElevated); categoriesPanel.anchorMin = Vector2.zero; categoriesPanel.anchorMax = new Vector2(0.18f, 1f); categoriesPanel.offsetMin = Vector2.zero; categoriesPanel.offsetMax = Vector2.zero; RectTransform browserPanel = CreateSurface("BetterUI_RecipeBrowser", (Transform)(object)val2, BetterUITheme.Panel); browserPanel.anchorMin = new Vector2(0.192f, 0f); browserPanel.anchorMax = new Vector2(0.585f, 1f); browserPanel.offsetMin = Vector2.zero; browserPanel.offsetMax = Vector2.zero; RectTransform detailsPanel = CreateSurface("BetterUI_Details", (Transform)(object)val2, BetterUITheme.PanelElevated); detailsPanel.anchorMin = new Vector2(0.597f, 0f); detailsPanel.anchorMax = Vector2.one; detailsPanel.offsetMin = Vector2.zero; detailsPanel.offsetMax = Vector2.zero; BuildSection("header", delegate { BuildHeader(crafting, header); }); BuildSection("classification rail", delegate { BuildCategories(crafting, categoriesPanel); }); BuildSection("schematic index", delegate { BuildBrowser(crafting, browserPanel); }); BuildSection("inspection workspace", delegate { BuildDetails(crafting, detailsPanel); }); BuildSection("command footer", delegate { BuildFooter(crafting, root); }); int instanceID = ((Object)transform).GetInstanceID(); for (int num = 0; num < list.Count; num++) { Transform val3 = list[num]; if ((Object)(object)val3 != (Object)null && (Object)(object)val3.parent != (Object)null && ((Object)val3.parent).GetInstanceID() == instanceID) { ((Component)val3).gameObject.SetActive(false); } } ((Component)root).gameObject.SetActive(true); _builtForRootId = ((Object)crafting).GetInstanceID(); BetterUIPlugin.ModLog.LogInfo((object)"Built replacement terminal-workbench crafting hierarchy."); } private static void BuildCategories(CraftingTableUI crafting, RectTransform categoriesPanel) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) VerticalLayoutGroup obj = ((Component)categoriesPanel).gameObject.AddComponent(); ((LayoutGroup)obj).padding = Padding(12, 12, 16, 12); ((HorizontalOrVerticalLayoutGroup)obj).spacing = 8f; ((LayoutGroup)obj).childAlignment = (TextAnchor)1; ((HorizontalOrVerticalLayoutGroup)obj).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)obj).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)obj).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)obj).childForceExpandHeight = false; TextMeshProUGUI obj2 = CreateLabel("BetterUI_CategoriesHeading", (Transform)(object)categoriesPanel, crafting._titleTMP); ((TMP_Text)obj2).text = "CLASSIFICATION"; ((TMP_Text)obj2).fontSize = 13f; ((TMP_Text)obj2).fontStyle = (FontStyles)1; ((Graphic)obj2).color = BetterUITheme.TextMuted; ((TMP_Text)obj2).characterSpacing = 1.6f; ((TMP_Text)obj2).alignment = (TextAlignmentOptions)4097; SetLayout(((Component)obj2).gameObject, 0f, 0f, 1f, 26f, 26f, 0f); List list = new List { crafting.filterMiscButton, crafting.filterCombatButton, crafting.filterFoodButton, crafting.filterHealthyButton, crafting.filterClothingButton }; list.Sort(CompareFilterButtons); for (int i = 0; i < list.Count; i++) { MazeButton val = list[i]; if (!((Object)(object)val == (Object)null)) { MoveToLayout(((Component)val).transform, (Transform)(object)categoriesPanel, 0f, 0f, 1f); SetLayout(((Component)val).gameObject, 0f, 0f, 1f, 48f, 48f, 0f); if ((Object)(object)val.buttonText != (Object)null) { ((TMP_Text)val.buttonText).alignment = (TextAlignmentOptions)4097; ((TMP_Text)val.buttonText).margin = new Vector4(42f, 0f, 8f, 0f); } } } TextMeshProUGUI obj3 = CreateLabel("BetterUI_FilterStatus", (Transform)(object)categoriesPanel, crafting._titleTMP); ((TMP_Text)obj3).text = "// LIVE INDEX\n// LOCAL CACHE"; ((TMP_Text)obj3).fontSize = 11f; ((TMP_Text)obj3).fontStyle = (FontStyles)0; ((Graphic)obj3).color = BetterUITheme.TextDim; ((TMP_Text)obj3).characterSpacing = 1.2f; ((TMP_Text)obj3).alignment = (TextAlignmentOptions)1025; SetLayout(((Component)obj3).gameObject, 0f, 0f, 1f, 48f, 0f, 1f); } private static void BuildBrowser(CraftingTableUI crafting, RectTransform browserPanel) { //IL_0006: 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_008f: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: 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_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0271: 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_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) RectTransform val = CreateSurface("BetterUI_RecipeHeader", (Transform)(object)browserPanel, BetterUITheme.PanelElevated); AnchorTop(val, 94f, 8f, 8f); TextMeshProUGUI obj = CreateLabel("BetterUI_RecipeHeading", (Transform)(object)val, crafting._titleTMP); ((TMP_Text)obj).text = "SCHEMATIC INDEX"; ((TMP_Text)obj).fontSize = 13f; ((TMP_Text)obj).fontStyle = (FontStyles)1; ((Graphic)obj).color = BetterUITheme.TextMuted; ((TMP_Text)obj).characterSpacing = 1.5f; ((TMP_Text)obj).alignment = (TextAlignmentOptions)4097; RectTransform component = ((Component)obj).GetComponent(); if ((Object)(object)component != (Object)null) { component.anchorMin = new Vector2(0f, 0.5f); component.anchorMax = Vector2.one; component.offsetMin = new Vector2(12f, 0f); component.offsetMax = new Vector2(-12f, 0f); } if ((Object)(object)crafting._searchInputField != (Object)null) { RectTransform component2 = ((Component)crafting._searchInputField).GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Transform)component2).SetParent((Transform)(object)val, false); NormalizeRect(component2); component2.anchorMin = Vector2.zero; component2.anchorMax = new Vector2(1f, 0.5f); component2.offsetMin = new Vector2(10f, 8f); component2.offsetMax = new Vector2(-10f, -4f); LayoutElement component3 = ((Component)component2).GetComponent(); if ((Object)(object)component3 != (Object)null) { component3.ignoreLayout = true; } } } RectTransform val2 = CreateSurface("BetterUI_RecipeScroll", (Transform)(object)browserPanel, BetterUITheme.CraftingWell); val2.anchorMin = Vector2.zero; val2.anchorMax = Vector2.one; val2.offsetMin = new Vector2(8f, 8f); val2.offsetMax = new Vector2(-8f, -102f); RectTransform val3 = CreateSurface("Viewport", (Transform)(object)val2, BetterUITheme.CraftingWell); val3.anchorMin = Vector2.zero; val3.anchorMax = Vector2.one; val3.offsetMin = new Vector2(8f, 8f); val3.offsetMax = new Vector2(-22f, -8f); ((Graphic)((Component)val3).GetComponent()).raycastTarget = true; ((Component)val3).gameObject.AddComponent().showMaskGraphic = true; Transform craftingRecipesContainer = CraftingTableUI.craftingRecipesContainer; RectTransform val4 = (((Object)(object)craftingRecipesContainer != (Object)null) ? ((Component)craftingRecipesContainer).GetComponent() : null); if ((Object)(object)val4 != (Object)null) { ((Transform)val4).SetParent((Transform)(object)val3, false); NormalizeRect(val4); val4.anchorMin = new Vector2(0f, 1f); val4.anchorMax = new Vector2(1f, 1f); val4.pivot = new Vector2(0.5f, 1f); val4.anchoredPosition = Vector2.zero; val4.sizeDelta = new Vector2(0f, val4.sizeDelta.y); } Scrollbar verticalScrollbar = CreateScrollbar(val2); ScrollRect obj2 = ((Component)val2).gameObject.AddComponent(); obj2.content = val4; obj2.viewport = val3; obj2.horizontal = false; obj2.vertical = true; obj2.movementType = (MovementType)2; obj2.inertia = true; obj2.decelerationRate = 0.12f; obj2.scrollSensitivity = 34f; obj2.verticalScrollbar = verticalScrollbar; obj2.verticalScrollbarVisibility = (ScrollbarVisibility)2; obj2.verticalScrollbarSpacing = 4f; } private static void BuildHeader(CraftingTableUI crafting, RectTransform header) { //IL_00c0: 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) if ((Object)(object)crafting._titleTMP != (Object)null) { ((TMP_Text)crafting._titleTMP).text = "WORKBENCH // FABRICATION"; ((TMP_Text)crafting._titleTMP).alignment = (TextAlignmentOptions)4097; ((TMP_Text)crafting._titleTMP).margin = Vector4.zero; MoveToLayout(((TMP_Text)crafting._titleTMP).transform, (Transform)(object)header, 220f, 420f, 1f); } SetLayout(((Component)CreateRect("BetterUI_HeaderSpacer", (Transform)(object)header)).gameObject, 0f, 0f, 1f, 1f, 1f, 0f); TextMeshProUGUI obj = CreateLabel("BetterUI_StationStatus", (Transform)(object)header, crafting._titleTMP); ((TMP_Text)obj).text = "STN-04 // ONLINE\nLOCAL FABRICATION NETWORK"; ((TMP_Text)obj).fontSize = 11f; ((TMP_Text)obj).fontStyle = (FontStyles)1; ((Graphic)obj).color = BetterUITheme.Accent; ((TMP_Text)obj).characterSpacing = 1.4f; ((TMP_Text)obj).alignment = (TextAlignmentOptions)4100; SetLayout(((Component)obj).gameObject, 150f, 220f, 0f, 48f, 48f, 0f); } private static void BuildFooter(CraftingTableUI crafting, RectTransform root) { //IL_0006: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) RectTransform val = CreateSurface("BetterUI_CommandFooter", (Transform)(object)root, BetterUITheme.Panel); val.anchorMin = Vector2.zero; val.anchorMax = new Vector2(1f, 0f); val.pivot = new Vector2(0.5f, 0f); val.offsetMin = Vector2.zero; val.offsetMax = new Vector2(0f, 52f); HorizontalLayoutGroup obj = ((Component)val).gameObject.AddComponent(); ((LayoutGroup)obj).padding = Padding(18, 18, 7, 7); ((HorizontalOrVerticalLayoutGroup)obj).spacing = 10f; ((LayoutGroup)obj).childAlignment = (TextAnchor)4; ((HorizontalOrVerticalLayoutGroup)obj).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)obj).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)obj).childForceExpandWidth = false; ((HorizontalOrVerticalLayoutGroup)obj).childForceExpandHeight = false; AddFooterPrompt((Transform)(object)val, crafting._titleTMP, "[ LMB ] SELECT", 150f); AddFooterPrompt((Transform)(object)val, crafting._titleTMP, "[ WHEEL ] SCROLL", 165f); SetLayout(((Component)CreateRect("BetterUI_FooterSpacer", (Transform)(object)val)).gameObject, 0f, 0f, 1f, 1f, 1f, 0f); BuildThemeButton(val); if ((Object)(object)crafting._hideUncraftableButton != (Object)null) { MoveToLayout(((Component)crafting._hideUncraftableButton).transform, (Transform)(object)val, 42f, 46f, 0f); } MazeButton val2 = FindButton(((Component)crafting).transform, "CLOSE"); if ((Object)(object)val2 != (Object)null) { if ((Object)(object)val2.buttonText != (Object)null) { ((TMP_Text)val2.buttonText).text = "[ ESC ] EXIT"; } MoveToLayout(((Component)val2).transform, (Transform)(object)val, 138f, 154f, 0f); StyleFlatButton(val2, BetterUITheme.PanelSoft, BetterUITheme.Border, BetterUITheme.TextMuted); } } private static void BuildThemeButton(RectTransform footer) { //IL_0006: 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_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) //IL_008f: 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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) RectTransform val = CreateSurface("BetterUI_ThemeButton", (Transform)(object)footer, BetterUITheme.PanelSoft); SetLayout(((Component)val).gameObject, 42f, 46f, 0f, 38f, 38f, 0f); Image component = ((Component)val).GetComponent(); ((Graphic)component).raycastTarget = true; BetterUIStyler.Effects((Graphic)(object)component, BetterUITheme.Border, addShadow: false); GameObject val2 = new GameObject("BetterUI_ColorWheelIcon", (Type[])(object)new Type[4] { Il2CppType.Of(), Il2CppType.Of(), Il2CppType.Of(), Il2CppType.Of() }); val2.transform.SetParent((Transform)(object)val, false); RectTransform component2 = val2.GetComponent(); component2.anchorMin = new Vector2(0.5f, 0.5f); component2.anchorMax = new Vector2(0.5f, 0.5f); component2.pivot = new Vector2(0.5f, 0.5f); component2.anchoredPosition = Vector2.zero; component2.sizeDelta = new Vector2(26f, 26f); val2.GetComponent().ignoreLayout = true; RawImage component3 = val2.GetComponent(); component3.texture = (Texture)(object)BetterUITheme.ColorWheelTexture; ((Graphic)component3).color = Color.white; ((Graphic)component3).raycastTarget = false; } private static void AddFooterPrompt(Transform footer, TextMeshProUGUI template, string value, float width) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) TextMeshProUGUI obj = CreateLabel("BetterUI_CommandPrompt", footer, template); ((TMP_Text)obj).text = value; ((TMP_Text)obj).fontSize = 12f; ((TMP_Text)obj).fontStyle = (FontStyles)1; ((Graphic)obj).color = BetterUITheme.TextMuted; ((TMP_Text)obj).characterSpacing = 1f; ((TMP_Text)obj).alignment = (TextAlignmentOptions)4097; SetLayout(((Component)obj).gameObject, width * 0.55f, width, 0f, 32f, 32f, 0f); } private static void BuildDetails(CraftingTableUI crafting, RectTransform detailsPanel) { //IL_0006: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) RectTransform val = CreateSurface("BetterUI_DetailsHeader", (Transform)(object)detailsPanel, BetterUITheme.CraftingWell); AnchorTop(val, 50f, 8f, 8f); TextMeshProUGUI obj = CreateLabel("BetterUI_DetailsHeading", (Transform)(object)val, crafting._titleTMP); ((TMP_Text)obj).text = "ITEM INSPECTION // COMPONENT ANALYSIS"; ((TMP_Text)obj).fontSize = 15f; ((TMP_Text)obj).fontStyle = (FontStyles)1; ((Graphic)obj).color = BetterUITheme.TextMuted; ((TMP_Text)obj).characterSpacing = 1.8f; ((TMP_Text)obj).alignment = (TextAlignmentOptions)4097; ((TMP_Text)obj).enableWordWrapping = false; ((TMP_Text)obj).overflowMode = (TextOverflowModes)1; RectTransform component = ((Component)obj).GetComponent(); if ((Object)(object)component != (Object)null) { component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.offsetMin = new Vector2(12f, 0f); component.offsetMax = new Vector2(-12f, 0f); } SelectedCraftingRecipeUI selectedRecipeUI = crafting._selectedRecipeUI; if ((Object)(object)selectedRecipeUI != (Object)null) { RectTransform component2 = ((Component)selectedRecipeUI).GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Transform)component2).SetParent((Transform)(object)detailsPanel, false); NormalizeRect(component2); component2.anchorMin = Vector2.zero; component2.anchorMax = Vector2.one; component2.offsetMin = new Vector2(10f, 10f); component2.offsetMax = new Vector2(-10f, -58f); ((Component)component2).gameObject.SetActive(true); HideLegacyDetailsHeading(selectedRecipeUI); ConfigureEmptyState(crafting, selectedRecipeUI); BuildSelectedContent(crafting, selectedRecipeUI); } } } private static void ConfigureEmptyState(CraftingTableUI crafting, SelectedCraftingRecipeUI selected) { //IL_0025: 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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0121: 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_0137: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)selected.didntSelectRecipeParent == (Object)null) { return; } RectTransform component = selected.didntSelectRecipeParent.GetComponent(); if ((Object)(object)component != (Object)null) { component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.offsetMin = Vector2.zero; component.offsetMax = Vector2.zero; } Il2CppArrayBase componentsInChildren = selected.didntSelectRecipeParent.GetComponentsInChildren(true); if (componentsInChildren.Length > 0) { ((TMP_Text)componentsInChildren[0]).text = "SELECT A SCHEMATIC"; ((TMP_Text)componentsInChildren[0]).fontSize = 16f; ((TMP_Text)componentsInChildren[0]).fontStyle = (FontStyles)1; ((Graphic)componentsInChildren[0]).color = BetterUITheme.TextMuted; ((TMP_Text)componentsInChildren[0]).alignment = (TextAlignmentOptions)514; return; } TextMeshProUGUI obj = CreateLabel("BetterUI_SelectRecipePrompt", selected.didntSelectRecipeParent.transform, crafting._titleTMP); ((TMP_Text)obj).text = "SELECT A SCHEMATIC"; ((TMP_Text)obj).fontSize = 16f; ((TMP_Text)obj).fontStyle = (FontStyles)1; ((Graphic)obj).color = BetterUITheme.TextMuted; ((TMP_Text)obj).alignment = (TextAlignmentOptions)514; RectTransform component2 = ((Component)obj).GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.anchorMin = Vector2.zero; component2.anchorMax = Vector2.one; component2.offsetMin = Vector2.zero; component2.offsetMax = Vector2.zero; } } private static void BuildSelectedContent(CraftingTableUI crafting, SelectedCraftingRecipeUI selected) { //IL_0038: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_03d8: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)selected.approvedParent == (Object)null) { return; } Transform transform = selected.approvedParent.transform; RectTransform val = (((Object)(object)transform != (Object)null) ? ((Component)transform).GetComponent() : null); if ((Object)(object)val != (Object)null) { val.anchorMin = Vector2.zero; val.anchorMax = Vector2.one; val.offsetMin = Vector2.zero; val.offsetMax = Vector2.zero; } List list = new List(); for (int i = 0; i < transform.childCount; i++) { list.Add(transform.GetChild(i)); } RectTransform val2 = CreateSurface("BetterUI_DetailsScroll", transform, BetterUITheme.PanelElevated); val2.anchorMin = Vector2.zero; val2.anchorMax = Vector2.one; val2.offsetMin = Vector2.zero; val2.offsetMax = Vector2.zero; RectTransform val3 = CreateSurface("Viewport", (Transform)(object)val2, BetterUITheme.PanelElevated); val3.anchorMin = Vector2.zero; val3.anchorMax = Vector2.one; val3.offsetMin = new Vector2(0f, 4f); val3.offsetMax = new Vector2(-18f, -4f); ((Component)val3).gameObject.AddComponent().showMaskGraphic = true; RectTransform val4 = CreateSurface("BetterUI_DetailsContent", (Transform)(object)val3, BetterUITheme.PanelElevated); val4.anchorMin = new Vector2(0f, 1f); val4.anchorMax = new Vector2(1f, 1f); val4.pivot = new Vector2(0.5f, 1f); val4.anchoredPosition = Vector2.zero; val4.sizeDelta = Vector2.zero; VerticalLayoutGroup obj = ((Component)val4).gameObject.AddComponent(); ((LayoutGroup)obj).padding = Padding(14, 14, 14, 14); ((HorizontalOrVerticalLayoutGroup)obj).spacing = 8f; ((LayoutGroup)obj).childAlignment = (TextAnchor)1; ((HorizontalOrVerticalLayoutGroup)obj).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)obj).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)obj).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)obj).childForceExpandHeight = false; ContentSizeFitter obj2 = ((Component)val4).gameObject.AddComponent(); obj2.horizontalFit = (FitMode)0; obj2.verticalFit = (FitMode)2; RectTransform val5 = CreateSurface("BetterUI_OutputSummary", (Transform)(object)val4, BetterUITheme.CraftingWell); SetLayout(((Component)val5).gameObject, 0f, 0f, 1f, 132f, 132f, 0f); HorizontalLayoutGroup obj3 = ((Component)val5).gameObject.AddComponent(); ((LayoutGroup)obj3).padding = Padding(16, 16, 12, 12); ((HorizontalOrVerticalLayoutGroup)obj3).spacing = 18f; ((LayoutGroup)obj3).childAlignment = (TextAnchor)3; ((HorizontalOrVerticalLayoutGroup)obj3).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)obj3).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)obj3).childForceExpandWidth = false; ((HorizontalOrVerticalLayoutGroup)obj3).childForceExpandHeight = false; MoveToLayout(((Object)(object)selected._outputItemContainer != (Object)null) ? ((Component)selected._outputItemContainer).transform : null, (Transform)(object)val5, 104f, 104f, 0f); MoveToLayout(((Object)(object)selected._outputItemNameTMP != (Object)null) ? ((TMP_Text)selected._outputItemNameTMP).transform : null, (Transform)(object)val5, 160f, 240f, 1f); if ((Object)(object)selected._sliderContainer != (Object)null) { MoveToLayout(selected._sliderContainer.transform, (Transform)(object)val4, 0f, 0f, 1f); SetLayout(selected._sliderContainer, 0f, 0f, 1f, 34f, 38f, 0f); } RectTransform val6 = CreateRect("BetterUI_RequirementsSection", (Transform)(object)val4); VerticalLayoutGroup obj4 = ((Component)val6).gameObject.AddComponent(); ((HorizontalOrVerticalLayoutGroup)obj4).spacing = 8f; ((LayoutGroup)obj4).childAlignment = (TextAnchor)0; ((HorizontalOrVerticalLayoutGroup)obj4).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)obj4).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)obj4).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)obj4).childForceExpandHeight = false; ContentSizeFitter obj5 = ((Component)val6).gameObject.AddComponent(); obj5.horizontalFit = (FitMode)0; obj5.verticalFit = (FitMode)2; TextMeshProUGUI obj6 = CreateLabel("BetterUI_MaterialsHeading", (Transform)(object)val6, crafting._titleTMP); ((TMP_Text)obj6).text = "REQUIRED COMPONENTS // CURRENT BATCH"; ((TMP_Text)obj6).fontSize = 15f; ((TMP_Text)obj6).fontStyle = (FontStyles)1; ((Graphic)obj6).color = BetterUITheme.TextMuted; ((TMP_Text)obj6).characterSpacing = 1.2f; ((TMP_Text)obj6).alignment = (TextAlignmentOptions)4097; SetLayout(((Component)obj6).gameObject, 0f, 0f, 1f, 24f, 26f, 0f); if ((Object)(object)selected._requiredItemsContainer != (Object)null) { selected._requiredItemsContainer.SetParent((Transform)(object)val6, false); SetLayout(((Component)selected._requiredItemsContainer).gameObject, 0f, 0f, 1f, 80f, 80f, 0f); } RectTransform val7 = CreateRect("BetterUI_RequirementsStatus", (Transform)(object)val6); SetLayout(((Component)val7).gameObject, 0f, 0f, 1f, 0f, 52f, 0f); VerticalLayoutGroup obj7 = ((Component)val7).gameObject.AddComponent(); ((HorizontalOrVerticalLayoutGroup)obj7).spacing = 5f; ((LayoutGroup)obj7).childAlignment = (TextAnchor)3; ((HorizontalOrVerticalLayoutGroup)obj7).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)obj7).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)obj7).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)obj7).childForceExpandHeight = false; MoveToLayout(((Object)(object)selected._needCraftingTableTmp != (Object)null) ? ((TMP_Text)selected._needCraftingTableTmp).transform : null, (Transform)(object)val7, 0f, 0f, 1f); MoveToLayout(((Object)(object)selected._needBlueprintTmp != (Object)null) ? ((TMP_Text)selected._needBlueprintTmp).transform : null, (Transform)(object)val7, 0f, 0f, 1f); if ((Object)(object)selected._needCraftingTableTmp != (Object)null) { SetLayout(((Component)selected._needCraftingTableTmp).gameObject, 0f, 0f, 1f, 20f, 22f, 0f); } if ((Object)(object)selected._needBlueprintTmp != (Object)null) { SetLayout(((Component)selected._needBlueprintTmp).gameObject, 0f, 0f, 1f, 20f, 22f, 0f); } BuildFabricationState(crafting, val4); if ((Object)(object)selected._craftButton != (Object)null) { MoveToLayout(((Component)selected._craftButton).transform, (Transform)(object)val4, 0f, 0f, 1f); if ((Object)(object)selected._craftButton.buttonText != (Object)null) { ((TMP_Text)selected._craftButton.buttonText).text = "[ E ] FABRICATE"; } SetLayout(((Component)selected._craftButton).gameObject, 0f, 0f, 1f, 56f, 58f, 0f); } Scrollbar verticalScrollbar = CreateScrollbar(val2); ScrollRect obj8 = ((Component)val2).gameObject.AddComponent(); obj8.content = val4; obj8.viewport = val3; obj8.horizontal = false; obj8.vertical = true; obj8.movementType = (MovementType)2; obj8.inertia = true; obj8.decelerationRate = 0.12f; obj8.scrollSensitivity = 30f; obj8.verticalScrollbar = verticalScrollbar; obj8.verticalScrollbarVisibility = (ScrollbarVisibility)1; int instanceID = ((Object)transform).GetInstanceID(); for (int j = 0; j < list.Count; j++) { Transform val8 = list[j]; if ((Object)(object)val8 != (Object)null && (Object)(object)val8.parent != (Object)null && ((Object)val8.parent).GetInstanceID() == instanceID) { ((Component)val8).gameObject.SetActive(false); } } } private static void BuildFabricationState(CraftingTableUI crafting, RectTransform content) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_011b: 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_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0383: 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_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_0418: Unknown result type (might be due to invalid IL or missing references) //IL_042d: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: 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_04bc: Unknown result type (might be due to invalid IL or missing references) RectTransform val = CreateSurface("BetterUI_FabricationSection", (Transform)(object)content, BetterUITheme.CraftingWell); SetLayout(((Component)val).gameObject, 0f, 0f, 1f, 174f, 174f, 0f); ((Component)val).GetComponent().ignoreLayout = true; CanvasGroup obj = ((Component)val).gameObject.AddComponent(); obj.alpha = 0f; obj.interactable = false; obj.blocksRaycasts = false; TextMeshProUGUI obj2 = CreateLabel("BetterUI_FabricationHeading", (Transform)(object)val, crafting._titleTMP); ((TMP_Text)obj2).text = "FABRICATION IN PROGRESS"; ((TMP_Text)obj2).fontSize = 14f; ((TMP_Text)obj2).fontStyle = (FontStyles)1; ((Graphic)obj2).color = BetterUITheme.TextMuted; ((TMP_Text)obj2).characterSpacing = 1.4f; ((TMP_Text)obj2).alignment = (TextAlignmentOptions)4097; RectTransform component = ((Component)obj2).GetComponent(); component.anchorMin = new Vector2(0f, 1f); component.anchorMax = new Vector2(1f, 1f); component.pivot = new Vector2(0.5f, 1f); component.offsetMin = new Vector2(16f, -42f); component.offsetMax = new Vector2(-16f, -12f); RectTransform val2 = CreateSurface("BetterUI_FabricationIconFrame", (Transform)(object)val, BetterUITheme.PanelSoft); val2.anchorMin = new Vector2(0f, 0f); val2.anchorMax = new Vector2(0f, 0f); val2.pivot = new Vector2(0f, 0f); val2.anchoredPosition = new Vector2(16f, 18f); val2.sizeDelta = new Vector2(96f, 96f); Image obj3 = CreateArtwork("BetterUI_FabricationIconBase", (Transform)(object)val2); ((Graphic)obj3).color = new Color(1f, 1f, 1f, 0.2f); Stretch(((Graphic)obj3).rectTransform, 8f); Image obj4 = CreateArtwork("BetterUI_FabricationIconFill", (Transform)(object)val2); obj4.type = (Type)3; obj4.fillMethod = (FillMethod)1; obj4.fillOrigin = 0; obj4.fillAmount = 0f; Stretch(((Graphic)obj4).rectTransform, 8f); TextMeshProUGUI obj5 = CreateLabel("BetterUI_FabricationItemName", (Transform)(object)val, crafting._titleTMP); ((TMP_Text)obj5).text = "FABRICATING ITEM"; ((TMP_Text)obj5).fontSize = 20f; ((TMP_Text)obj5).fontStyle = (FontStyles)1; ((Graphic)obj5).color = BetterUITheme.Text; ((TMP_Text)obj5).alignment = (TextAlignmentOptions)1025; ((TMP_Text)obj5).enableWordWrapping = false; ((TMP_Text)obj5).overflowMode = (TextOverflowModes)1; RectTransform component2 = ((Component)obj5).GetComponent(); component2.anchorMin = new Vector2(0f, 0f); component2.anchorMax = new Vector2(1f, 0f); component2.pivot = new Vector2(0f, 0f); component2.offsetMin = new Vector2(132f, 72f); component2.offsetMax = new Vector2(-18f, 106f); TextMeshProUGUI obj6 = CreateLabel("BetterUI_FabricationPercent", (Transform)(object)val, crafting._titleTMP); ((TMP_Text)obj6).text = "FABRICATING // 0%"; ((TMP_Text)obj6).fontSize = 13f; ((TMP_Text)obj6).fontStyle = (FontStyles)1; ((Graphic)obj6).color = BetterUITheme.Accent; ((TMP_Text)obj6).characterSpacing = 1f; ((TMP_Text)obj6).alignment = (TextAlignmentOptions)4097; RectTransform component3 = ((Component)obj6).GetComponent(); component3.anchorMin = new Vector2(0f, 0f); component3.anchorMax = new Vector2(1f, 0f); component3.pivot = new Vector2(0f, 0f); component3.offsetMin = new Vector2(132f, 43f); component3.offsetMax = new Vector2(-18f, 69f); RectTransform val3 = CreateSurface("BetterUI_FabricationTrack", (Transform)(object)val, BetterUITheme.PanelSoft); val3.anchorMin = new Vector2(0f, 0f); val3.anchorMax = new Vector2(1f, 0f); val3.pivot = new Vector2(0.5f, 0f); val3.offsetMin = new Vector2(132f, 22f); val3.offsetMax = new Vector2(-18f, 34f); RectTransform obj7 = CreateSurface("BetterUI_FabricationBarFill", (Transform)(object)val3, BetterUITheme.Accent); obj7.anchorMin = Vector2.zero; obj7.anchorMax = new Vector2(0f, 1f); obj7.pivot = new Vector2(0f, 0.5f); obj7.offsetMin = Vector2.zero; obj7.offsetMax = Vector2.zero; CraftingProgressUI craftingProgressUI = crafting._craftingProgressUI; if ((Object)(object)craftingProgressUI != (Object)null) { RectTransform component4 = ((Component)craftingProgressUI).GetComponent(); if ((Object)(object)component4 != (Object)null) { ((Transform)component4).SetParent((Transform)(object)val, false); NormalizeRect(component4); component4.anchorMin = Vector2.zero; component4.anchorMax = Vector2.one; component4.offsetMin = Vector2.zero; component4.offsetMax = Vector2.zero; ((Transform)component4).SetAsFirstSibling(); } CanvasGroup val4 = ((Component)craftingProgressUI).GetComponent(); if ((Object)(object)val4 == (Object)null) { val4 = ((Component)craftingProgressUI).gameObject.AddComponent(); } val4.alpha = 0f; val4.interactable = false; val4.blocksRaycasts = false; } } private static Image CreateArtwork(string name, Transform parent) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name, (Type[])(object)new Type[3] { Il2CppType.Of(), Il2CppType.Of(), Il2CppType.Of() }); val.transform.SetParent(parent, false); Image component = val.GetComponent(); ((Graphic)component).material = null; component.sprite = null; component.type = (Type)0; ((Graphic)component).color = Color.white; component.preserveAspect = true; ((Graphic)component).raycastTarget = false; return component; } private static void Stretch(RectTransform rect, float inset) { //IL_0001: 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_0019: 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) rect.anchorMin = Vector2.zero; rect.anchorMax = Vector2.one; rect.offsetMin = new Vector2(inset, inset); rect.offsetMax = new Vector2(0f - inset, 0f - inset); } private static Scrollbar CreateScrollbar(RectTransform parent) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_0066: 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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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) RectTransform val = CreateSurface("BetterUI_Scrollbar", (Transform)(object)parent, BetterUITheme.PanelSoft); val.anchorMin = new Vector2(1f, 0f); val.anchorMax = Vector2.one; val.pivot = new Vector2(1f, 0.5f); val.offsetMin = new Vector2(-14f, 8f); val.offsetMax = new Vector2(-4f, -8f); ((Graphic)((Component)val).GetComponent()).raycastTarget = true; RectTransform val2 = CreateSurface("Handle", (Transform)(object)val, BetterUITheme.Accent); val2.anchorMin = Vector2.zero; val2.anchorMax = Vector2.one; val2.offsetMin = Vector2.zero; val2.offsetMax = Vector2.zero; ((Graphic)((Component)val2).GetComponent()).raycastTarget = true; Scrollbar obj = ((Component)val).gameObject.AddComponent(); obj.handleRect = val2; ((Selectable)obj).targetGraphic = (Graphic)(object)((Component)val2).GetComponent(); obj.direction = (Direction)2; obj.size = 0.2f; return obj; } private static void HideLegacyDetailsHeading(SelectedCraftingRecipeUI selected) { Il2CppArrayBase componentsInChildren = ((Component)selected).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { TextMeshProUGUI val = componentsInChildren[i]; if ((Object)(object)val != (Object)null && string.Equals(((TMP_Text)val).text?.Trim(), "Details", StringComparison.OrdinalIgnoreCase)) { ((Component)val).gameObject.SetActive(false); } } } private static MazeButton FindButton(Transform root, string label) { Il2CppArrayBase componentsInChildren = ((Component)root).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { MazeButton val = componentsInChildren[i]; if (string.Equals((((Object)(object)val != (Object)null && (Object)(object)val.buttonText != (Object)null) ? ((TMP_Text)val.buttonText).text : string.Empty)?.Trim(), label, StringComparison.OrdinalIgnoreCase)) { return val; } } return null; } private static int CompareFilterButtons(MazeButton left, MazeButton right) { return FilterRank(left).CompareTo(FilterRank(right)); } private static int FilterRank(MazeButton button) { string text = (((Object)(object)button != (Object)null && (Object)(object)button.buttonText != (Object)null) ? ((TMP_Text)button.buttonText).text.ToUpperInvariant() : string.Empty); if (text.Contains("WEAPON") || text.Contains("COMBAT")) { return 0; } if (text.Contains("MED")) { return 1; } if (text.Contains("TOOL")) { return 2; } if (text.Contains("CLOTH")) { return 3; } if (text.Contains("MISC")) { return 4; } return 5; } private static void MoveToLayout(Transform item, Transform parent, float minimumWidth, float preferredWidth, float flexibleWidth) { if (!((Object)(object)item == (Object)null)) { item.SetParent(parent, false); RectTransform component = ((Component)item).GetComponent(); if ((Object)(object)component != (Object)null) { NormalizeRect(component); } LayoutElement val = ((Component)item).GetComponent(); if ((Object)(object)val == (Object)null) { val = ((Component)item).gameObject.AddComponent(); } val.minWidth = minimumWidth; val.preferredWidth = preferredWidth; val.flexibleWidth = flexibleWidth; val.minHeight = 42f; val.preferredHeight = 46f; val.flexibleHeight = 0f; } } private static void SetLayout(GameObject target, float minimumWidth, float preferredWidth, float flexibleWidth, float minimumHeight, float preferredHeight, float flexibleHeight) { LayoutElement val = target.GetComponent(); if ((Object)(object)val == (Object)null) { val = target.AddComponent(); } val.minWidth = minimumWidth; val.preferredWidth = preferredWidth; val.flexibleWidth = flexibleWidth; val.minHeight = minimumHeight; val.preferredHeight = preferredHeight; val.flexibleHeight = flexibleHeight; } private static RectTransform CreateRect(string name, Transform parent) { //IL_000f: 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) GameObject val = new GameObject(name, (Type[])(object)new Type[1] { Il2CppType.Of() }); val.transform.SetParent(parent, false); return val.GetComponent(); } private static RectTransform CreateSurface(string name, Transform parent, Color color) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name, (Type[])(object)new Type[3] { Il2CppType.Of(), Il2CppType.Of(), Il2CppType.Of() }); val.transform.SetParent(parent, false); Image component = val.GetComponent(); ((Graphic)component).material = null; component.sprite = null; component.type = (Type)0; ((Graphic)component).color = color; ((Graphic)component).raycastTarget = false; BetterUIStyler.Effects((Graphic)(object)component, BetterUITheme.BorderSoft, addShadow: false); Outline component2 = ((Component)component).GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Shadow)component2).effectDistance = new Vector2(1f, -1f); } return val.GetComponent(); } private static void StyleFlatButton(MazeButton button, Color fill, Color border, Color text) { //IL_000b: 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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)button == (Object)null) { return; } button.backgroundColor = fill; button.hoverColor = new Color(border.r, border.g, border.b, 0.34f); button.textColor = text; button.hoverTextColor = BetterUITheme.Text; Image val = (((Object)(object)button.backgroundImage != (Object)null) ? ((Il2CppObjectBase)button.backgroundImage).TryCast() : null); if ((Object)(object)val != (Object)null) { ((Behaviour)val).enabled = true; ((Graphic)val).material = null; val.sprite = null; val.type = (Type)0; ((Graphic)val).color = fill; BetterUIStyler.Effects((Graphic)(object)val, border, addShadow: false); Outline component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { ((Shadow)component).effectDistance = new Vector2(1f, -1f); } } if ((Object)(object)button.buttonText != (Object)null) { BetterUIStyler.Text((TMP_Text)(object)button.buttonText, 13f, text, (FontStyles)1); ((TMP_Text)button.buttonText).characterSpacing = 1f; } button.UpdateVisualState(true); } private static TextMeshProUGUI CreateLabel(string name, Transform parent, TextMeshProUGUI template) { if ((Object)(object)template == (Object)null) { throw new InvalidOperationException("Cannot create " + name + ": no initialized TextMeshPro template is available."); } GameObject obj = Object.Instantiate(((Component)template).gameObject, parent, false); ((Object)obj).name = name; obj.SetActive(true); RectTransform component = obj.GetComponent(); if ((Object)(object)component != (Object)null) { NormalizeRect(component); } TextMeshProUGUI component2 = obj.GetComponent(); if ((Object)(object)component2 == (Object)null) { throw new InvalidOperationException("Cannot create " + name + ": cloned object has no TextMeshProUGUI component."); } ((TMP_Text)component2).text = string.Empty; ((Graphic)component2).raycastTarget = false; return component2; } private static void NormalizeRect(RectTransform rect) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)rect == (Object)null)) { ((Transform)rect).localScale = Vector3.one; ((Transform)rect).localRotation = Quaternion.identity; rect.anchorMin = new Vector2(0.5f, 0.5f); rect.anchorMax = new Vector2(0.5f, 0.5f); rect.pivot = new Vector2(0.5f, 0.5f); rect.anchoredPosition = Vector2.zero; rect.sizeDelta = Vector2.zero; } } private static void BuildSection(string sectionName, Action build) { try { build(); } catch (Exception innerException) { throw new InvalidOperationException("Crafting replacement failed while building the " + sectionName + ".", innerException); } } private static void AnchorTop(RectTransform rect, float height, float left, float right) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_004b: Unknown result type (might be due to invalid IL or missing references) rect.anchorMin = new Vector2(0f, 1f); rect.anchorMax = Vector2.one; rect.pivot = new Vector2(0.5f, 1f); rect.offsetMin = new Vector2(left, 0f - height); rect.offsetMax = new Vector2(0f - right, 0f); } private static RectOffset Padding(int left, int right, int top, int bottom) { //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_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) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown return new RectOffset { left = left, right = right, top = top, bottom = bottom }; } } internal sealed class CraftingMenuOverhaul { private readonly CraftingMenuBuilder _menuBuilder = new CraftingMenuBuilder(); private readonly HashSet _configuredRecipes = new HashSet(); private readonly HashSet _configuredIngredients = new HashSet(); private readonly HashSet _configuredButtons = new HashSet(); private readonly List _recipes = new List(); private readonly Dictionary _recipeVisualStates = new Dictionary(); private readonly MazeButton[] _filterButtons = (MazeButton[])(object)new MazeButton[6]; private int _configuredRootId; private int _recipeHierarchyStamp = int.MinValue; private int _workspaceRecipeId = int.MinValue; private int _workspaceQuantity = int.MinValue; private int _recipeCountState = int.MinValue; private int _layoutRebuildPasses; private Transform _recipeContainer; private GridLayoutGroup _recipeGrid; private TextMeshProUGUI _recipeHeading; private GameObject _replacementRoot; private RectTransform _themeButton; private GameObject _requirementsSection; private GameObject _fabricationSection; private LayoutElement _fabricationLayout; private CanvasGroup _fabricationCanvas; private Image _fabricationIconBase; private Image _fabricationIconFill; private RectTransform _fabricationBarFill; private TextMeshProUGUI _fabricationItemName; private TextMeshProUGUI _fabricationPercent; private bool _fabricationVisible; private int _paletteIndex = -1; internal void SetVisible(bool visible) { if ((Object)(object)_replacementRoot != (Object)null && _replacementRoot.activeSelf != visible) { _replacementRoot.SetActive(visible); } } internal bool HandleInput() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_themeButton == (Object)null || (Object)(object)_replacementRoot == (Object)null || !_replacementRoot.activeInHierarchy || Mouse.current == null) { return false; } Canvas componentInParent = ((Component)_themeButton).GetComponentInParent(); Camera val = (((Object)(object)componentInParent != (Object)null && (int)componentInParent.renderMode != 0) ? componentInParent.worldCamera : null); bool flag = RectTransformUtility.RectangleContainsScreenPoint(_themeButton, ((InputControl)(object)((Pointer)Mouse.current).position).ReadValue(), val); MakeFlat(((Component)_themeButton).GetComponent(), flag ? BetterUITheme.SlotHover : BetterUITheme.PanelSoft, flag ? BetterUITheme.Accent : BetterUITheme.Border); if (!flag || !Mouse.current.leftButton.wasPressedThisFrame) { return false; } BetterUIPlugin.CyclePalette(); return true; } internal void RefreshCraftingProgress(CraftingTableUI crafting) { //IL_01a9: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)crafting == (Object)null || (Object)(object)_fabricationSection == (Object)null) { return; } CraftingProgressUI craftingProgressUI = crafting._craftingProgressUI; bool flag = (Object)(object)craftingProgressUI != (Object)null && ((Component)craftingProgressUI).gameObject.activeSelf; if (_fabricationVisible != flag) { _fabricationVisible = flag; if ((Object)(object)_requirementsSection != (Object)null) { _requirementsSection.SetActive(!flag); } if ((Object)(object)_fabricationLayout != (Object)null) { _fabricationLayout.ignoreLayout = !flag; } if ((Object)(object)_fabricationCanvas != (Object)null) { _fabricationCanvas.alpha = (flag ? 1f : 0f); } _layoutRebuildPasses = Mathf.Max(_layoutRebuildPasses, 2); } if (!flag) { return; } Sprite val = (((Object)(object)craftingProgressUI.itemImage != (Object)null) ? craftingProgressUI.itemImage.sprite : null); if ((Object)(object)_fabricationIconBase != (Object)null) { _fabricationIconBase.sprite = val; ((Behaviour)_fabricationIconBase).enabled = (Object)(object)val != (Object)null; } if ((Object)(object)_fabricationIconFill != (Object)null) { _fabricationIconFill.sprite = val; ((Behaviour)_fabricationIconFill).enabled = (Object)(object)val != (Object)null; } float num = Mathf.Clamp01(craftingProgressUI.progress); if ((Object)(object)craftingProgressUI.progressSlider != (Object)null) { float normalizedValue = craftingProgressUI.progressSlider.normalizedValue; if (!float.IsNaN(normalizedValue) && !float.IsInfinity(normalizedValue)) { num = Mathf.Clamp01(normalizedValue); } } if ((Object)(object)_fabricationIconFill != (Object)null) { _fabricationIconFill.fillAmount = num; } if ((Object)(object)_fabricationBarFill != (Object)null) { _fabricationBarFill.anchorMax = new Vector2(num, 1f); } SelectedCraftingRecipeUI selectedRecipeUI = crafting._selectedRecipeUI; if ((Object)(object)_fabricationItemName != (Object)null && (Object)(object)selectedRecipeUI != (Object)null && (Object)(object)selectedRecipeUI._outputItemNameTMP != (Object)null) { ((TMP_Text)_fabricationItemName).text = ((TMP_Text)selectedRecipeUI._outputItemNameTMP).text; } if ((Object)(object)_fabricationPercent != (Object)null) { string text = ((!((Object)(object)craftingProgressUI.itemCountTMP != (Object)null)) ? string.Empty : ((TMP_Text)craftingProgressUI.itemCountTMP).text?.Trim()); string value = ((string.IsNullOrEmpty(text) || text == "1") ? string.Empty : (" // BATCH " + text)); ((TMP_Text)_fabricationPercent).text = $"FABRICATING // {Mathf.RoundToInt(num * 100f)}%{value}"; } } private void RefreshPalette(CraftingTableUI crafting) { //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_0389: 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_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_0587: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_056b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_replacementRoot == (Object)null || (Object)(object)crafting == (Object)null) { return; } Il2CppArrayBase componentsInChildren = _replacementRoot.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Image val = componentsInChildren[i]; if (!((Object)(object)val == (Object)null)) { bool flag = true; Color fill; switch (((Object)val).name) { case "BetterUI_CraftingMenu": fill = BetterUITheme.CraftingCanvas; break; case "BetterUI_RecipeBrowser": case "BetterUI_CommandFooter": case "BetterUI_Header": fill = BetterUITheme.Panel; break; case "BetterUI_RecipeHeader": case "BetterUI_DetailsScroll": case "BetterUI_Categories": case "BetterUI_Details": case "BetterUI_DetailsContent": fill = BetterUITheme.PanelElevated; break; case "BetterUI_RecipeScroll": case "BetterUI_OutputSummary": case "BetterUI_DetailsHeader": case "BetterUI_FabricationSection": fill = BetterUITheme.CraftingWell; break; case "BetterUI_ThemeButton": case "BetterUI_Scrollbar": case "BetterUI_FabricationIconFrame": case "BetterUI_FabricationTrack": fill = BetterUITheme.PanelSoft; break; case "BetterUI_FabricationBarFill": fill = BetterUITheme.Accent; break; case "Handle": flag = (Object)(object)((Component)val).transform.parent != (Object)null && ((Object)((Component)val).transform.parent).name == "BetterUI_Scrollbar"; fill = BetterUITheme.Accent; break; case "Viewport": fill = (((Object)(object)((Component)val).transform.parent != (Object)null && ((Object)((Component)val).transform.parent).name == "BetterUI_RecipeScroll") ? BetterUITheme.CraftingWell : BetterUITheme.PanelElevated); break; default: flag = false; fill = Color.clear; break; } if (flag) { MakeFlat(val, fill, (((Object)val).name == "BetterUI_CraftingMenu") ? BetterUITheme.Accent : BetterUITheme.BorderSoft); } } } Il2CppArrayBase componentsInChildren2 = _replacementRoot.GetComponentsInChildren(true); for (int j = 0; j < componentsInChildren2.Length; j++) { TMP_Text val2 = componentsInChildren2[j]; if (!((Object)(object)val2 == (Object)null)) { switch (((Object)val2).name) { case "BetterUI_StationStatus": ((Graphic)val2).color = BetterUITheme.Accent; break; case "BetterUI_FilterStatus": ((Graphic)val2).color = BetterUITheme.TextDim; break; case "BetterUI_CommandPrompt": case "BetterUI_RecipeHeading": case "BetterUI_FabricationHeading": case "BetterUI_CategoriesHeading": case "BetterUI_DetailsHeading": case "BetterUI_MaterialsHeading": ((Graphic)val2).color = BetterUITheme.TextMuted; break; case "BetterUI_FabricationPercent": ((Graphic)val2).color = BetterUITheme.Accent; break; } } } _recipeVisualStates.Clear(); _workspaceRecipeId = int.MinValue; _workspaceQuantity = int.MinValue; _layoutRebuildPasses = Mathf.Max(_layoutRebuildPasses, 2); StyleWindow(crafting); ConfigureToolbar(crafting); StyleRecipeWorkspace(crafting._selectedRecipeUI); StyleProgress(crafting._craftingProgressUI); BetterUIStyler.Scrollbars(_replacementRoot.transform); } internal void Apply(CraftingTableUI crafting) { if (!((Object)(object)crafting == (Object)null)) { int instanceID = ((Object)crafting).GetInstanceID(); if (_configuredRootId != instanceID) { ResetFor(crafting); } if (_paletteIndex != BetterUIPlugin.PaletteIndex) { _paletteIndex = BetterUIPlugin.PaletteIndex; RefreshPalette(crafting); } RefreshToolbarStates(crafting); RefreshRecipeBrowser(); RefreshWorkspace(crafting._selectedRecipeUI); RebuildOpeningLayouts(); } } private void ResetFor(CraftingTableUI crafting) { _configuredRootId = ((Object)crafting).GetInstanceID(); _menuBuilder.Build(crafting); _replacementRoot = _menuBuilder.ReplacementRoot; Transform val = (((Object)(object)_replacementRoot != (Object)null) ? _replacementRoot.transform.Find("BetterUI_CommandFooter/BetterUI_ThemeButton") : null); _themeButton = (((Object)(object)val != (Object)null) ? ((Component)val).GetComponent() : null); CacheFabricationWidgets(); _paletteIndex = BetterUIPlugin.PaletteIndex; _configuredRecipes.Clear(); _configuredIngredients.Clear(); _configuredButtons.Clear(); _recipes.Clear(); _recipeVisualStates.Clear(); _recipeHierarchyStamp = int.MinValue; _workspaceRecipeId = int.MinValue; _workspaceQuantity = int.MinValue; _recipeCountState = int.MinValue; _layoutRebuildPasses = 4; _recipeGrid = null; Transform val2 = ((Component)crafting).transform.Find("BetterUI_CraftingMenu/BetterUI_Body/BetterUI_RecipeBrowser/BetterUI_RecipeHeader/BetterUI_RecipeHeading"); _recipeHeading = (((Object)(object)val2 != (Object)null) ? ((Component)val2).GetComponent() : null); _filterButtons[0] = crafting.filterMiscButton; _filterButtons[1] = crafting.filterCombatButton; _filterButtons[2] = crafting.filterFoodButton; _filterButtons[3] = crafting.filterHealthyButton; _filterButtons[4] = crafting.filterClothingButton; _filterButtons[5] = crafting._hideUncraftableButton; StyleWindow(crafting); ConfigureToolbar(crafting); ConfigureRecipeBrowser(); StyleRecipeWorkspace(crafting._selectedRecipeUI); StyleProgress(crafting._craftingProgressUI); RefreshCraftingProgress(crafting); BetterUIStyler.Scrollbars(((Component)crafting).transform); } private void CacheFabricationWidgets() { Transform root = (((Object)(object)_replacementRoot != (Object)null) ? _replacementRoot.transform : null); Transform obj = FindNamedDescendant(root, "BetterUI_RequirementsSection"); _requirementsSection = ((obj != null) ? ((Component)obj).gameObject : null); Transform val = FindNamedDescendant(root, "BetterUI_FabricationSection"); _fabricationSection = (((Object)(object)val != (Object)null) ? ((Component)val).gameObject : null); _fabricationLayout = (((Object)(object)val != (Object)null) ? ((Component)val).GetComponent() : null); _fabricationCanvas = (((Object)(object)val != (Object)null) ? ((Component)val).GetComponent() : null); Transform obj2 = FindNamedDescendant(val, "BetterUI_FabricationIconBase"); _fabricationIconBase = ((obj2 != null) ? ((Component)obj2).GetComponent() : null); Transform obj3 = FindNamedDescendant(val, "BetterUI_FabricationIconFill"); _fabricationIconFill = ((obj3 != null) ? ((Component)obj3).GetComponent() : null); Transform obj4 = FindNamedDescendant(val, "BetterUI_FabricationBarFill"); _fabricationBarFill = ((obj4 != null) ? ((Component)obj4).GetComponent() : null); Transform obj5 = FindNamedDescendant(val, "BetterUI_FabricationItemName"); _fabricationItemName = ((obj5 != null) ? ((Component)obj5).GetComponent() : null); Transform obj6 = FindNamedDescendant(val, "BetterUI_FabricationPercent"); _fabricationPercent = ((obj6 != null) ? ((Component)obj6).GetComponent() : null); _fabricationVisible = false; } private static void StyleWindow(CraftingTableUI crafting) { //IL_0033: 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_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) TextMeshProUGUI titleTMP = crafting._titleTMP; if (!((Object)(object)titleTMP == (Object)null)) { BetterUIStyler.Heading((TMP_Text)(object)titleTMP, 32f); ((TMP_Text)titleTMP).characterSpacing = 3.2f; RectTransform obj = FindReplacementPanel(((TMP_Text)titleTMP).transform); MakeFlat(BetterUIStyler.Surface(obj, BetterUITheme.CraftingCanvas, BetterUITheme.Accent), BetterUITheme.CraftingCanvas, BetterUITheme.Accent); AddTerminalOverlay(obj); } } private void ConfigureToolbar(CraftingTableUI crafting) { //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) TMP_InputField searchInputField = crafting._searchInputField; BetterUIStyler.InputField(searchInputField); if ((Object)(object)searchInputField != (Object)null) { MakeFlat(((Component)searchInputField).GetComponent(), BetterUITheme.CraftingWell, BetterUITheme.Border); LayoutElement orAddLayout = GetOrAddLayout(((Component)searchInputField).gameObject); orAddLayout.minHeight = 46f; orAddLayout.preferredHeight = 46f; orAddLayout.flexibleWidth = 1f; TMP_Text val = (((Object)(object)searchInputField.placeholder != (Object)null) ? ((Il2CppObjectBase)searchInputField.placeholder).TryCast() : null); if ((Object)(object)val != (Object)null) { val.text = "SEARCH SCHEMATICS..."; } } for (int i = 0; i < _filterButtons.Length; i++) { MazeButton val2 = _filterButtons[i]; if (!((Object)(object)val2 == (Object)null)) { ConfigureToolbarButton(val2); } } Transform val3 = FindCommonParent(_filterButtons); HorizontalOrVerticalLayoutGroup val4 = (((Object)(object)val3 != (Object)null) ? ((Component)val3).GetComponent() : null); if ((Object)(object)val4 != (Object)null) { val4.spacing = 8f; ((LayoutGroup)val4).padding = CreatePadding(4, 4, 4, 4); ((LayoutGroup)val4).childAlignment = (TextAnchor)3; } } private void RefreshToolbarStates(CraftingTableUI crafting) { //IL_0026: 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_0021: Invalid comparison between Unknown and I4 for (int i = 0; i < _filterButtons.Length; i++) { MazeButton val = _filterButtons[i]; if (!((Object)(object)val == (Object)null)) { bool active = ((i < 5) ? IsFilterActive(crafting._activeFilterMask, i) : ((int)crafting.maskUncraftableType > 0)); StyleTerminalToggle(val, active); } } } private void ConfigureToolbarButton(MazeButton button) { int instanceID = ((Object)button).GetInstanceID(); if (!_configuredButtons.Add(instanceID)) { return; } LayoutElement orAddLayout = GetOrAddLayout(((Component)button).gameObject); string obj = (((Object)(object)((Component)button).transform.parent != (Object)null) ? ((Object)((Component)button).transform.parent).name : string.Empty); bool flag = obj == "BetterUI_Categories"; if (obj == "BetterUI_CommandFooter") { orAddLayout.minHeight = 38f; orAddLayout.preferredHeight = 38f; orAddLayout.minWidth = 42f; orAddLayout.preferredWidth = 46f; orAddLayout.flexibleWidth = 0f; return; } if (flag) { ConfigureCategoryIcon(button); } orAddLayout.minHeight = (flag ? 48f : 40f); orAddLayout.preferredHeight = (flag ? 48f : 40f); orAddLayout.minWidth = (flag ? 0f : 84f); orAddLayout.preferredWidth = (flag ? 0f : orAddLayout.preferredWidth); orAddLayout.flexibleWidth = 1f; } private static void ConfigureCategoryIcon(MazeButton button) { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: 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_0054: 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_013b: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)button == (Object)null)) { Transform val = ((Component)button).transform.Find("BetterUI_CategoryIcon"); if ((Object)(object)val == (Object)null) { GameObject val2 = new GameObject("BetterUI_CategoryIcon", (Type[])(object)new Type[4] { Il2CppType.Of(), Il2CppType.Of(), Il2CppType.Of(), Il2CppType.Of() }); val2.transform.SetParent(((Component)button).transform, false); val = val2.transform; val2.GetComponent().ignoreLayout = true; } RectTransform component = ((Component)val).GetComponent(); component.anchorMin = new Vector2(0f, 0.5f); component.anchorMax = new Vector2(0f, 0.5f); component.pivot = new Vector2(0.5f, 0.5f); component.anchoredPosition = new Vector2(20f, 0f); component.sizeDelta = new Vector2(18f, 18f); ((Transform)component).localScale = Vector3.one; ((Transform)component).localRotation = Quaternion.identity; ((Transform)component).SetAsLastSibling(); RawImage component2 = ((Component)val).GetComponent(); string text = (((Object)(object)button.buttonText != (Object)null) ? RemoveCategoryNumberPrefix(((TMP_Text)button.buttonText).text) : string.Empty); component2.texture = (Texture)(object)BetterUITheme.GetCategoryIconTexture(text); ((Graphic)component2).color = BetterUITheme.TextMuted; ((Graphic)component2).raycastTarget = false; if ((Object)(object)button.buttonText != (Object)null) { ((TMP_Text)button.buttonText).text = text; ((TMP_Text)button.buttonText).alignment = (TextAlignmentOptions)4097; ((TMP_Text)button.buttonText).margin = new Vector4(42f, 0f, 8f, 0f); } NormalizeCategoryButtonGeometry(button); } } private void ConfigureRecipeBrowser() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) _recipeContainer = CraftingTableUI.craftingRecipesContainer; if (!((Object)(object)_recipeContainer == (Object)null)) { ConfigureRecipeContent(_recipeContainer); ScrollRect componentInParent = ((Component)_recipeContainer).GetComponentInParent(); RectTransform val = (((Object)(object)componentInParent != (Object)null) ? ((Component)componentInParent).GetComponent() : (((Object)(object)_recipeContainer.parent != (Object)null) ? ((Component)_recipeContainer.parent).GetComponent() : null)); BetterUIStyler.Surface(val, BetterUITheme.CraftingWell, BetterUITheme.BorderSoft, addShadow: false); if ((Object)(object)val != (Object)null) { LayoutElement orAddLayout = GetOrAddLayout(((Component)val).gameObject); orAddLayout.minWidth = 520f; orAddLayout.flexibleWidth = 1.65f; } if ((Object)(object)componentInParent != (Object)null) { componentInParent.horizontal = false; componentInParent.vertical = true; componentInParent.inertia = true; componentInParent.decelerationRate = 0.12f; componentInParent.elasticity = 0.08f; componentInParent.scrollSensitivity = 32f; } } } private void RefreshRecipeBrowser() { if ((Object)(object)_recipeContainer == (Object)null) { return; } RefreshRecipeGridLayout(); int hierarchyStamp = GetHierarchyStamp(_recipeContainer); if (_recipeHierarchyStamp != hierarchyStamp) { RebuildRecipeCache(hierarchyStamp); } CraftingRecipeUI selectedRecipeOnListUI = CraftingTableUI.selectedRecipeOnListUI; int num = 0; int num2 = 0; for (int i = 0; i < _recipes.Count; i++) { CraftingRecipeUI val = _recipes[i]; if ((Object)(object)val == (Object)null) { _recipeHierarchyStamp = int.MinValue; continue; } if ((Object)(object)val._requiredItemsContainer != (Object)null && ((Component)val._requiredItemsContainer).gameObject.activeSelf) { ((Component)val._requiredItemsContainer).gameObject.SetActive(false); } NeutralizeNativeRecipeVisuals(val); if (((Component)val).gameObject.activeSelf) { num++; if (val.playerCanCraft) { num2++; } } bool flag = SameObject((Object)(object)val, (Object)(object)selectedRecipeOnListUI); byte b = (flag ? ((byte)2) : (val.playerCanCraft ? ((byte)1) : ((byte)0))); int instanceID = ((Object)val).GetInstanceID(); if (!_recipeVisualStates.TryGetValue(instanceID, out var value) || value != b) { _recipeVisualStates[instanceID] = b; StyleRecipeCard(val, flag); } RefreshRecipeRowContent(val, flag); } int num3 = (num * 397) ^ num2; string text = $"SCHEMATIC INDEX // {num:000} SHOWN // {num2:000} READY"; if ((Object)(object)_recipeHeading != (Object)null && (_recipeCountState != num3 || ((TMP_Text)_recipeHeading).text != text)) { _recipeCountState = num3; ((TMP_Text)_recipeHeading).text = text; } } private void RebuildRecipeCache(int hierarchyStamp) { _recipes.Clear(); _recipeVisualStates.Clear(); Il2CppArrayBase componentsInChildren = ((Component)_recipeContainer).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { if ((Object)(object)componentsInChildren[i] != (Object)null) { _recipes.Add(componentsInChildren[i]); } } _recipeHierarchyStamp = hierarchyStamp; _layoutRebuildPasses = Mathf.Max(_layoutRebuildPasses, 2); } private static void RefreshRecipeRowContent(CraftingRecipeUI recipe, bool selected) { //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)recipe == (Object)null) { return; } Transform val = ((Component)recipe).transform.Find("BetterUI_RowContent"); if ((Object)(object)val != (Object)null && !((Component)val).gameObject.activeSelf) { ((Component)val).gameObject.SetActive(true); } if ((Object)(object)recipe._outputItemName != (Object)null) { if (!((Component)recipe._outputItemName).gameObject.activeSelf) { ((Component)recipe._outputItemName).gameObject.SetActive(true); } ((Behaviour)recipe._outputItemName).enabled = true; BetterUIStyler.Text((TMP_Text)(object)recipe._outputItemName, 16f, selected ? BetterUITheme.Text : (recipe.playerCanCraft ? BetterUITheme.Text : BetterUITheme.TextUnavailable), (FontStyles)1); ((Graphic)recipe._outputItemName).SetAllDirty(); } object obj; if (!((Object)(object)val != (Object)null)) { obj = null; } else { Transform obj2 = val.Find("BetterUI_RowStatus"); obj = ((obj2 != null) ? ((Component)obj2).GetComponent() : null); } TMP_Text val2 = (TMP_Text)obj; if ((Object)(object)val2 != (Object)null) { val2.text = (selected ? "SELECTED" : (recipe.playerCanCraft ? "READY" : "MISSING")); BetterUIStyler.Text(val2, 11f, selected ? BetterUITheme.Text : (recipe.playerCanCraft ? BetterUITheme.Success : BetterUITheme.TextUnavailable), (FontStyles)1); val2.alignment = (TextAlignmentOptions)4100; } StyleListIcon((ItemContainerUIBase)(object)recipe._outputItemContiner, 48f); } private void RefreshWorkspace(SelectedCraftingRecipeUI selected) { if (!((Object)(object)selected == (Object)null)) { RefreshCountBadge(((Object)(object)selected._outputItemContainer != (Object)null) ? ((Il2CppObjectBase)selected._outputItemContainer).TryCast() : null); FitItemArtwork((ItemContainerUIBase)(object)selected._outputItemContainer, 104f); CraftingRecipeUI selectedRecipeOnListUI = CraftingTableUI.selectedRecipeOnListUI; bool flag = (Object)(object)selectedRecipeOnListUI != (Object)null && ((Component)selectedRecipeOnListUI).gameObject.activeInHierarchy; if ((Object)(object)selected.didntSelectRecipeParent != (Object)null && selected.didntSelectRecipeParent.activeSelf == flag) { selected.didntSelectRecipeParent.SetActive(!flag); } if ((Object)(object)selected.approvedParent != (Object)null && selected.approvedParent.activeSelf != flag) { selected.approvedParent.SetActive(flag); } int num = (((Object)(object)selectedRecipeOnListUI != (Object)null) ? ((Object)selectedRecipeOnListUI).GetInstanceID() : 0); int num2 = (((Object)(object)selected._craftCountSlider != (Object)null) ? Mathf.RoundToInt(selected._craftCountSlider.value) : 0); StyleIngredientList(selected._requiredItemsContainer, selected); if (_workspaceRecipeId != num || _workspaceQuantity != num2) { _workspaceRecipeId = num; _workspaceQuantity = num2; _layoutRebuildPasses = Mathf.Max(_layoutRebuildPasses, 2); } } } private static void ConfigureRecipeContent(Transform recipeContainer) { //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) VerticalLayoutGroup val = ((Component)recipeContainer).GetComponent(); GridLayoutGroup component = ((Component)recipeContainer).GetComponent(); if ((Object)(object)val == (Object)null && (Object)(object)component == (Object)null) { val = ((Component)recipeContainer).gameObject.AddComponent(); } if ((Object)(object)val != (Object)null) { ((LayoutGroup)val).padding = CreatePadding(4, 4, 4, 4); ((HorizontalOrVerticalLayoutGroup)val).spacing = 2f; ((LayoutGroup)val).childAlignment = (TextAnchor)1; ((HorizontalOrVerticalLayoutGroup)val).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)val).childControlHeight = false; ((HorizontalOrVerticalLayoutGroup)val).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)val).childForceExpandHeight = false; } if ((Object)(object)component != (Object)null) { ((LayoutGroup)component).padding = CreatePadding(4, 4, 4, 4); component.spacing = new Vector2(0f, 2f); component.startCorner = (Corner)0; component.startAxis = (Axis)0; ((LayoutGroup)component).childAlignment = (TextAnchor)0; component.constraint = (Constraint)1; component.constraintCount = 1; component.cellSize = new Vector2(360f, 58f); } ContentSizeFitter val2 = ((Component)recipeContainer).GetComponent(); if ((Object)(object)val2 == (Object)null) { val2 = ((Component)recipeContainer).gameObject.AddComponent(); } val2.horizontalFit = (FitMode)0; val2.verticalFit = (FitMode)2; } private void RefreshRecipeGridLayout() { //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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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) //IL_00e9: 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 ((Object)(object)_recipeGrid == (Object)null) { _recipeGrid = ((Component)_recipeContainer).GetComponent(); } if ((Object)(object)_recipeGrid == (Object)null) { return; } RectTransform component = ((Component)_recipeContainer).GetComponent(); float num; if (!((Object)(object)component != (Object)null)) { num = 0f; } else { Rect rect = component.rect; num = ((Rect)(ref rect)).width; } float num2 = num; if (!(num2 <= 1f)) { float num3 = ((LayoutGroup)_recipeGrid).padding.left + ((LayoutGroup)_recipeGrid).padding.right; float num4 = num2 - num3 - _recipeGrid.spacing.x * 0f; float num5 = Mathf.Max(260f, num4 / 1f); if (_recipeGrid.constraintCount != 1) { _recipeGrid.constraintCount = 1; } Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(num5, 58f); if (Vector2.SqrMagnitude(_recipeGrid.cellSize - val) > 0.25f) { _recipeGrid.cellSize = val; } } } private void StyleRecipeCard(CraftingRecipeUI recipe, bool selected) { //IL_004d: 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_0046: 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_005d: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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) if (!((Object)(object)recipe == (Object)null)) { bool playerCanCraft = recipe.playerCanCraft; Color fill = (Color)(selected ? BetterUITheme.CraftingSelected : (playerCanCraft ? new Color(0.02f, 0.09f, 0.04f, 0.82f) : new Color(0.01f, 0.025f, 0.015f, 0.72f))); Color border = (selected ? BetterUITheme.Accent : BetterUITheme.BorderSoft); Image orCreateCardSurface = GetOrCreateCardSurface(((Component)recipe).transform); NeutralizeNativeRecipeVisuals(recipe); bool num = _configuredRecipes.Add(((Object)recipe).GetInstanceID()); if (num) { ConfigureRecipeRow(recipe); } if ((Object)(object)orCreateCardSurface != (Object)null) { MakeFlat(orCreateCardSurface, fill, border); } BetterUIStyler.Text((TMP_Text)(object)recipe._outputItemName, 16f, selected ? BetterUITheme.Text : (playerCanCraft ? BetterUITheme.Text : BetterUITheme.TextUnavailable), (FontStyles)1); if ((Object)(object)recipe._outputItemName != (Object)null) { ((TMP_Text)recipe._outputItemName).enableWordWrapping = false; ((TMP_Text)recipe._outputItemName).overflowMode = (TextOverflowModes)1; } StyleListIcon((ItemContainerUIBase)(object)recipe._outputItemContiner, 48f); LayoutElement orAddLayout = GetOrAddLayout(((Component)recipe).gameObject); orAddLayout.minHeight = 58f; orAddLayout.preferredHeight = 58f; orAddLayout.flexibleHeight = 0f; if (num) { DisableListCardTooltips(recipe); AddAvailabilityRail(((Component)recipe).transform, selected ? BetterUITheme.CraftingWell : (playerCanCraft ? BetterUITheme.Success : BetterUITheme.TextDim)); } else { BetterUIStyler.Tint(FindDecoration(((Component)recipe).transform, "BetterUI_AvailabilityRail"), selected ? BetterUITheme.CraftingWell : (playerCanCraft ? BetterUITheme.Success : BetterUITheme.TextDim)); } } } private static void NeutralizeNativeRecipeVisuals(CraftingRecipeUI recipe) { //IL_0000: 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) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_0114: Unknown result type (might be due to invalid IL or missing references) CraftingRecipeUI.canCraftColor = Color.clear; CraftingRecipeUI.cantCraftColor = Color.clear; CraftingRecipeUI.selectedColor = Color.clear; Image component = ((Component)recipe).GetComponent(); if ((Object)(object)component != (Object)null) { ((Graphic)component).material = null; ((Graphic)component).color = new Color(0f, 0f, 0f, 0.001f); } Il2CppArrayBase components = ((Component)recipe).GetComponents(); for (int i = 0; i < components.Length; i++) { if ((Object)(object)components[i] != (Object)null) { ((Behaviour)components[i]).enabled = false; } } MazeButton selectButton = recipe._selectButton; if ((Object)(object)selectButton == (Object)null) { return; } selectButton.backgroundColor = Color.clear; selectButton.hoverColor = Color.clear; selectButton.textColor = Color.clear; selectButton.hoverTextColor = Color.clear; selectButton._disabledBackgroundColor = Color.clear; Graphic backgroundImage = selectButton.backgroundImage; int num = 0; if ((Object)(object)backgroundImage != (Object)null) { num = ((Object)backgroundImage).GetInstanceID(); ((Behaviour)backgroundImage).enabled = true; backgroundImage.material = null; backgroundImage.color = new Color(0f, 0f, 0f, 0.001f); backgroundImage.raycastTarget = true; Image val = ((Il2CppObjectBase)backgroundImage).TryCast(); if ((Object)(object)val != (Object)null) { val.sprite = null; val.type = (Type)0; } Outline component2 = ((Component)backgroundImage).GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Behaviour)component2).enabled = false; } } int num2 = (((Object)(object)recipe._outputItemName != (Object)null) ? ((Object)recipe._outputItemName).GetInstanceID() : 0); Image val2 = (((Object)(object)recipe._outputItemContiner != (Object)null) ? ((ItemContainerUIBase)recipe._outputItemContiner).itemImage : null); int num3 = (((Object)(object)val2 != (Object)null) ? ((Object)val2).GetInstanceID() : 0); ItemContainerUI val3 = (((Object)(object)recipe._outputItemContiner != (Object)null) ? ((Il2CppObjectBase)recipe._outputItemContiner).TryCast() : null); int num4 = (((Object)(object)val3 != (Object)null && (Object)(object)val3.itemCountTmp != (Object)null) ? ((Object)val3.itemCountTmp).GetInstanceID() : 0); int num5 = (((Object)(object)val3 != (Object)null && (Object)(object)val3.countBackgroundImage != (Object)null) ? ((Object)val3.countBackgroundImage).GetInstanceID() : 0); Image val4 = (((Object)(object)recipe._outputItemContiner != (Object)null) ? ((Component)recipe._outputItemContiner).GetComponent() : null); int num6 = (((Object)(object)val4 != (Object)null) ? ((Object)val4).GetInstanceID() : 0); Il2CppArrayBase componentsInChildren = ((Component)recipe).GetComponentsInChildren(true); for (int j = 0; j < componentsInChildren.Length; j++) { Graphic val5 = componentsInChildren[j]; if ((Object)(object)val5 == (Object)null || IsBetterUIDecoration(((Component)val5).transform)) { continue; } int instanceID = ((Object)val5).GetInstanceID(); if (instanceID != num2 && instanceID != num3 && instanceID != num4 && instanceID != num5 && instanceID != num6 && instanceID != num) { ((Behaviour)val5).enabled = false; Outline component3 = ((Component)val5).GetComponent(); if ((Object)(object)component3 != (Object)null) { ((Behaviour)component3).enabled = false; } } } } private static bool IsBetterUIDecoration(Transform transform) { Transform val = transform; int num = 0; while ((Object)(object)val != (Object)null && num < 3) { if (((Object)val).name.StartsWith("BetterUI_")) { return true; } val = val.parent; num++; } return false; } private static void DisableListCardTooltips(CraftingRecipeUI recipe) { if ((Object)(object)recipe._outputItemContiner == (Object)null) { return; } Il2CppArrayBase componentsInChildren = ((Component)recipe._outputItemContiner).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { if ((Object)(object)componentsInChildren[i] != (Object)null) { ((Behaviour)componentsInChildren[i]).enabled = false; } } } private void StyleRecipeWorkspace(SelectedCraftingRecipeUI selected) { //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_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_0065: 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_00f5: 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) if (!((Object)(object)selected == (Object)null)) { MakeFlat(BetterUIStyler.Surface(((Component)selected).GetComponent(), BetterUITheme.PanelElevated, BetterUITheme.Border), BetterUITheme.PanelElevated, BetterUITheme.Border); LayoutElement orAddLayout = GetOrAddLayout(((Component)selected).gameObject); orAddLayout.minWidth = 320f; orAddLayout.preferredWidth = 340f; orAddLayout.flexibleWidth = 1f; BetterUIStyler.Text((TMP_Text)(object)selected._outputItemNameTMP, 26f, BetterUITheme.Text, (FontStyles)1); if ((Object)(object)selected._outputItemNameTMP != (Object)null) { ((TMP_Text)selected._outputItemNameTMP).enableWordWrapping = false; ((TMP_Text)selected._outputItemNameTMP).overflowMode = (TextOverflowModes)1; LayoutElement orAddLayout2 = GetOrAddLayout(((Component)selected._outputItemNameTMP).gameObject); orAddLayout2.minHeight = 30f; orAddLayout2.preferredHeight = 32f; } StyleTerminalSlot((ItemContainerUIBase)(object)selected._outputItemContainer, 104f, BetterUITheme.Primary); StyleIngredientList(selected._requiredItemsContainer, selected); StyleQuantity(selected); StyleRequirementMessage((TMP_Text)(object)selected._needCraftingTableTmp, BetterUITheme.Danger, ((Component)selected).transform); StyleRequirementMessage((TMP_Text)(object)selected._needBlueprintTmp, BetterUITheme.Primary, ((Component)selected).transform); if ((Object)(object)selected._craftButton != (Object)null) { StyleTerminalAction(selected._craftButton); LayoutElement orAddLayout3 = GetOrAddLayout(((Component)selected._craftButton).gameObject); orAddLayout3.minHeight = 56f; orAddLayout3.preferredHeight = 58f; orAddLayout3.minWidth = 180f; } StyleEmptyState(selected.didntSelectRecipeParent); StyleApprovedState(selected.approvedParent); } } private void StyleIngredientList(Transform container, SelectedCraftingRecipeUI selected) { //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_0267: 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_00eb: 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_00f0: 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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0102: 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_010d: 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_0124: 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) if ((Object)(object)container == (Object)null) { return; } VerticalLayoutGroup val = ((Component)container).GetComponent(); GridLayoutGroup component = ((Component)container).GetComponent(); if ((Object)(object)val == (Object)null && (Object)(object)component == (Object)null) { val = ((Component)container).gameObject.AddComponent(); } if ((Object)(object)val != (Object)null) { ((LayoutGroup)val).padding = CreatePadding(4, 4, 4, 4); ((HorizontalOrVerticalLayoutGroup)val).spacing = 8f; ((LayoutGroup)val).childAlignment = (TextAnchor)1; ((HorizontalOrVerticalLayoutGroup)val).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)val).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)val).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)val).childForceExpandHeight = false; } Il2CppArrayBase componentsInChildren = ((Component)selected).GetComponentsInChildren(true); int num = 0; for (int i = 0; i < componentsInChildren.Length; i++) { CraftingRecipeIngredient val2 = componentsInChildren[i]; if (!((Object)(object)val2 == (Object)null)) { if (((Component)val2).gameObject.activeSelf) { num++; } bool flag = LooksLikeUnavailableState(((Object)(object)val2._backgroundImage != (Object)null) ? ((Graphic)val2._backgroundImage).color : BetterUITheme.PanelSoft); Color fill = (flag ? BetterUITheme.DangerSoft : BetterUITheme.PanelSoft); Color border = (flag ? BetterUITheme.Danger : BetterUITheme.BorderSoft); MakeFlat(val2._backgroundImage, fill, border); BetterUIStyler.Text((TMP_Text)(object)val2._requiredItemNameTmp, 18f, flag ? BetterUITheme.Text : BetterUITheme.TextMuted, (FontStyles)1); StyleTerminalSlot((ItemContainerUIBase)(object)val2._requiredItemContainer, 68f, border, null, showBackground: true, prominentCount: true); if (_configuredIngredients.Add(((Object)val2).GetInstanceID())) { ConfigureIngredientRow(val2); LayoutElement orAddLayout = GetOrAddLayout(((Component)val2).gameObject); orAddLayout.minHeight = 84f; orAddLayout.preferredHeight = 84f; orAddLayout.flexibleHeight = 0f; } RefreshIngredientStatus(val2, flag); } } float num2 = Mathf.Max(88f, (float)num * 84f + (float)Mathf.Max(0, num - 1) * 8f + 8f); LayoutElement orAddLayout2 = GetOrAddLayout(((Component)container).gameObject); orAddLayout2.minHeight = num2; orAddLayout2.preferredHeight = num2; orAddLayout2.flexibleHeight = 0f; if ((Object)(object)component != (Object)null) { RectTransform component2 = ((Component)container).GetComponent(); float num3; if (!((Object)(object)component2 != (Object)null)) { num3 = 420f; } else { Rect rect = component2.rect; num3 = Mathf.Max(240f, ((Rect)(ref rect)).width - 8f); } float num4 = num3; ((LayoutGroup)component).padding = CreatePadding(4, 4, 4, 4); component.spacing = new Vector2(0f, 8f); component.constraint = (Constraint)1; component.constraintCount = 1; component.cellSize = new Vector2(num4, 84f); } } private static void ConfigureIngredientRow(CraftingRecipeIngredient ingredient) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ingredient == (Object)null || (Object)(object)((Component)ingredient).transform.Find("BetterUI_IngredientRow") != (Object)null) { return; } GameObject val = new GameObject("BetterUI_IngredientRow", (Type[])(object)new Type[3] { Il2CppType.Of(), Il2CppType.Of(), Il2CppType.Of() }); val.transform.SetParent(((Component)ingredient).transform, false); RectTransform component = val.GetComponent(); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.offsetMin = new Vector2(6f, 5f); component.offsetMax = new Vector2(-6f, -5f); ((Transform)component).SetAsLastSibling(); val.GetComponent().ignoreLayout = true; HorizontalLayoutGroup component2 = val.GetComponent(); ((LayoutGroup)component2).padding = CreatePadding(8, 10, 0, 0); ((HorizontalOrVerticalLayoutGroup)component2).spacing = 14f; ((LayoutGroup)component2).childAlignment = (TextAnchor)3; ((HorizontalOrVerticalLayoutGroup)component2).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)component2).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)component2).childForceExpandWidth = false; ((HorizontalOrVerticalLayoutGroup)component2).childForceExpandHeight = false; if ((Object)(object)ingredient._requiredItemContainer != (Object)null) { MoveRecipeElement(((Component)ingredient._requiredItemContainer).transform, (Transform)(object)component); } if (!((Object)(object)ingredient._requiredItemNameTmp == (Object)null)) { MoveRecipeElement(((TMP_Text)ingredient._requiredItemNameTmp).transform, (Transform)(object)component); ((TMP_Text)ingredient._requiredItemNameTmp).alignment = (TextAlignmentOptions)4097; ((TMP_Text)ingredient._requiredItemNameTmp).margin = Vector4.zero; ((TMP_Text)ingredient._requiredItemNameTmp).enableWordWrapping = false; ((TMP_Text)ingredient._requiredItemNameTmp).overflowMode = (TextOverflowModes)1; LayoutElement orAddLayout = GetOrAddLayout(((Component)ingredient._requiredItemNameTmp).gameObject); orAddLayout.minWidth = 0f; orAddLayout.preferredWidth = 180f; orAddLayout.flexibleWidth = 1f; orAddLayout.minHeight = 58f; orAddLayout.preferredHeight = 58f; orAddLayout.flexibleHeight = 0f; GameObject obj = Object.Instantiate(((Component)ingredient._requiredItemNameTmp).gameObject, (Transform)(object)component, false); ((Object)obj).name = "BetterUI_IngredientStatus"; TMP_Text component3 = obj.GetComponent(); if ((Object)(object)component3 != (Object)null) { component3.text = string.Empty; component3.fontSize = 12f; component3.fontStyle = (FontStyles)1; component3.alignment = (TextAlignmentOptions)4100; ((Graphic)component3).raycastTarget = false; component3.margin = Vector4.zero; } RectTransform component4 = obj.GetComponent(); if ((Object)(object)component4 != (Object)null) { ((Transform)component4).localScale = Vector3.one; ((Transform)component4).localRotation = Quaternion.identity; component4.anchorMin = new Vector2(0.5f, 0.5f); component4.anchorMax = new Vector2(0.5f, 0.5f); component4.pivot = new Vector2(0.5f, 0.5f); component4.anchoredPosition = Vector2.zero; } LayoutElement orAddLayout2 = GetOrAddLayout(obj); orAddLayout2.minWidth = 84f; orAddLayout2.preferredWidth = 96f; orAddLayout2.flexibleWidth = 0f; orAddLayout2.minHeight = 58f; orAddLayout2.preferredHeight = 58f; orAddLayout2.flexibleHeight = 0f; } } private static void RefreshIngredientStatus(CraftingRecipeIngredient ingredient, bool unavailable) { //IL_005f: 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) Transform val = (((Object)(object)ingredient != (Object)null) ? ((Component)ingredient).transform.Find("BetterUI_IngredientRow/BetterUI_IngredientStatus") : null); TMP_Text val2 = (((Object)(object)val != (Object)null) ? ((Component)val).GetComponent() : null); if (!((Object)(object)val2 == (Object)null)) { val2.text = (unavailable ? "MISSING" : "AVAILABLE"); BetterUIStyler.Text(val2, 12f, unavailable ? BetterUITheme.Danger : BetterUITheme.Success, (FontStyles)1); val2.alignment = (TextAlignmentOptions)4100; } } private static void StyleQuantity(SelectedCraftingRecipeUI selected) { //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_0110: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) Slider craftCountSlider = selected._craftCountSlider; if ((Object)(object)craftCountSlider != (Object)null) { MakeFlat(((Component)craftCountSlider).GetComponent(), BetterUITheme.CraftingWell, BetterUITheme.BorderSoft); MakeFlat(((Object)(object)craftCountSlider.fillRect != (Object)null) ? ((Component)craftCountSlider.fillRect).GetComponent() : null, BetterUITheme.Primary, BetterUITheme.Primary); MakeFlat(((Object)(object)craftCountSlider.handleRect != (Object)null) ? ((Component)craftCountSlider.handleRect).GetComponent() : null, BetterUITheme.PrimaryHover, BetterUITheme.PrimaryHover); LayoutElement orAddLayout = GetOrAddLayout(((Component)craftCountSlider).gameObject); orAddLayout.minHeight = 18f; orAddLayout.preferredHeight = 18f; orAddLayout.flexibleWidth = 1f; if ((Object)(object)craftCountSlider.handleRect != (Object)null) { craftCountSlider.handleRect.SetSizeWithCurrentAnchors((Axis)0, 18f); craftCountSlider.handleRect.SetSizeWithCurrentAnchors((Axis)1, 18f); } ReserveQuantityLabelSpace(selected, craftCountSlider); } BetterUIStyler.Text((TMP_Text)(object)selected._craftCountTmp, 16f, BetterUITheme.PrimaryHover, (FontStyles)1); if ((Object)(object)selected._craftCountTmp != (Object)null) { StyleExistingParentSurface((TMP_Text)(object)selected._craftCountTmp, BetterUITheme.PrimarySoft, BetterUITheme.Primary, ((Component)selected).transform); } } private static void ReserveQuantityLabelSpace(SelectedCraftingRecipeUI selected, Slider slider) { //IL_0067: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)selected._craftCountTmp == (Object)null || (Object)(object)slider == (Object)null) { return; } Transform parent = ((TMP_Text)selected._craftCountTmp).transform.parent; Transform parent2 = ((Component)slider).transform.parent; if (!((Object)(object)parent == (Object)null) && !((Object)(object)parent2 == (Object)null) && ((Object)parent).GetInstanceID() == ((Object)parent2).GetInstanceID()) { RectTransform component = ((Component)slider).GetComponent(); if ((Object)(object)component != (Object)null) { Vector2 offsetMax = component.offsetMax; offsetMax.x = Mathf.Min(offsetMax.x, -58f); component.offsetMax = offsetMax; } ((TMP_Text)selected._craftCountTmp).alignment = (TextAlignmentOptions)4100; } } private static void StyleRequirementMessage(TMP_Text text, Color accent, Transform workspaceRoot) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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) if (!((Object)(object)text == (Object)null)) { BetterUIStyler.Text(text, 14f, accent, (FontStyles)1); StyleExistingParentSurface(text, BetterUITheme.PanelSoft, accent, workspaceRoot); text.margin = new Vector4(10f, 6f, 10f, 6f); } } private static void StyleExistingParentSurface(TMP_Text text, Color fill, Color border, Transform stop) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)text == (Object)null || (Object)(object)text.transform.parent == (Object)null) { return; } Transform parent = text.transform.parent; if (!((Object)(object)stop != (Object)null) || ((Object)parent).GetInstanceID() != ((Object)stop).GetInstanceID()) { RectTransform component = ((Component)parent).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)((Component)component).GetComponent() != (Object)null) { MakeFlat(BetterUIStyler.Surface(component, fill, border, addShadow: false), fill, border); } } } private static void StyleEmptyState(GameObject emptyState) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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) if (!((Object)(object)emptyState == (Object)null)) { Image component = emptyState.GetComponent(); if ((Object)(object)component != (Object)null) { MakeFlat(component, BetterUITheme.CraftingWell, BetterUITheme.BorderSoft); } Il2CppArrayBase componentsInChildren = emptyState.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { BetterUIStyler.Text((TMP_Text)(object)componentsInChildren[i], 17f, BetterUITheme.TextMuted, (FontStyles)0); ((TMP_Text)componentsInChildren[i]).alignment = (TextAlignmentOptions)514; } } } private static void StyleApprovedState(GameObject approved) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)approved == (Object)null) { return; } Il2CppArrayBase componentsInChildren = approved.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { TMP_Text val = (TMP_Text)(object)componentsInChildren[i]; if (!((Object)(object)val == (Object)null)) { string text = ((val.text != null) ? val.text.ToUpperInvariant() : string.Empty); if (text.Contains("INGREDIENT") || text.Contains("REQUIRED") || text.Contains("MATERIAL")) { BetterUIStyler.Text(val, 13f, BetterUITheme.TextDim, (FontStyles)1); val.characterSpacing = 1.5f; } } } } private static void StyleProgress(CraftingProgressUI progress) { if (!((Object)(object)progress == (Object)null)) { CanvasGroup val = ((Component)progress).GetComponent(); if ((Object)(object)val == (Object)null) { val = ((Component)progress).gameObject.AddComponent(); } val.alpha = 0f; val.interactable = false; val.blocksRaycasts = false; } } private static void StyleTerminalToggle(MazeButton button, bool active) { //IL_0037: 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_0017: 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_0030: 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_0047: 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)button == (Object)null) { return; } Color val = (Color)(active ? BetterUITheme.CraftingSelected : new Color(BetterUITheme.PanelSoft.r, BetterUITheme.PanelSoft.g, BetterUITheme.PanelSoft.b, 0.62f)); Color hoverColor = (active ? BetterUITheme.CraftingSelectedHover : BetterUITheme.AccentSoft); Color val2 = (active ? BetterUITheme.Text : BetterUITheme.TextMuted); button.backgroundColor = val; button.hoverColor = hoverColor; button.textColor = val2; button.hoverTextColor = BetterUITheme.Text; MakeFlat(((Object)(object)button.backgroundImage != (Object)null) ? ((Il2CppObjectBase)button.backgroundImage).TryCast() : null, val, active ? BetterUITheme.Accent : BetterUITheme.Border); if ((Object)(object)button.buttonText != (Object)null) { ((TMP_Text)button.buttonText).text = RemoveCategoryNumberPrefix(((TMP_Text)button.buttonText).text); BetterUIStyler.Text((TMP_Text)(object)button.buttonText, 13f, val2, (FontStyles)1); ((TMP_Text)button.buttonText).characterSpacing = 0.8f; if ((Object)(object)((Component)button).transform.Find("BetterUI_CategoryIcon") != (Object)null) { ((TMP_Text)button.buttonText).alignment = (TextAlignmentOptions)4097; ((TMP_Text)button.buttonText).margin = new Vector4(42f, 0f, 8f, 0f); } } Transform val3 = ((Component)button).transform.Find("BetterUI_CategoryIcon"); RawImage val4 = (((Object)(object)val3 != (Object)null) ? ((Component)val3).GetComponent() : null); if ((Object)(object)val4 != (Object)null) { ((Graphic)val4).color = (active ? BetterUITheme.Text : BetterUITheme.TextMuted); val4.texture = (Texture)(object)BetterUITheme.GetCategoryIconTexture(((Object)(object)button.buttonText != (Object)null) ? ((TMP_Text)button.buttonText).text : string.Empty); NormalizeCategoryButtonGeometry(button); } button.UpdateVisualState(true); } private static void NormalizeCategoryButtonGeometry(MazeButton button) { if (!((Object)(object)button == (Object)null)) { RectTransform component = ((Component)button).GetComponent(); StretchCategoryChild(((Object)(object)button.backgroundImage != (Object)null) ? button.backgroundImage.rectTransform : null, component); StretchCategoryChild(((Object)(object)button.buttonText != (Object)null) ? ((TMP_Text)button.buttonText).rectTransform : null, component); } } private static void StretchCategoryChild(RectTransform child, RectTransform buttonRect) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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_0043: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)child == (Object)null) && !((Object)(object)buttonRect == (Object)null) && ((Object)child).GetInstanceID() != ((Object)buttonRect).GetInstanceID()) { ((Transform)child).localScale = Vector3.one; ((Transform)child).localRotation = Quaternion.identity; child.anchorMin = Vector2.zero; child.anchorMax = Vector2.one; child.pivot = new Vector2(0.5f, 0.5f); child.offsetMin = Vector2.zero; child.offsetMax = Vector2.zero; } } private static string RemoveCategoryNumberPrefix(string value) { string text = ((value != null) ? value.Trim() : string.Empty); if (text.Length == 0) { return text; } if (text[0] == '[') { int num = text.IndexOf(']'); if (num > 1) { bool flag = true; for (int i = 1; i < num; i++) { if (!char.IsDigit(text[i])) { flag = false; break; } } if (flag) { return text.Substring(num + 1).TrimStart(); } } } int j; for (j = 0; j < text.Length && char.IsDigit(text[j]); j++) { } if (j > 0 && j < text.Length) { char c = text[j]; if (char.IsWhiteSpace(c) || c == '.' || c == ':' || c == '-' || c == ')') { return text.Substring(j + 1).TrimStart(); } } return text; } private static void StyleTerminalAction(MazeButton button) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_0037: 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_004b: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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) if (!((Object)(object)button == (Object)null)) { button.backgroundColor = BetterUITheme.Accent; button.hoverColor = BetterUITheme.PrimaryHover; button.textColor = BetterUITheme.CraftingWell; button.hoverTextColor = BetterUITheme.CraftingWell; button._disabledBackgroundColor = new Color(BetterUITheme.TextDim.r, BetterUITheme.TextDim.g, BetterUITheme.TextDim.b, 0.24f); MakeFlat(((Object)(object)button.backgroundImage != (Object)null) ? ((Il2CppObjectBase)button.backgroundImage).TryCast() : null, BetterUITheme.Accent, BetterUITheme.PrimaryHover); if ((Object)(object)button.buttonText != (Object)null) { BetterUIStyler.Text((TMP_Text)(object)button.buttonText, 16f, BetterUITheme.CraftingWell, (FontStyles)1); ((TMP_Text)button.buttonText).characterSpacing = 1.4f; } button.UpdateVisualState(true); } } private static void StyleListIcon(ItemContainerUIBase slot, float size) { //IL_000c: 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) if (!((Object)(object)slot == (Object)null)) { StyleTerminalSlot(slot, size, BetterUITheme.BorderSoft, Color.clear, showBackground: false); } } private static void StyleTerminalSlot(ItemContainerUIBase slot, float size, Color border, Color? fillOverride = null, bool showBackground = true, bool prominentCount = false) { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)slot == (Object)null) { return; } Image itemImage = slot.itemImage; if ((Object)(object)itemImage != (Object)null) { ((Behaviour)itemImage).enabled = true; itemImage.preserveAspect = true; ((Graphic)itemImage).raycastTarget = false; } FitItemArtwork(slot, size); Image component = ((Component)slot).GetComponent(); bool flag = (Object)(object)component != (Object)null && (Object)(object)itemImage != (Object)null && ((Object)component).GetInstanceID() == ((Object)itemImage).GetInstanceID(); if ((Object)(object)component != (Object)null && !flag) { ((Behaviour)component).enabled = showBackground; if (showBackground) { MakeFlat(component, (Color)(((??)fillOverride) ?? BetterUITheme.Slot), border); } else { Il2CppArrayBase components = ((Component)component).GetComponents(); for (int i = 0; i < components.Length; i++) { if ((Object)(object)components[i] != (Object)null) { ((Behaviour)components[i]).enabled = false; } } } } ItemContainerUI val = ((Il2CppObjectBase)slot).TryCast(); if ((Object)(object)val != (Object)null) { RefreshCountBadge(val, prominentCount); } LayoutElement orAddLayout = GetOrAddLayout(((Component)slot).gameObject); orAddLayout.minWidth = size; orAddLayout.minHeight = size; orAddLayout.preferredWidth = size; orAddLayout.preferredHeight = size; orAddLayout.flexibleWidth = 0f; orAddLayout.flexibleHeight = 0f; } private static void FitItemArtwork(ItemContainerUIBase slot, float slotSize) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)slot == (Object)null) && !((Object)(object)slot.itemImage == (Object)null)) { RectTransform component = ((Component)slot).GetComponent(); RectTransform rectTransform = ((Graphic)slot.itemImage).rectTransform; if (!((Object)(object)component == (Object)null) && !((Object)(object)rectTransform == (Object)null) && ((Object)component).GetInstanceID() != ((Object)rectTransform).GetInstanceID()) { float num = ((slotSize <= 52f) ? 1f : 7f); rectTransform.anchorMin = Vector2.zero; rectTransform.anchorMax = Vector2.one; rectTransform.pivot = new Vector2(0.5f, 0.5f); rectTransform.offsetMin = new Vector2(num, num); rectTransform.offsetMax = new Vector2(0f - num, 0f - num); ((Transform)rectTransform).localScale = Vector3.one; ((Transform)rectTransform).localRotation = Quaternion.identity; ((Transform)rectTransform).SetAsFirstSibling(); } } } private static void RefreshCountBadge(ItemContainerUI itemSlot, bool prominent = false) { //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_020d: 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_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)itemSlot == (Object)null) { return; } TMP_Text itemCountTmp = (TMP_Text)(object)itemSlot.itemCountTmp; string text = ((!((Object)(object)itemCountTmp != (Object)null)) ? string.Empty : itemCountTmp.text?.Trim()); bool flag = !string.IsNullOrEmpty(text) && text != "0" && (prominent || text != "1"); float num = ((!prominent) ? ((text.Length > 2) ? 22f : 18f) : ((text.Length > 2) ? 26f : 22f)); float num2 = (prominent ? 18f : 16f); Image countBackgroundImage = itemSlot.countBackgroundImage; if ((Object)(object)countBackgroundImage != (Object)null) { ((Behaviour)countBackgroundImage).enabled = flag; ((Graphic)countBackgroundImage).raycastTarget = false; if (flag) { MakeFlat(countBackgroundImage, BetterUITheme.CountBackground, BetterUITheme.BorderSoft); RectTransform rectTransform = ((Graphic)countBackgroundImage).rectTransform; rectTransform.anchorMin = new Vector2(1f, 0f); rectTransform.anchorMax = new Vector2(1f, 0f); rectTransform.pivot = new Vector2(1f, 0f); rectTransform.anchoredPosition = (Vector2)(prominent ? new Vector2(-2f, 2f) : Vector2.zero); rectTransform.sizeDelta = new Vector2(num, num2); ((Transform)rectTransform).SetAsLastSibling(); } } if ((Object)(object)itemCountTmp == (Object)null) { return; } ((Behaviour)itemCountTmp).enabled = flag; if (flag) { BetterUIStyler.Text(itemCountTmp, prominent ? 12f : 11f, BetterUITheme.Text, (FontStyles)1); itemCountTmp.alignment = (TextAlignmentOptions)514; RectTransform rectTransform2 = itemCountTmp.rectTransform; if ((Object)(object)countBackgroundImage != (Object)null && (Object)(object)itemCountTmp.transform.parent == (Object)(object)((Component)countBackgroundImage).transform) { rectTransform2.anchorMin = Vector2.zero; rectTransform2.anchorMax = Vector2.one; rectTransform2.offsetMin = Vector2.zero; rectTransform2.offsetMax = Vector2.zero; } else { rectTransform2.anchorMin = new Vector2(1f, 0f); rectTransform2.anchorMax = new Vector2(1f, 0f); rectTransform2.pivot = new Vector2(1f, 0f); rectTransform2.anchoredPosition = (Vector2)(prominent ? new Vector2(-2f, 2f) : Vector2.zero); rectTransform2.sizeDelta = new Vector2(num, num2); ((Transform)rectTransform2).SetAsLastSibling(); } } } private static void MakeFlat(Image image, Color fill, Color border) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_005e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)image == (Object)null) { return; } ((Behaviour)image).enabled = true; ((Graphic)image).material = null; image.sprite = null; image.type = (Type)0; ((Graphic)image).color = fill; BetterUIStyler.Effects((Graphic)(object)image, border, addShadow: false); Outline component = ((Component)image).GetComponent(); if ((Object)(object)component != (Object)null) { ((Behaviour)component).enabled = true; ((Shadow)component).effectColor = border; ((Shadow)component).effectDistance = new Vector2(0.75f, -0.75f); ((Shadow)component).useGraphicAlpha = true; } Il2CppArrayBase components = ((Component)image).GetComponents(); for (int i = 0; i < components.Length; i++) { Shadow val = components[i]; if ((Object)(object)val != (Object)null && (Object)(object)((Il2CppObjectBase)val).TryCast() == (Object)null) { ((Behaviour)val).enabled = false; } } } private static void StyleItemSlot(ItemContainerUIBase slot, float size, Color border) { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)slot == (Object)null)) { Image itemImage = slot.itemImage; if ((Object)(object)itemImage != (Object)null) { itemImage.preserveAspect = true; } Image component = ((Component)slot).GetComponent(); bool flag = (Object)(object)component != (Object)null && (Object)(object)itemImage != (Object)null && ((Object)component).GetInstanceID() == ((Object)itemImage).GetInstanceID(); if ((Object)(object)component != (Object)null && !flag) { BetterUIStyler.RoundedImage(component, BetterUITheme.Slot); BetterUIStyler.Effects((Graphic)(object)component, border, addShadow: false); } ItemContainerUI val = ((Il2CppObjectBase)slot).TryCast(); if ((Object)(object)val != (Object)null) { BetterUIStyler.RoundedImage(val.countBackgroundImage, BetterUITheme.CountBackground); BetterUIStyler.Text((TMP_Text)(object)val.itemCountTmp, 16f, BetterUITheme.Text, (FontStyles)1); } LayoutElement orAddLayout = GetOrAddLayout(((Component)slot).gameObject); orAddLayout.minWidth = size; orAddLayout.minHeight = size; orAddLayout.preferredWidth = size; orAddLayout.preferredHeight = size; orAddLayout.flexibleWidth = 0f; orAddLayout.flexibleHeight = 0f; } } private static void AddAvailabilityRail(Transform card, Color color) { //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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("BetterUI_AvailabilityRail", (Type[])(object)new Type[4] { Il2CppType.Of(), Il2CppType.Of(), Il2CppType.Of(), Il2CppType.Of() }); val.transform.SetParent(card, false); RectTransform component = val.GetComponent(); component.anchorMin = new Vector2(0f, 0f); component.anchorMax = new Vector2(0f, 1f); component.pivot = new Vector2(0f, 0.5f); component.anchoredPosition = new Vector2(0f, 0f); component.sizeDelta = new Vector2(3f, 0f); ((Transform)component).SetAsLastSibling(); val.GetComponent().ignoreLayout = true; Image component2 = val.GetComponent(); ((Graphic)component2).raycastTarget = false; ((Graphic)component2).color = color; } private static Image GetOrCreateCardSurface(Transform card) { //IL_0042: 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_0054: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_00a0: Unknown result type (might be due to invalid IL or missing references) Image val = FindDecoration(card, "BetterUI_CardSurface"); if ((Object)(object)val != (Object)null) { return val; } GameObject val2 = new GameObject("BetterUI_CardSurface", (Type[])(object)new Type[4] { Il2CppType.Of(), Il2CppType.Of(), Il2CppType.Of(), Il2CppType.Of() }); val2.transform.SetParent(card, false); RectTransform component = val2.GetComponent(); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.pivot = new Vector2(0.5f, 0.5f); component.anchoredPosition = Vector2.zero; component.sizeDelta = Vector2.zero; ((Transform)component).SetAsFirstSibling(); val2.GetComponent().ignoreLayout = true; Image component2 = val2.GetComponent(); ((Graphic)component2).raycastTarget = false; return component2; } private static void ConfigureRecipeRow(CraftingRecipeUI recipe) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_027c: 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) if ((Object)(object)recipe == (Object)null || (Object)(object)((Component)recipe).transform.Find("BetterUI_RowContent") != (Object)null) { return; } GameObject val = new GameObject("BetterUI_RowContent", (Type[])(object)new Type[3] { Il2CppType.Of(), Il2CppType.Of(), Il2CppType.Of() }); val.transform.SetParent(((Component)recipe).transform, false); RectTransform component = val.GetComponent(); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.offsetMin = new Vector2(10f, 4f); component.offsetMax = new Vector2(-10f, -4f); ((Transform)component).SetAsLastSibling(); val.GetComponent().ignoreLayout = true; HorizontalLayoutGroup component2 = val.GetComponent(); ((LayoutGroup)component2).padding = CreatePadding(8, 8, 0, 0); ((HorizontalOrVerticalLayoutGroup)component2).spacing = 10f; ((LayoutGroup)component2).childAlignment = (TextAnchor)3; ((HorizontalOrVerticalLayoutGroup)component2).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)component2).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)component2).childForceExpandWidth = false; ((HorizontalOrVerticalLayoutGroup)component2).childForceExpandHeight = false; if ((Object)(object)recipe._outputItemContiner != (Object)null) { MoveRecipeElement(((Component)recipe._outputItemContiner).transform, (Transform)(object)component); } if ((Object)(object)recipe._outputItemName != (Object)null) { MoveRecipeElement(((TMP_Text)recipe._outputItemName).transform, (Transform)(object)component); LayoutElement orAddLayout = GetOrAddLayout(((Component)recipe._outputItemName).gameObject); orAddLayout.minWidth = 0f; orAddLayout.preferredWidth = 220f; orAddLayout.flexibleWidth = 1f; orAddLayout.minHeight = 44f; orAddLayout.preferredHeight = 44f; orAddLayout.flexibleHeight = 0f; ((TMP_Text)recipe._outputItemName).alignment = (TextAlignmentOptions)4097; ((TMP_Text)recipe._outputItemName).margin = Vector4.zero; GameObject obj = Object.Instantiate(((Component)recipe._outputItemName).gameObject, (Transform)(object)component, false); ((Object)obj).name = "BetterUI_RowStatus"; TMP_Text component3 = obj.GetComponent(); if ((Object)(object)component3 != (Object)null) { component3.text = string.Empty; component3.fontSize = 11f; component3.fontStyle = (FontStyles)1; ((Graphic)component3).color = BetterUITheme.TextUnavailable; component3.alignment = (TextAlignmentOptions)4100; component3.enableWordWrapping = false; ((Graphic)component3).raycastTarget = false; component3.margin = Vector4.zero; } RectTransform component4 = obj.GetComponent(); if ((Object)(object)component4 != (Object)null) { ((Transform)component4).localScale = Vector3.one; ((Transform)component4).localRotation = Quaternion.identity; component4.anchorMin = new Vector2(0.5f, 0.5f); component4.anchorMax = new Vector2(0.5f, 0.5f); component4.pivot = new Vector2(0.5f, 0.5f); component4.anchoredPosition = Vector2.zero; } LayoutElement orAddLayout2 = GetOrAddLayout(obj); orAddLayout2.minWidth = 76f; orAddLayout2.preferredWidth = 84f; orAddLayout2.flexibleWidth = 0f; orAddLayout2.minHeight = 44f; orAddLayout2.preferredHeight = 44f; orAddLayout2.flexibleHeight = 0f; } } private static void MoveRecipeElement(Transform element, Transform parent) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)element == (Object)null)) { element.SetParent(parent, false); RectTransform component = ((Component)element).GetComponent(); if ((Object)(object)component != (Object)null) { ((Transform)component).localScale = Vector3.one; ((Transform)component).localRotation = Quaternion.identity; component.anchorMin = new Vector2(0.5f, 0.5f); component.anchorMax = new Vector2(0.5f, 0.5f); component.pivot = new Vector2(0.5f, 0.5f); component.anchoredPosition = Vector2.zero; } } } private static void AddTerminalOverlay(RectTransform panel) { //IL_0048: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)panel == (Object)null) && !((Object)(object)((Transform)panel).Find("BetterUI_TerminalScanlines") != (Object)null)) { GameObject val = new GameObject("BetterUI_TerminalScanlines", (Type[])(object)new Type[4] { Il2CppType.Of(), Il2CppType.Of(), Il2CppType.Of(), Il2CppType.Of() }); val.transform.SetParent((Transform)(object)panel, false); RectTransform component = val.GetComponent(); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.pivot = new Vector2(0.5f, 0.5f); component.anchoredPosition = Vector2.zero; component.sizeDelta = Vector2.zero; ((Transform)component).SetAsLastSibling(); val.GetComponent().ignoreLayout = true; RawImage component2 = val.GetComponent(); component2.texture = (Texture)(object)BetterUITheme.ScanlineTexture; ((Graphic)component2).color = new Color(0f, 0f, 0f, 0.1f); component2.uvRect = new Rect(0f, 0f, 1f, 180f); ((Graphic)component2).raycastTarget = false; } } private static Image FindDecoration(Transform parent, string name) { if ((Object)(object)parent == (Object)null) { return null; } Transform val = parent.Find(name); if (!((Object)(object)val != (Object)null)) { return null; } return ((Component)val).GetComponent(); } private static bool LooksLikeUnavailableState(Color color) { //IL_0000: 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_0013: 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_0027: Unknown result type (might be due to invalid IL or missing references) if (color.r > 0.35f && color.r > color.g * 1.18f) { return color.r > color.b * 1.08f; } return false; } private static bool IsFilterActive(CraftingRecipeFilter mask, int buttonIndex) { //IL_001d: 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_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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_0037: Invalid comparison between Unknown and I4 CraftingRecipeFilter val; switch (buttonIndex) { case 0: val = (CraftingRecipeFilter)2; break; case 1: val = (CraftingRecipeFilter)1; break; case 2: val = (CraftingRecipeFilter)4; break; case 3: val = (CraftingRecipeFilter)16; break; case 4: val = (CraftingRecipeFilter)8; break; default: return false; } return (mask & val) > 0; } private static Transform FindCommonParent(MazeButton[] buttons) { Transform val = null; foreach (MazeButton val2 in buttons) { if (!((Object)(object)val2 == (Object)null)) { if ((Object)(object)val == (Object)null) { val = ((Component)val2).transform.parent; } else if ((Object)(object)((Component)val2).transform.parent == (Object)null || ((Object)((Component)val2).transform.parent).GetInstanceID() != ((Object)val).GetInstanceID()) { return null; } } } return val; } private static LayoutElement GetOrAddLayout(GameObject target) { LayoutElement component = target.GetComponent(); if (!((Object)(object)component != (Object)null)) { return target.AddComponent(); } return component; } private void RebuildOpeningLayouts() { if (_layoutRebuildPasses > 0) { _layoutRebuildPasses--; Canvas.ForceUpdateCanvases(); RectTransform val = (((Object)(object)_replacementRoot != (Object)null) ? _replacementRoot.GetComponent() : null); if ((Object)(object)val != (Object)null) { LayoutRebuilder.ForceRebuildLayoutImmediate(val); } RectTransform val2 = (((Object)(object)_recipeContainer != (Object)null) ? ((Component)_recipeContainer).GetComponent() : null); if ((Object)(object)val2 != (Object)null) { LayoutRebuilder.ForceRebuildLayoutImmediate(val2); } Canvas.ForceUpdateCanvases(); } } private static int GetHierarchyStamp(Transform container) { int childCount = container.childCount; int num = childCount * 397; if (childCount > 0) { Transform child = container.GetChild(0); Transform child2 = container.GetChild(childCount - 1); num = (num * 397) ^ (((Object)(object)child != (Object)null) ? ((Object)child).GetInstanceID() : 0); num = (num * 397) ^ (((Object)(object)child2 != (Object)null) ? ((Object)child2).GetInstanceID() : 0); } return num; } private static RectOffset CreatePadding(int left, int right, int top, int bottom) { //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_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) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown return new RectOffset { left = left, right = right, top = top, bottom = bottom }; } private static Transform FindNamedDescendant(Transform root, string name) { if ((Object)(object)root == (Object)null) { return null; } if (((Object)root).name == name) { return root; } for (int i = 0; i < root.childCount; i++) { Transform val = FindNamedDescendant(root.GetChild(i), name); if ((Object)(object)val != (Object)null) { return val; } } return null; } private static RectTransform FindReplacementPanel(Transform title) { Transform val = title; while ((Object)(object)val != (Object)null) { if (((Object)val).name == "BetterUI_CraftingMenu") { return ((Component)val).GetComponent(); } val = val.parent; } if (!((Object)(object)title != (Object)null) || !((Object)(object)title.parent != (Object)null)) { return null; } return ((Component)title.parent).GetComponent(); } private static bool SameObject(Object left, Object right) { if (left != (Object)null && right != (Object)null) { return left.GetInstanceID() == right.GetInstanceID(); } return false; } } internal static class PluginInfo { internal const string Guid = "com.holden.infernoprotocol.betterui"; internal const string Name = "BetterUI"; internal const string Version = "0.9.5"; }