Decompiled source of AAA Crafting v2.0.2
AzuAntiArthriticCrafting.dll
Decompiled 3 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Linq.Expressions; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using System.Threading; using Auga; using AzuAntiArthriticCrafting; using AzuAntiArthriticCrafting.Compatibility; using AzuAntiArthriticCrafting.Compatibility.CraftFromContainers; using AzuAntiArthriticCrafting.Compatibility.OdinsCraftyBoxes; using AzuAntiArthriticCrafting.Compatibility.TillValhalla; using AzuAntiArthriticCrafting.Handlers; using AzuAntiArthriticCrafting.Patches; using AzuAntiArthriticCrafting.Patches.Filtering; using AzuAntiArthriticCrafting.RecipeTracking; using AzuAntiArthriticCrafting.RecipeTracking.Favoriting; using AzuAntiArthriticCrafting.Utilities; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using Fishlabs; using HarmonyLib; using JetBrains.Annotations; using Jewelcrafting; using LocalizationManager; using Microsoft.CodeAnalysis; using ServerSync; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; using YamlDotNet.Core; using YamlDotNet.Core.Events; using YamlDotNet.Core.ObjectPool; using YamlDotNet.Core.Tokens; using YamlDotNet.Helpers; using YamlDotNet.Serialization; using YamlDotNet.Serialization.BufferedDeserialization; using YamlDotNet.Serialization.BufferedDeserialization.TypeDiscriminators; using YamlDotNet.Serialization.Callbacks; using YamlDotNet.Serialization.Converters; using YamlDotNet.Serialization.EventEmitters; using YamlDotNet.Serialization.NamingConventions; using YamlDotNet.Serialization.NodeDeserializers; using YamlDotNet.Serialization.NodeTypeResolvers; using YamlDotNet.Serialization.ObjectFactories; using YamlDotNet.Serialization.ObjectGraphTraversalStrategies; using YamlDotNet.Serialization.ObjectGraphVisitors; using YamlDotNet.Serialization.Schemas; using YamlDotNet.Serialization.TypeInspectors; using YamlDotNet.Serialization.TypeResolvers; using YamlDotNet.Serialization.Utilities; using YamlDotNet.Serialization.ValueDeserializers; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("AzuAntiArthriticCrafting")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Azumatt")] [assembly: AssemblyProduct("AzuAntiArthriticCrafting")] [assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("4358610B-F3F4-4843-B7AF-98B7BC60DCDE")] [assembly: AssemblyFileVersion("2.0.2")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.0.2.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } [RequireComponent(typeof(Image))] public class PointerHandler : MonoBehaviour, IPointerDownHandler, IEventSystemHandler, IPointerClickHandler { private Button _button; private Graphic _graphic; private void Awake() { //IL_0039: 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_0055: 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) _button = ((Component)this).GetComponent<Button>(); _graphic = (Graphic)(((object)((Component)this).GetComponent<Graphic>()) ?? ((object)((Component)this).gameObject.AddComponent<Image>())); _graphic.raycastTarget = true; if (_graphic.color.a == 0f) { Color color = _graphic.color; color.a = 0.001f; _graphic.color = color; } } private void OnEnable() { if ((Object)(object)_button != (Object)null) { FavoriteManager._filterRowButtons.Add(_button); } } private void OnDisable() { if ((Object)(object)_button != (Object)null) { FavoriteManager._filterRowButtons.Remove(_button); } } public void OnPointerDown(PointerEventData e) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 if ((int)e.button == 1) { HandleRightClick(e); } } public void OnPointerClick(PointerEventData e) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 if ((int)e.button == 1) { HandleRightClick(e); } } private void HandleRightClick(PointerEventData e) { ((AbstractEventData)e).Use(); foreach (Button filterRowButton in FavoriteManager._filterRowButtons) { if ((Object)(object)filterRowButton == (Object)null || !((Behaviour)filterRowButton).isActiveAndEnabled) { continue; } Transform val = ((Component)filterRowButton).transform.Find("Glow"); if (!Object.op_Implicit((Object)(object)val)) { continue; } bool activeSelf = ((Component)val).gameObject.activeSelf; if ((Object)(object)((Component)filterRowButton).gameObject == (Object)(object)((Component)this).gameObject) { if (!activeSelf) { ((UnityEvent)filterRowButton.onClick).Invoke(); } } else if (activeSelf) { ((UnityEvent)filterRowButton.onClick).Invoke(); } } } } [HarmonyPatch(typeof(Hud), "Awake")] internal static class HudAwakePatchAddTutOverlay { private static void Postfix(Hud __instance) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.Find("TutorialOverlay"); if ((Object)(object)((obj != null) ? obj.gameObject : null) == (Object)null) { GameObject val = new GameObject("TutorialOverlay"); val.transform.SetParent(GameObject.Find("_GameMain/LoadingGUI/PixelFix/IngameGui/Tutorial/").transform, false); val.AddComponent<TutorialOverlay>(); } } } public class TutorialOverlay : MonoBehaviour { [Serializable] public class TutorialStep { public string title; public string description; public TutorialTargetType targetType; } public enum TutorialTargetType { CraftingPanel, RecipeTrackerIcon, Grid, CraftAmountInput, CraftAmountMinus, CraftAmountPlus, MaxAmountText, FilterRow, AdvFilters, SearchAndPagination } public RectTransform? targetUIElement; public Color overlayColor = new Color(0f, 0f, 0f, 0.95f); private Image overlayImage; private Material overlayMaterial; private GameObject tutorialTextPanel; private int currentStep; internal bool tutorialActive; private static readonly string TutorialKey = "AAA_HasSeenCraftingTutorial"; internal static TutorialOverlay instance = null; private readonly TutorialStep[] tutorialSteps = new TutorialStep[15] { new TutorialStep { title = "Welcome to Anti-Arthritic Crafting!", description = "This tutorial will guide you through the new crafting amount controls.The tutorial is only going to show you once per install on a computer. If you wish to see the tutorial again, you can view it by clicking the question mark on the right side of the crafting panel.\n\n<color=yellow>Click 'Next' to continue!</color>", targetType = TutorialTargetType.CraftingPanel }, new TutorialStep { title = "Crafting Panel", description = "This is your crafting panel. It contains all the new features added by the Anti-Arthritic Crafting mod.\nThis includes searching/filtering, multicrafting, and a nice grid layout.\n\n<color=yellow>Click 'Next' to continue!</color>", targetType = TutorialTargetType.CraftingPanel }, new TutorialStep { title = "Search and Pagination", description = "This is your search bar and pagination controls. You can use these to quickly find recipes.\n You can use modifiers like ! and @ to refine your search.\n Prefix searches with `!` to find items based on their crafting requirements\n Prefix searches with `@` followed by the mod name to find items added by a particular mod. (e.g., @jewelcrafting\n\n<color=yellow>Click 'Next' to continue!</color>", targetType = TutorialTargetType.SearchAndPagination }, new TutorialStep { title = "Filter Row", description = "This is your filter row. You can use these buttons to filter recipes by category. Ammo, Weapons, Bows, Armor, Shields, Tools, Food & Meads/Potions.\n Right clicking the button will isolate to that one filter (disabling all others in the filter row)\n\n<color=yellow>Click 'Next' to continue!</color>", targetType = TutorialTargetType.FilterRow }, new TutorialStep { title = "Special Filters", description = "These special buttons let you quickly find recipes based on specific criteria or delete favorites\n\n• <color=orange>Funnel</color> = Advanced Filters\n\n• <color=#00FFFF>Star</color> = Filters to Favorites only\n• <color=green>Trash Bin</color> = Deletes all saved favorites\n\n<color=yellow>Click 'Next' to continue!</color>", targetType = TutorialTargetType.AdvFilters }, new TutorialStep { title = "Crafting Grid", description = "This is your crafting grid. It's one of the biggest notable changes to the recipe view. It's icon only, but hovering over an item will show it's name immediately. You can also see the stars here used for favoriting a specific recipe\n\n<color=yellow>Click 'Next' to continue!</color>", targetType = TutorialTargetType.Grid }, new TutorialStep { title = "Scrolling the Grid", description = "If you have many recipes, you can scroll through them using your mouse wheel or gamepad joystick while hovering over the grid.\n\n<color=yellow>Try scrolling now!</color>", targetType = TutorialTargetType.Grid }, new TutorialStep { title = "Recipe Tracker", description = "Hovering over the recipe's icon will show a plus symbol. This will allow you to track the recipe's resources via an on-screen UI.\n<color=orange>Hold CTRL</color> = Turns the icon to a minus for removing the recipe from the tracker.\n\n<color=yellow>Try hovering over a recipe now and testing it out!</color>", targetType = TutorialTargetType.RecipeTrackerIcon }, new TutorialStep { title = "Crafting Amount Input", description = "This is your crafting amount input field.\n\n<color=yellow>Click here to type a number directly!</color>\n\nTry typing '10' to craft 10 items at once.", targetType = TutorialTargetType.CraftAmountInput }, new TutorialStep { title = "Mouse Wheel Control", description = "<color=#00afd4>Hover over the input field and scroll your mouse wheel!</color>\n\n• Scroll UP = Increase amount\n• Scroll DOWN = Decrease amount", targetType = TutorialTargetType.CraftAmountInput }, new TutorialStep { title = "Modifier Keys", description = "<color=#006648>Hold SHIFT + scroll</color> = Change by 10\n<color=orange>Hold CTRL + scroll</color> = Jump to maximum\n\nThese shortcuts make bulk crafting easy!", targetType = TutorialTargetType.CraftAmountInput }, new TutorialStep { title = "Plus Button", description = "This is the <color=green>Plus (+)</color> button.\n\n<color=yellow>Click it to increase the amount by 1!</color>\n\nTry clicking it a few times.", targetType = TutorialTargetType.CraftAmountPlus }, new TutorialStep { title = "Minus Button", description = "This is the <color=red>Minus (-)</color> button.\n\n<color=yellow>Click it to decrease the amount by 1!</color>\n\nTry clicking it a few times.", targetType = TutorialTargetType.CraftAmountMinus }, new TutorialStep { title = "Value Changed by Typing", description = "Great! You can also type directly into the input field to set your desired crafting amount.\n\n<color=yellow>Click the input field and type a number!</color>", targetType = TutorialTargetType.CraftAmountInput }, new TutorialStep { title = "Maximum Amount Display", description = "Look at this text!\n\n<color=yellow>The 'Max: X' text shows how many you can craft</color>\n\nThis helps you know your limits before crafting.", targetType = TutorialTargetType.MaxAmountText } }; private void OnEnable() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_007a: 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_0090: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_00c0: 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_0024: 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) Canvas val = ((Component)((Component)this).transform.parent).GetComponent<Canvas>(); if ((Object)(object)val == (Object)null) { GameObject val2 = new GameObject("TutorialOverlayCanvas"); val = val2.AddComponent<Canvas>(); val.renderMode = (RenderMode)0; val2.AddComponent<CanvasScaler>(); val2.AddComponent<GraphicRaycaster>(); val.sortingOrder = 99999; } GameObject val3 = new GameObject("TutorialOverlayImage"); val3.transform.SetParent(((Component)val).transform, false); overlayImage = val3.AddComponent<Image>(); RectTransform component = val3.GetComponent<RectTransform>(); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.offsetMin = Vector2.zero; component.offsetMax = Vector2.zero; overlayMaterial = new Material(AzuAntiArthriticCraftingPlugin.overlayShader); overlayMaterial.SetColor("_Color", overlayColor); ((Graphic)overlayImage).material = overlayMaterial; ((Graphic)overlayImage).raycastTarget = false; instance = this; CreateTutorialTextPanel(((Component)val).transform); ((Behaviour)overlayImage).enabled = false; tutorialTextPanel.SetActive(false); } private void UpdateHole() { //IL_001a: 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_0090: 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_0094: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_010e: 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_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) if (!InventoryGui.IsVisible()) { ((Behaviour)overlayImage).enabled = false; return; } Rect worldRect = UiFinder.GetWorldRect(targetUIElement); bool flag = ((Rect)(ref worldRect)).width > 1f && ((Rect)(ref worldRect)).height > 1f; ((Behaviour)overlayImage).enabled = flag; if (flag) { float num = Screen.width; float num2 = Screen.height; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(((Rect)(ref worldRect)).xMin / num, ((Rect)(ref worldRect)).yMin / num2); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(((Rect)(ref worldRect)).xMax / num, ((Rect)(ref worldRect)).yMax / num2); Vector2 val3 = (val + val2) * 0.5f; Vector2 val4 = val2 - val; val4.x = Mathf.Clamp01(val4.x); val4.y = Mathf.Clamp01(val4.y); val3.x = Mathf.Clamp01(val3.x); val3.y = Mathf.Clamp01(val3.y); overlayMaterial.SetVector("_HoleRect", new Vector4(val3.x, val3.y, val4.x, val4.y)); } } private void CreateTutorialTextPanel(Transform canvasTransform) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0082: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: 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_010f: Expected O, but got Unknown //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0149: 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_017e: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_0213: 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) tutorialTextPanel = new GameObject("TutorialTextPanel", new Type[4] { typeof(RectTransform), typeof(Image), typeof(VerticalLayoutGroup), typeof(GraphicRaycaster) }); tutorialTextPanel.transform.SetParent(canvasTransform, false); tutorialTextPanel.transform.SetAsLastSibling(); RectTransform component = tutorialTextPanel.GetComponent<RectTransform>(); component.anchorMin = new Vector2(0.3f, 0.05f); component.anchorMax = new Vector2(0.7f, 0.3f); component.offsetMin = Vector2.zero; component.offsetMax = Vector2.zero; Image component2 = tutorialTextPanel.GetComponent<Image>(); ((Graphic)component2).color = new Color(0.05f, 0.05f, 0.05f, 0.92f); ((Graphic)component2).raycastTarget = true; VerticalLayoutGroup component3 = tutorialTextPanel.GetComponent<VerticalLayoutGroup>(); ((HorizontalOrVerticalLayoutGroup)component3).spacing = 10f; ((LayoutGroup)component3).padding = new RectOffset(15, 15, 15, 15); ((HorizontalOrVerticalLayoutGroup)component3).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)component3).childControlHeight = true; ((LayoutGroup)component3).childAlignment = (TextAnchor)4; CreateTutorialText("TitleText", "", 18, (FontStyles)1, Color.yellow); CreateTutorialText("DescriptionText", "", 15, (FontStyles)0, Color.white); GameObject val = new GameObject("ButtonContainer", new Type[2] { typeof(RectTransform), typeof(HorizontalLayoutGroup) }); val.transform.SetParent(tutorialTextPanel.transform, false); HorizontalLayoutGroup component4 = val.GetComponent<HorizontalLayoutGroup>(); ((HorizontalOrVerticalLayoutGroup)component4).spacing = 8f; ((LayoutGroup)component4).childAlignment = (TextAnchor)4; ((HorizontalOrVerticalLayoutGroup)component4).childControlWidth = false; ((HorizontalOrVerticalLayoutGroup)component4).childControlHeight = false; CreateTutorialButton(val.transform, "Previous", Color.gray, delegate { PreviousStep(); }); Color color = default(Color); ColorUtility.TryParseHtmlString("#006000", ref color); CreateTutorialButton(val.transform, "Next", color, delegate { NextStep(); }); CreateTutorialButton(val.transform, "Skip", Color.red, delegate { EndTutorial(skipped: true); }); CreateTutorialText("StepCounter", "", 13, (FontStyles)2, Color.gray); } private void CreateTutorialText(string name, string text, int fontSize, FontStyles fontStyle, Color color) { //IL_0021: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name, new Type[2] { typeof(RectTransform), typeof(TextMeshProUGUI) }); val.transform.SetParent(tutorialTextPanel.transform, false); val.SetActive(false); TextMeshProUGUI component = val.GetComponent<TextMeshProUGUI>(); ((TMP_Text)component).text = text; ((TMP_Text)component).font = InventoryGui.instance.m_armor.font; ((TMP_Text)component).fontSize = fontSize; ((TMP_Text)component).fontStyle = fontStyle; ((Graphic)component).color = color; ((TMP_Text)component).alignment = (TextAlignmentOptions)257; ((Graphic)component).raycastTarget = false; ((TMP_Text)component).enableWordWrapping = true; ((Component)component).gameObject.SetActive(true); } private void CreateTutorialButton(Transform parent, string text, Color color, Action onClick) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown //IL_00e5: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0103: 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_0115: 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_012a: 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_0167: Unknown result type (might be due to invalid IL or missing references) string text2 = text; Action onClick2 = onClick; GameObject val = new GameObject("Button_" + text2, new Type[3] { typeof(RectTransform), typeof(Image), typeof(Button) }); val.transform.SetParent(parent, false); val.GetComponent<RectTransform>().sizeDelta = new Vector2(80f, 30f); Image component = val.GetComponent<Image>(); ((Graphic)component).color = color; ((Graphic)component).raycastTarget = true; Button component2 = val.GetComponent<Button>(); ((Selectable)component2).interactable = true; component2.onClick = new ButtonClickedEvent(); ((UnityEvent)component2.onClick).AddListener((UnityAction)delegate { AzuAntiArthriticCraftingPlugin.AntiArthriticCraftingLogger.LogDebug((object)("Tutorial button clicked: " + text2)); onClick2?.Invoke(); }); GameObject val2 = new GameObject("ButtonText", new Type[2] { typeof(RectTransform), typeof(TextMeshProUGUI) }); val2.transform.SetParent(val.transform, false); val2.SetActive(false); RectTransform component3 = val2.GetComponent<RectTransform>(); component3.anchorMin = Vector2.zero; component3.anchorMax = Vector2.one; component3.offsetMin = Vector2.zero; component3.offsetMax = Vector2.zero; TextMeshProUGUI component4 = val2.GetComponent<TextMeshProUGUI>(); ((TMP_Text)component4).text = text2; ((TMP_Text)component4).font = InventoryGui.instance.m_armor.font; ((TMP_Text)component4).fontSize = 12f; ((Graphic)component4).color = Color.white; ((TMP_Text)component4).alignment = (TextAlignmentOptions)514; ((Graphic)component4).raycastTarget = false; val2.gameObject.SetActive(true); } public static void StartCraftingTutorial() { if (!((Object)(object)instance == (Object)null) && PlayerPrefs.GetInt(TutorialKey, 0) != 1) { instance.StartTutorial(); } } public static void StartCraftingTutorialForced() { if (!((Object)(object)instance == (Object)null)) { instance.StartTutorial(); } } private void StartTutorial() { currentStep = 0; tutorialActive = true; UpdateTutorialStep(); } private void UpdateTutorialStep() { if (currentStep >= tutorialSteps.Length) { return; } TutorialStep tutorialStep = tutorialSteps[currentStep]; SetTargetForStep(tutorialStep.targetType); Transform val = tutorialTextPanel.transform.Find("TitleText"); if ((Object)(object)val != (Object)null) { ((TMP_Text)((Component)val).GetComponent<TextMeshProUGUI>()).text = tutorialStep.title; } Transform val2 = tutorialTextPanel.transform.Find("DescriptionText"); if ((Object)(object)val2 != (Object)null) { ((TMP_Text)((Component)val2).GetComponent<TextMeshProUGUI>()).text = tutorialStep.description; } Transform val3 = tutorialTextPanel.transform.Find("StepCounter"); if ((Object)(object)val3 != (Object)null) { ((TMP_Text)((Component)val3).GetComponent<TextMeshProUGUI>()).text = $"Step {currentStep + 1} of {tutorialSteps.Length}"; } Transform val4 = tutorialTextPanel.transform.Find("ButtonContainer"); if ((Object)(object)val4 != (Object)null) { Transform val5 = val4.Find("Button_Previous"); if ((Object)(object)val5 != (Object)null) { ((Selectable)((Component)val5).GetComponent<Button>()).interactable = currentStep > 0; } } UpdateHole(); ((Behaviour)overlayImage).enabled = true; tutorialTextPanel.SetActive(true); } private void SetTargetForStep(TutorialTargetType targetType) { RectTransform val = null; switch (targetType) { case TutorialTargetType.CraftingPanel: val = UiFinder.TryMany("_GameMain/LoadingGUI/PixelFix/IngameGui/Inventory_screen/root/Crafting/", "Crafting"); break; case TutorialTargetType.RecipeTrackerIcon: val = (RectTransform)(Object.op_Implicit((Object)(object)InventoryGui.instance) ? ((object)/*isinst with value type is only supported in some contexts*/) : ((object)UiFinder.TryMany("_GameMain/LoadingGUI/PixelFix/IngameGui/Inventory_screen/root/Crafting/Decription/_GameMain/LoadingGUI/PixelFix/IngameGui/Inventory_screen/root/Crafting/Decription/Icon"))); break; case TutorialTargetType.AdvFilters: if (Object.op_Implicit((Object)(object)FavoriteManager._rightFilterRow)) { val = ((Component)FavoriteManager._rightFilterRow).GetComponent<RectTransform>(); } if (!Object.op_Implicit((Object)(object)val)) { val = UiFinder.TryMany("AAA_FilterRow"); } break; case TutorialTargetType.CraftAmountInput: val = UiFinder.TryMany("AAA_AmountInput"); break; case TutorialTargetType.CraftAmountMinus: val = UiFinder.TryMany("AAA_AmountMinus"); break; case TutorialTargetType.CraftAmountPlus: val = UiFinder.TryMany("AAA_AmountPlus"); break; case TutorialTargetType.MaxAmountText: val = UiFinder.TryMany("AAAMaxCraftAmountText"); if (!Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)InventoryGui.instance) && Object.op_Implicit((Object)(object)InventoryGui.instance.m_craftButton)) { val = ((Component)InventoryGui.instance.m_craftButton).GetComponent<RectTransform>(); } break; case TutorialTargetType.Grid: val = UiFinder.TryMany("RecipeList/Recipes", "_GameMain/LoadingGUI/PixelFix/IngameGui/Inventory_screen/root/Crafting/RecipeList/Recipes"); break; case TutorialTargetType.FilterRow: val = UiFinder.TryMany("AAA_FilterRow"); break; case TutorialTargetType.SearchAndPagination: if (Object.op_Implicit((Object)(object)PaginatorPatches.CraftingWindowPaginator)) { val = PaginatorPatches.CraftingWindowPaginator.GetComponent<RectTransform>(); } if (!Object.op_Implicit((Object)(object)val)) { val = UiFinder.TryMany("Pagination_Horizontal(Clone)", "Pagination_Horizontal"); } break; } targetUIElement = val; } private void NextStep() { currentStep++; if (currentStep >= tutorialSteps.Length) { EndTutorial(skipped: false); } else { UpdateTutorialStep(); } } private void PreviousStep() { if (currentStep > 0) { currentStep--; UpdateTutorialStep(); } } private void EndTutorial(bool skipped) { tutorialActive = false; ((Behaviour)overlayImage).enabled = false; tutorialTextPanel.SetActive(false); Time.timeScale = 1f; PlayerPrefs.SetInt(TutorialKey, 1); PlayerPrefs.Save(); } private void Update() { if (tutorialActive) { if (Input.GetKeyDown((KeyCode)27)) { EndTutorial(skipped: true); } if (currentStep < tutorialSteps.Length) { UpdateHole(); } } } public static void ResetTutorial() { PlayerPrefs.DeleteKey(TutorialKey); } } public sealed class VariantTag : MonoBehaviour { public int Variant; } [HarmonyPatch(typeof(ObjectDB), "Awake")] internal static class AddVariantsToObjectDBAwakePatch { [HarmonyPriority(0)] private static void Postfix(ObjectDB __instance) { List<GameObject> items = __instance.m_items; if (items == null || __instance.m_recipes == null) { return; } List<Recipe> list = new List<Recipe>(); foreach (GameObject item in items) { ItemDrop drop = (Object.op_Implicit((Object)(object)item) ? item.GetComponent<ItemDrop>() : null); SharedData val = ((!Object.op_Implicit((Object)(object)drop)) ? null : drop.m_itemData?.m_shared); if (val == null) { continue; } int variants = val.m_variants; if (variants <= 1 || !__instance.m_recipes.Any(delegate(Recipe r) { if (Object.op_Implicit((Object)(object)r) && (Object)(object)r.m_item == (Object)(object)drop) { Requirement[] resources = r.m_resources; if (resources != null) { return resources.Length > 0; } return false; } return false; })) { continue; } Recipe val2 = ((IEnumerable<Recipe>)__instance.m_recipes).FirstOrDefault((Func<Recipe, bool>)((Recipe r) => Object.op_Implicit((Object)(object)r) && (Object)(object)r.m_item == (Object)(object)drop)); if (!Object.op_Implicit((Object)(object)val2) || (Object)(object)val2.m_item == (Object)null || (Object)(object)val2.m_item.m_itemData.GetIcon() == (Object)null || val2.m_item.m_itemData == null || val2.m_item.m_itemData.m_shared == null) { continue; } for (int i = 1; i < variants; i++) { Sprite[] array = val2.m_item?.m_itemData?.m_shared?.m_icons; if (array != null && i < array.Length && (Object)(object)array[i] != (Object)null) { CreateVariantRecipe(val2, i, out Recipe clone); list.Add(clone); } } } if (list.Count > 0) { list.Sort(delegate(Recipe a, Recipe b) { Utilities.TryGetVariantFromRecipeName(((Object)a).name, out var variant); Utilities.TryGetVariantFromRecipeName(((Object)b).name, out var variant2); return variant.CompareTo(variant2); }); __instance.m_recipes.AddRange(list); __instance.UpdateRegisters(); } } public static void CreateVariantRecipe(Recipe recipe, int variant, out Recipe clone) { //IL_007c: 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_008d: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown clone = ScriptableObject.CreateInstance<Recipe>(); ((Object)clone).name = $"{((Object)recipe).name}_var{variant}"; clone.m_item = recipe.m_item; clone.m_craftingStation = recipe.m_craftingStation; clone.m_repairStation = recipe.m_repairStation; if (recipe.m_resources != null) { clone.m_resources = (Requirement[])(object)new Requirement[recipe.m_resources.Length]; for (int i = 0; i < recipe.m_resources.Length; i++) { Requirement val = recipe.m_resources[i]; clone.m_resources[i] = new Requirement { m_resItem = val.m_resItem, m_amount = val.m_amount, m_amountPerLevel = val.m_amountPerLevel, m_recover = val.m_recover }; } } clone.m_amount = recipe.m_amount; clone.m_minStationLevel = recipe.m_minStationLevel; clone.m_enabled = recipe.m_enabled; clone.m_requireOnlyOneIngredient = recipe.m_requireOnlyOneIngredient; clone.m_qualityResultAmountMultiplier = recipe.m_qualityResultAmountMultiplier; clone.m_listSortWeight = recipe.m_listSortWeight; } } [HarmonyPatch(typeof(InventoryGui), "SetRecipe")] internal static class SetRecipe_ApplyVariantFromName { private static void Postfix(InventoryGui __instance, int index, ref bool center) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (index < 0 || index >= __instance.m_availableRecipes.Count) { return; } RecipeDataPair val = __instance.m_availableRecipes[index]; Recipe recipe = ((RecipeDataPair)(ref val)).Recipe; if (!Object.op_Implicit((Object)(object)recipe) || !Utilities.TryGetVariantFromRecipeName(((Object)recipe).name, out var variant)) { return; } __instance.m_selectedVariant = variant; TMP_Text recipeName = __instance.m_recipeName; if (Object.op_Implicit((Object)(object)recipeName)) { string text = recipeName.text; int num = text.IndexOf(" #", StringComparison.Ordinal); if (num >= 0) { text = text.Substring(0, num); } recipeName.text = $"{text} #{variant + 1}"; } if (Object.op_Implicit((Object)(object)DescriptionExpander.scrollRect)) { DescriptionExpander.scrollRect.verticalNormalizedPosition = 1f; } center = false; } } [HarmonyPatch(typeof(InventoryGui), "AddRecipeToList")] internal static class AddRecipeToList_VariantIcon { private static bool Prefix(InventoryGui __instance, Player player, Recipe recipe, ItemData item, bool canCraft) { int variant; if (item != null) { return !Utilities.TryGetVariantFromRecipeName(((Object)recipe).name, out variant); } return true; } private static void Postfix(InventoryGui __instance, Player player, Recipe recipe, ItemData item, bool canCraft) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_0069: 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 (!Utilities.TryGetVariantFromRecipeName(((Object)recipe).name, out var variant)) { return; } List<RecipeDataPair> availableRecipes = __instance.m_availableRecipes; if (availableRecipes == null || availableRecipes.Count == 0) { return; } RecipeDataPair val = default(RecipeDataPair); bool flag = false; for (int num = availableRecipes.Count - 1; num >= 0; num--) { RecipeDataPair val2 = availableRecipes[num]; if (!((Object)(object)((RecipeDataPair)(ref val2)).Recipe != (Object)(object)recipe)) { val2 = availableRecipes[num]; if (((RecipeDataPair)(ref val2)).ItemData == item) { val = availableRecipes[num]; flag = true; break; } } } if (!flag) { val = availableRecipes[availableRecipes.Count - 1]; } GameObject interfaceElement = ((RecipeDataPair)(ref val)).InterfaceElement; if (!Object.op_Implicit((Object)(object)interfaceElement)) { return; } Transform val3 = interfaceElement.transform.Find("icon"); if (Object.op_Implicit((Object)(object)val3)) { Image component = ((Component)val3).GetComponent<Image>(); Sprite[] array = ((!Object.op_Implicit((Object)(object)recipe.m_item)) ? null : recipe.m_item.m_itemData?.m_shared)?.m_icons; if ((Object)(object)component != (Object)null && array != null && variant >= 0 && variant < array.Length && (Object)(object)array[variant] != (Object)null) { component.sprite = array[variant]; } } (interfaceElement.GetComponent<VariantTag>() ?? interfaceElement.AddComponent<VariantTag>()).Variant = variant; } } [HarmonyPatch(typeof(InventoryGui), "DoCrafting")] public static class InventoryGui_DoCrafting_Patch { public static bool callingDoCrafting = false; public static int cachedMaxSockets = 3; public static int cachedLimitNumberOfSockets = 0; public static int[] cachedSocketLimits; public static void Prefix(InventoryGui __instance, Player player) { callingDoCrafting = true; } } [HarmonyPatch(typeof(InventoryGui), "UpdateRecipe")] internal static class InventoryGuiUpdateRecipePatch { private static void Postfix(InventoryGui __instance, Player player) { if (!InventoryGui_DoCrafting_Patch.callingDoCrafting) { return; } int num = HaveRequirementItemsTranspiler.GetCurrentCraftAmount() - 1; if (!__instance.InCraftTab() && !__instance.InUpradeTab() && Jewelcrafting.API.IsLoaded() && Jewelcrafting.API.IsLoaded()) { Transform val = Utils.FindChild(((Component)__instance.m_tabUpgrade).transform.parent, "UPGRADE(Clone)", (IterativeSearchType)0); if ((Object)(object)val != (Object)null && ((Component)val).gameObject.activeSelf) { AzuAntiArthriticCraftingPlugin.AntiArthriticCraftingLogger.LogDebug((object)"Upgrade tab is active, setting desired amount to respect socket limits."); num = 0; } } for (int i = 0; i < num; i++) { InventoryGui_DoCrafting_Patch.callingDoCrafting = false; __instance.DoCrafting(player); } InventoryGui_DoCrafting_Patch.callingDoCrafting = false; } } public static class RecipeNameHelper { private static readonly Regex TagRegex = new Regex("<.*?>", RegexOptions.Compiled); public static string GetCleanName(Recipe r) { string text = r?.m_item?.m_itemData?.m_shared?.m_name ?? ""; if (string.IsNullOrWhiteSpace(text)) { return ""; } return Regex.Replace(new string((from c in TagRegex.Replace(text, "").Replace("$", "").Normalize(NormalizationForm.FormKD) where !char.IsControl(c) select c).ToArray()), "\\s+", " ").Trim().ToLowerInvariant(); } public static string CleanString(string raw) { if (string.IsNullOrWhiteSpace(raw)) { return ""; } return Regex.Replace(new string((from c in TagRegex.Replace(raw, "").Normalize(NormalizationForm.FormKD) where !char.IsControl(c) select c).ToArray()), "\\s+", " ").Trim().ToLowerInvariant(); } } internal static class UiFinder { public static bool TryFindRect(string pathOrName, out RectTransform rt) { string pathOrName2 = pathOrName; rt = null; GameObject val = GameObject.Find(pathOrName2); if (Object.op_Implicit((Object)(object)val) && val.TryGetComponent<RectTransform>(ref rt)) { return true; } if (Object.op_Implicit((Object)(object)val)) { rt = val.GetComponent<RectTransform>(); if (Object.op_Implicit((Object)(object)rt)) { return true; } } RectTransform[] source = Resources.FindObjectsOfTypeAll<RectTransform>(); rt = ((IEnumerable<RectTransform>)source).FirstOrDefault((Func<RectTransform, bool>)((RectTransform r) => Object.op_Implicit((Object)(object)r) && ((Object)r).name == pathOrName2)); return (Object)(object)rt != (Object)null; } public static RectTransform TryMany(params string[] candidates) { for (int i = 0; i < candidates.Length; i++) { if (TryFindRect(candidates[i], out RectTransform rt)) { return rt; } } return null; } public static Rect GetWorldRect(RectTransform target) { //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)target)) { return Rect.zero; } Vector3[] array = (Vector3[])(object)new Vector3[4]; target.GetWorldCorners(array); float num = Mathf.Min(Mathf.Min(array[0].x, array[1].x), Mathf.Min(array[2].x, array[3].x)); float num2 = Mathf.Max(Mathf.Max(array[0].x, array[1].x), Mathf.Max(array[2].x, array[3].x)); float num3 = Mathf.Min(Mathf.Min(array[0].y, array[1].y), Mathf.Min(array[2].y, array[3].y)); float num4 = Mathf.Max(Mathf.Max(array[0].y, array[1].y), Mathf.Max(array[2].y, array[3].y)); return Rect.MinMaxRect(num, num3, num2, num4); } } namespace LocalizationManager { [PublicAPI] public class Localizer { private static readonly Dictionary<string, Dictionary<string, Func<string>>> PlaceholderProcessors; private static readonly Dictionary<string, Dictionary<string, string>> loadedTexts; private static readonly ConditionalWeakTable<Localization, string> localizationLanguage; private static readonly List<WeakReference<Localization>> localizationObjects; private static BaseUnityPlugin? _plugin; private static readonly List<string> fileExtensions; private static BaseUnityPlugin plugin { get { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown if (_plugin == null) { IEnumerable<TypeInfo> source; try { source = Assembly.GetExecutingAssembly().DefinedTypes.ToList(); } catch (ReflectionTypeLoadException ex) { source = from t in ex.Types where t != null select t.GetTypeInfo(); } _plugin = (BaseUnityPlugin)Chainloader.ManagerObject.GetComponent((Type)source.First((TypeInfo t) => t.IsClass && typeof(BaseUnityPlugin).IsAssignableFrom(t))); } return _plugin; } } private static void UpdatePlaceholderText(Localization localization, string key) { localizationLanguage.TryGetValue(localization, out string value); string text = loadedTexts[value][key]; if (PlaceholderProcessors.TryGetValue(key, out Dictionary<string, Func<string>> value2)) { text = value2.Aggregate(text, (string current, KeyValuePair<string, Func<string>> kv) => current.Replace("{" + kv.Key + "}", kv.Value())); } localization.AddWord(key, text); } public static void AddPlaceholder<T>(string key, string placeholder, ConfigEntry<T> config, Func<T, string>? convertConfigValue = null) where T : notnull { string key2 = key; string placeholder2 = placeholder; Func<T, string> convertConfigValue2 = convertConfigValue; ConfigEntry<T> config2 = config; if (convertConfigValue2 == null) { convertConfigValue2 = (T val) => val.ToString(); } if (!PlaceholderProcessors.ContainsKey(key2)) { PlaceholderProcessors[key2] = new Dictionary<string, Func<string>>(); } config2.SettingChanged += delegate { UpdatePlaceholder(); }; if (loadedTexts.ContainsKey(Localization.instance.GetSelectedLanguage())) { UpdatePlaceholder(); } void UpdatePlaceholder() { PlaceholderProcessors[key2][placeholder2] = () => convertConfigValue2(config2.Value); UpdatePlaceholderText(Localization.instance, key2); } } public static void AddText(string key, string text) { List<WeakReference<Localization>> list = new List<WeakReference<Localization>>(); foreach (WeakReference<Localization> localizationObject in localizationObjects) { if (localizationObject.TryGetTarget(out var target)) { Dictionary<string, string> dictionary = loadedTexts[localizationLanguage.GetOrCreateValue(target)]; if (!target.m_translations.ContainsKey(key)) { dictionary[key] = text; target.AddWord(key, text); } } else { list.Add(localizationObject); } } foreach (WeakReference<Localization> item in list) { localizationObjects.Remove(item); } } public static void Load() { _ = plugin; } public static void LoadLocalizationLater(Localization __instance) { LoadLocalization(Localization.instance, __instance.GetSelectedLanguage()); } private static void LoadLocalization(Localization __instance, string language) { if (!localizationLanguage.Remove(__instance)) { localizationObjects.Add(new WeakReference<Localization>(__instance)); } localizationLanguage.Add(__instance, language); Dictionary<string, string> dictionary = new Dictionary<string, string>(); foreach (string item in from f in Directory.GetFiles(Path.GetDirectoryName(Paths.PluginPath), plugin.Info.Metadata.Name + ".*", SearchOption.AllDirectories) where fileExtensions.IndexOf(Path.GetExtension(f)) >= 0 select f) { string text = Path.GetFileNameWithoutExtension(item).Split(new char[1] { '.' })[1]; if (dictionary.ContainsKey(text)) { Debug.LogWarning((object)("Duplicate key " + text + " found for " + plugin.Info.Metadata.Name + ". The duplicate file found at " + item + " will be skipped.")); } else { dictionary[text] = item; } } byte[] array = LoadTranslationFromAssembly("English"); if (array == null) { throw new Exception("Found no English localizations in mod " + plugin.Info.Metadata.Name + ". Expected an embedded resource translations/English.json or translations/English.yml."); } Dictionary<string, string> dictionary2 = new DeserializerBuilder().IgnoreFields().Build().Deserialize<Dictionary<string, string>>(Encoding.UTF8.GetString(array)); if (dictionary2 == null) { throw new Exception("Localization for mod " + plugin.Info.Metadata.Name + " failed: Localization file was empty."); } string text2 = null; if (language != "English") { if (dictionary.TryGetValue(language, out var value)) { text2 = File.ReadAllText(value); } else { byte[] array2 = LoadTranslationFromAssembly(language); if (array2 != null) { text2 = Encoding.UTF8.GetString(array2); } } } if (text2 == null && dictionary.TryGetValue("English", out var value2)) { text2 = File.ReadAllText(value2); } if (text2 != null) { foreach (KeyValuePair<string, string> item2 in new DeserializerBuilder().IgnoreFields().Build().Deserialize<Dictionary<string, string>>(text2) ?? new Dictionary<string, string>()) { dictionary2[item2.Key] = item2.Value; } } loadedTexts[language] = dictionary2; foreach (KeyValuePair<string, string> item3 in dictionary2) { UpdatePlaceholderText(__instance, item3.Key); } } static Localizer() { //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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown PlaceholderProcessors = new Dictionary<string, Dictionary<string, Func<string>>>(); loadedTexts = new Dictionary<string, Dictionary<string, string>>(); localizationLanguage = new ConditionalWeakTable<Localization, string>(); localizationObjects = new List<WeakReference<Localization>>(); fileExtensions = new List<string> { ".json", ".yml" }; Harmony val = new Harmony("org.bepinex.helpers.LocalizationManager"); val.Patch((MethodBase)AccessTools.DeclaredMethod(typeof(Localization), "SetupLanguage", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(AccessTools.DeclaredMethod(typeof(Localizer), "LoadLocalization", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); val.Patch((MethodBase)AccessTools.DeclaredMethod(typeof(FejdStartup), "SetupGui", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(AccessTools.DeclaredMethod(typeof(Localizer), "LoadLocalizationLater", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } private static byte[]? LoadTranslationFromAssembly(string language) { foreach (string fileExtension in fileExtensions) { byte[] array = ReadEmbeddedFileBytes("translations." + language + fileExtension); if (array != null) { return array; } } return null; } public static byte[]? ReadEmbeddedFileBytes(string resourceFileName, Assembly? containingAssembly = null) { string resourceFileName2 = resourceFileName; using MemoryStream memoryStream = new MemoryStream(); if ((object)containingAssembly == null) { containingAssembly = Assembly.GetCallingAssembly(); } string text = containingAssembly.GetManifestResourceNames().FirstOrDefault((string str) => str.EndsWith(resourceFileName2, StringComparison.Ordinal)); if (text != null) { containingAssembly.GetManifestResourceStream(text)?.CopyTo(memoryStream); } return (memoryStream.Length == 0L) ? null : memoryStream.ToArray(); } } } namespace AzuAntiArthriticCrafting { public class FavoriteStarHider : MonoBehaviour { private void Update() { if (!((Object)(object)InventoryGui.instance == (Object)null)) { if (!InventoryGui.instance.InCraftTab() || AzuAntiArthriticCraftingPlugin.FavoritingSystem.IsOff()) { ((Component)this).gameObject.SetActive(false); } else { ((Component)this).gameObject.SetActive(true); } } } } public class MaxCraftAmount : MonoBehaviour { private const string objectName = "AAAMaxCraftAmountText"; private Recipe? _lastRecipe; private TextMeshProUGUI _maxCraftAmountText; public static bool InventoryChanged; private void Awake() { //IL_00d9: 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_010f: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) GameObject gameObject = ((Component)this).gameObject; Transform val = gameObject.transform.Find("Text"); if ((Object)(object)val == (Object)null) { AzuAntiArthriticCraftingPlugin.AntiArthriticCraftingLogger.LogWarning((object)("Could not find 'Text' child object under " + ((Object)gameObject).name)); return; } TextMeshProUGUI component = ((Component)val).GetComponent<TextMeshProUGUI>(); if ((Object)(object)component == (Object)null) { AzuAntiArthriticCraftingPlugin.AntiArthriticCraftingLogger.LogWarning((object)("Could not find TextMeshProUGUI component on 'Text' child object under " + ((Object)gameObject).name)); return; } GameObject val2 = Object.Instantiate<GameObject>(((Component)component).gameObject, gameObject.transform, true); ((Object)val2).name = "AAAMaxCraftAmountText"; _maxCraftAmountText = val2.GetComponent<TextMeshProUGUI>(); ((TMP_Text)_maxCraftAmountText).text = string.Empty; ((TMP_Text)_maxCraftAmountText).font = ((TMP_Text)component).font; ((TMP_Text)_maxCraftAmountText).fontSize = 20f; ((TMP_Text)_maxCraftAmountText).fontSizeMax = 20f; ((TMP_Text)_maxCraftAmountText).fontStyle = ((TMP_Text)component).fontStyle; ((Graphic)_maxCraftAmountText).color = ((Graphic)component).color; ((TMP_Text)_maxCraftAmountText).alignment = (TextAlignmentOptions)514; ((TMP_Text)_maxCraftAmountText).rectTransform.sizeDelta = Vector2.zero; ((TMP_Text)_maxCraftAmountText).rectTransform.anchoredPosition = new Vector2(0f, -35f); _lastRecipe = null; } private void Update() { if (AzuAntiArthriticCraftingPlugin.ShowMaxCraftAmountToggle == null || AzuAntiArthriticCraftingPlugin.ShowMaxCraftAmountToggle.IsOff()) { if ((Object)(object)_maxCraftAmountText != (Object)null && ((Component)_maxCraftAmountText).gameObject.activeSelf) { ((Component)_maxCraftAmountText).gameObject.SetActive(false); } return; } if ((Object)(object)_maxCraftAmountText != (Object)null && !((Component)_maxCraftAmountText).gameObject.activeSelf) { ((Component)_maxCraftAmountText).gameObject.SetActive(true); } if ((Object)(object)InventoryGui.instance == (Object)null) { return; } if (!InventoryGui.instance.InCraftTab() && !InventoryGui.instance.InUpradeTab()) { if ((Object)(object)_maxCraftAmountText != (Object)null && ((Component)_maxCraftAmountText).gameObject.activeSelf) { ((Component)_maxCraftAmountText).gameObject.SetActive(false); } return; } Recipe recipe = ((RecipeDataPair)(ref InventoryGui.instance.m_selectedRecipe)).Recipe; if (!((Object)(object)_lastRecipe != (Object)(object)recipe) && !InventoryChanged) { return; } if ((Object)(object)_maxCraftAmountText != (Object)null) { if ((Object)(object)Player.m_localPlayer != (Object)null && Player.m_localPlayer.NoCostCheat()) { ((TMP_Text)_maxCraftAmountText).text = Localization.instance.Localize("$aaa_maxcraftamount: ∞"); } else { int maxAmountCached = AAACraft.GetMaxAmountCached(); ((TMP_Text)_maxCraftAmountText).text = Localization.instance.Localize("$aaa_maxcraftamount: " + maxAmountCached.ToString(CultureInfo.InvariantCulture)); } } _lastRecipe = recipe; InventoryChanged = false; } } [HarmonyPatch(typeof(Inventory), "Changed")] internal static class InventoryChangedPatch { private static void Postfix(Inventory __instance) { if (__instance.m_onChanged != null) { MaxCraftAmount.InventoryChanged = true; } } } public class NoCostReqHandler : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler, IPointerClickHandler { private bool isHovering; internal Requirement m_requirement; public void OnPointerEnter(PointerEventData eventData) { isHovering = true; } public void OnPointerExit(PointerEventData eventData) { isHovering = false; } public void OnPointerClick(PointerEventData eventData) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_00c8: Unknown result type (might be due to invalid IL or missing references) if ((int)eventData.button == 1 && isHovering) { Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && m_requirement != null && (localPlayer.NoCostCheat() || ZoneSystem.instance.GetGlobalKey((GlobalKeys)20)) && ZNet.instance.LocalPlayerIsAdminOrHost()) { int num = m_requirement.m_amount * HaveRequirementItemsTranspiler.GetCurrentCraftAmount(); Vector2i val = default(Vector2i); ((Vector2i)(ref val))..ctor(-1, -1); long playerID = localPlayer.GetPlayerID(); string playerName = localPlayer.GetPlayerName(); ((Humanoid)localPlayer).GetInventory().AddItem(((Object)((Component)m_requirement.m_resItem).gameObject).name, num, m_requirement.m_resItem.m_itemData.m_quality, m_requirement.m_resItem.m_itemData.m_variant, playerID, playerName, val, false); } } } } public class ScrollableInputField : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler, ISelectHandler, IDeselectHandler { public TMP_InputField inputField; public static ScrollableInputField instance; internal bool isHovering; private float gamepadScrollCooldown = 0.1f; private float lastGamepadScrollTime; private void Awake() { instance = this; inputField = ((Component)this).GetComponent<TMP_InputField>(); } private void Update() { //IL_00d8: 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) if ((Object)(object)InventoryGui.instance == (Object)null) { return; } InventoryGui.instance.m_multiCrafting = false; InventoryGui.instance.m_multiCraftAmount = 1; if (!isHovering) { return; } float time = Time.time; float num = Input.GetAxis("Mouse ScrollWheel"); if (ZInput.IsGamepadActive() && time - lastGamepadScrollTime >= gamepadScrollCooldown) { if (ZInput.GetButton("JoyCamZoomIn") || ZInput.GetButton("Forward")) { num += 0.1f; lastGamepadScrollTime = time; } else if (ZInput.GetButton("JoyCamZoomOut") || ZInput.GetButton("Backward")) { num -= 0.1f; lastGamepadScrollTime = time; } } if (Mathf.Abs(num) < float.Epsilon) { return; } int maxAmountCached = AAACraft.GetMaxAmountCached(); bool flag = (ZInput.IsGamepadActive() && ZInput.GetButton("JoyAltKeys") && !Hud.InRadial()) || AzuAntiArthriticCraftingPlugin.IncrementalModifier.Value.IsKeyHeld(); bool num2 = AzuAntiArthriticCraftingPlugin.MaxCraftModifier.Value.IsKeyHeld() || (ZInput.IsGamepadActive() && ZInput.GetButton("JoyRStick") && !Hud.InRadial()); int num3 = 1; if (!int.TryParse(inputField.text, out var result)) { result = 1; } int num4 = (int)Mathf.Sign(num); if (num2) { result = ((num4 <= 0) ? 1 : maxAmountCached); result = Mathf.Clamp(result, 1, Mathf.Max(1, maxAmountCached)); inputField.text = result.ToString(CultureInfo.InvariantCulture); return; } if (flag) { num3 = Mathf.Max(1, AzuAntiArthriticCraftingPlugin.IncrementalAmount.Value); result = ((num4 <= 0) ? ((result <= num3) ? 1 : (result - num3)) : ((result == 1) ? num3 : (result + num3))); } else { result += num4; } result = Mathf.Clamp(result, 1, Mathf.Max(1, maxAmountCached)); if (Object.op_Implicit((Object)(object)InventoryGui.instance)) { ((Component)InventoryGui.instance.m_tabCraft).GetComponent<ButtonSfx>().OnClick(); ItemData itemData = ((RecipeDataPair)(ref InventoryGui.instance.m_selectedRecipe)).ItemData; if (itemData != null) { int maxQuality = itemData.m_shared.m_maxQuality; int quality = itemData.m_quality; if (maxQuality > 0) { result = Mathf.Clamp(result, 1, maxQuality - quality); } } } inputField.text = result.ToString(CultureInfo.InvariantCulture); InventoryGui obj = InventoryGui.instance; Recipe val = ((obj != null) ? ((RecipeDataPair)(ref obj.m_selectedRecipe)).Recipe : null); if ((Object)(object)val != (Object)null) { InventoryGui obj2 = InventoryGui.instance; ItemData val2 = ((obj2 != null) ? ((RecipeDataPair)(ref obj2.m_selectedRecipe)).ItemData : null); int num5 = ((val2 == null) ? 1 : (val2.m_quality + 1)); if ((Object)(object)Player.m_localPlayer != (Object)null && Player.m_localPlayer.HaveRequirementItems(val, false, num5, 1)) { ((Selectable)InventoryGui.instance.m_craftButton).interactable = true; } } } public void OnPointerEnter(PointerEventData eventData) { TurnOnHover(); } public void OnPointerExit(PointerEventData eventData) { TurnOffHover(); } public void OnSelect(BaseEventData eventData) { TurnOnHover(); } public void OnDeselect(BaseEventData eventData) { TurnOffHover(); } public static void TurnOffHover() { instance.isHovering = false; } public static void TurnOnHover() { instance.isHovering = true; } internal int GetMaxCraftAmount() { return AzuAntiArthriticCrafting.Utilities.Utilities.CalculateMaxCraftAmount(); } } [BepInPlugin("Azumatt.AzuAntiArthriticCrafting", "AzuAntiArthriticCrafting", "2.0.2")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class AzuAntiArthriticCraftingPlugin : BaseUnityPlugin { public enum Toggle { On = 1, Off = 0 } private class ConfigurationManagerAttributes { [UsedImplicitly] public int? Order; [UsedImplicitly] public bool? Browsable; [UsedImplicitly] public string? Category; [UsedImplicitly] public Action<ConfigEntryBase>? CustomDrawer; } private class AcceptableShortcuts : AcceptableValueBase { public AcceptableShortcuts() : base(typeof(KeyboardShortcut)) { } public override object Clamp(object value) { return value; } public override bool IsValid(object value) { return true; } public override string ToDescriptionString() { return "# Acceptable values: " + string.Join(", ", UnityInput.Current.SupportedKeyCodes); } } internal const string ModName = "AzuAntiArthriticCrafting"; internal const string ModVersion = "2.0.2"; internal const string Author = "Azumatt"; private const string ModGUID = "Azumatt.AzuAntiArthriticCrafting"; private static string ConfigFileName = "Azumatt.AzuAntiArthriticCrafting.cfg"; private static string ConfigFileFullPath; internal static AzuAntiArthriticCraftingPlugin instance; internal static string ConnectionError; internal static bool CfcLoaded; internal static readonly Harmony harmony; internal static AssetBundle? Asset; internal static AssetBundle? Asset2; internal static AssetBundle? ShaderAssetBundle; internal static Shader? overlayShader; public static readonly ManualLogSource AntiArthriticCraftingLogger; private static readonly ConfigSync ConfigSync; public static GameObject RecipeTrackerUIPrefab; public static BaseUnityPlugin RandyInstance; private static ConfigEntry<Toggle> _serverConfigLocked; public static ConfigEntry<Toggle> ResetCraftingValueOnRecChange; public static ConfigEntry<Toggle> Paginator; public static ConfigEntry<Toggle> FavoritingSystem; public static ConfigEntry<int> IncrementalAmount; public static ConfigEntry<Toggle> ShowMaxCraftAmountToggle; public static ConfigEntry<Toggle> OverrideCraftingDuration; public static ConfigEntry<float> CraftingDuration; public static ConfigEntry<string> RequirementTextFormatting; public static ConfigEntry<string> InputEnabledText; public static ConfigEntry<string> InputDisabledText; public static ConfigEntry<Color> InputTextColor; public static ConfigEntry<KeyboardShortcut> MinusKeybind; public static ConfigEntry<KeyboardShortcut> ToggleUIKeyBind; public static ConfigEntry<KeyboardShortcut> MaxCraftModifier; public static ConfigEntry<KeyboardShortcut> IncrementalModifier; public static ConfigEntry<KeyboardShortcut> FavoriteToggle; public static ConfigEntry<Color> HeaderGlowColor; public static ConfigEntry<Color> HeaderBraidColor; public static ConfigEntry<Color> RecipeContainerBackgroundColor; public static ConfigEntry<Color> ItemNameColor; public static ConfigEntry<Color> RecipeNameColorComplete; public static ConfigEntry<Color> RecipeNameColorInComplete; public static ConfigEntry<Color> RecipeCompleteColor; public static ConfigEntry<Color> RecipeIncompleteRightColor; public static ConfigEntry<Color> RecipeIncompleteLeftColor; public static ConfigEntry<Vector2> RecipeTrackerPanelScale; public static ConfigEntry<float> RecipeTrackerItemNameMin; public static ConfigEntry<float> RecipeTrackerItemNameMax; public static ConfigEntry<float> RecipeTrackerReqNameMin; public static ConfigEntry<float> RecipeTrackerReqNameMax; public static ConfigEntry<Vector2> RecipeTrackerPanelPosition; public void Awake() { //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Expected O, but got Unknown //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Expected O, but got Unknown //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Expected O, but got Unknown //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_027f: 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_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Expected O, but got Unknown //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Expected O, but got Unknown //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Expected O, but got Unknown //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Expected O, but got Unknown //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Expected O, but got Unknown //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Expected O, but got Unknown //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Expected O, but got Unknown //IL_0477: Unknown result type (might be due to invalid IL or missing references) //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Expected O, but got Unknown //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04d1: Expected O, but got Unknown //IL_04e1: Unknown result type (might be due to invalid IL or missing references) //IL_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_04fc: Expected O, but got Unknown //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_0526: Unknown result type (might be due to invalid IL or missing references) //IL_0531: Expected O, but got Unknown //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_055c: Expected O, but got Unknown //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0587: Expected O, but got Unknown //IL_05a7: Unknown result type (might be due to invalid IL or missing references) //IL_05b2: Expected O, but got Unknown //IL_05d2: Unknown result type (might be due to invalid IL or missing references) //IL_05dd: Expected O, but got Unknown instance = this; Localizer.Load(); _serverConfigLocked = config("1 - General", "Lock Configuration", Toggle.On, "If on, the configuration is locked and can be changed by server admins only."); ConfigSync.AddLockingConfigEntry<Toggle>(_serverConfigLocked); ResetCraftingValueOnRecChange = config("1 - Crafting Tweaks", "Reset Crafting Value", Toggle.On, "If enabled, the crafting amount will be reset when the recipe is changed and when crafting completes. If disabled, the crafting amount will not be reset and will keep your previous amount"); Paginator = config("1 - Crafting Tweaks", "Paginator", Toggle.On, "If enabled, the paginator will be enabled. If disabled, the paginator will be disabled", synchronizedSetting: false); Paginator.SettingChanged += delegate { if ((Object)(object)PaginatorPatches.CraftingWindowPaginator != (Object)null) { PaginatorPatches.CraftingWindowPaginator.gameObject.SetActive(Paginator.IsOn()); } else { AzuAntiArthriticCrafting.Utilities.Utilities.CreatePaginator(InventoryGui.instance); if (PaginatorPatches.CraftingWindowPaginator != null) { PaginatorPatches.CraftingWindowPaginator.gameObject.SetActive(Paginator.IsOn()); } } }; FavoritingSystem = config("1 - Crafting Tweaks", "Favorting System", Toggle.On, "If enabled, the favorite toggle buttons and stars will be enabled allowing you to filter by favorites. If disabled, the favorite toggle button and stars will be disabled. Requires restart (or logout!)", synchronizedSetting: false); IncrementalAmount = config("1 - Crafting Tweaks", "Incremental Amount", 10, "The amount to increase by when your Incremental Modifier key is held down.", synchronizedSetting: false); ShowMaxCraftAmountToggle = config("1 - Crafting Tweaks", "Show Max Craft Amount", Toggle.On, "Toggle the display of the max craft amount text in the crafting UI.", synchronizedSetting: false); OverrideCraftingDuration = config("2 - Game", "Override Crafting Speed", Toggle.Off, new ConfigDescription("If enabled, the crafting speed will be overridden by the value set in Crafting Speed. If disabled, the crafting speed will be vanilla and multiplied by the amounts you wish to craft. Default is off.", (AcceptableValueBase)null, Array.Empty<object>())); CraftingDuration = config("2 - Game", "Crafting Speed", 2f, new ConfigDescription("Change the speed at which it takes to craft items. Override Crafting Speed option must be on for this to take effect. This value is in seconds. To craft faster, make this value smaller. To craft slower, make this value larger. Default is 2 seconds.", (AcceptableValueBase)null, Array.Empty<object>())); InputTextColor = config<Color>("3 - Input Tweaks", "Input Text Color", new Color(1f, 61f / 85f, 49f / 136f, 1f), new ConfigDescription("Change the placeholder text for the input field. Default is \"Enter Amount...\"", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Order = 2 } }), synchronizedSetting: false); InputTextColor.SettingChanged += delegate { //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)InventoryGui.instance == (Object)null) && !((Object)(object)AAACraft.inputAmount == (Object)null)) { ((Graphic)AAACraft.inputAmount.textComponent).color = InputTextColor.Value; } }; MinusKeybind = config<KeyboardShortcut>("4 - Keys", "Show Minus Button", new KeyboardShortcut((KeyCode)306, Array.Empty<KeyCode>()), "The key to hold down to show the minus button instead of the plus when hovering recipe icons in the crafting menu. [Default: LeftControl]", synchronizedSetting: false); ToggleUIKeyBind = config<KeyboardShortcut>("4 - Keys", "Toggle RecipeUI", new KeyboardShortcut((KeyCode)304, (KeyCode[])(object)new KeyCode[1] { (KeyCode)280 }), "The key to toggle the RecipeUI. [Default: LeftShift + PageUp]", synchronizedSetting: false); MaxCraftModifier = config<KeyboardShortcut>("4 - Keys", "Max Craft Modifier", new KeyboardShortcut((KeyCode)306, Array.Empty<KeyCode>()), "The key that, when held down and using the scrollwheel over the input box, will make it jump to the max amount you can craft", synchronizedSetting: false); IncrementalModifier = config<KeyboardShortcut>("4 - Keys", "Incremental Modifier", new KeyboardShortcut((KeyCode)304, Array.Empty<KeyCode>()), "The key that, when held down and using the scrollwheel over the input box, will make it increase by your defined amount [Default: 10] in the Incremental Amount configuration option.", synchronizedSetting: false); FavoriteToggle = config<KeyboardShortcut>("4 - Keys", "Favorite Toggle", new KeyboardShortcut((KeyCode)102, Array.Empty<KeyCode>()), "Key to toggle the favorite filter (star button) on and off. [Default: F]", synchronizedSetting: false); RecipeTrackerPanelPosition = config<Vector2>("5 - Recipe Tracker (Position)", "Recipe Tracker Position", new Vector2(783f, 265f), new ConfigDescription("Change the anchored position of the recipe tracker panel. Default is 816, 184.", (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting: false); RecipeTrackerPanelPosition.SettingChanged += delegate { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)HudAwakePatch.RecipeTrackerUI == (Object)null)) { ((Component)HudAwakePatch.RecipeTrackerUI).GetComponent<RectTransform>().anchoredPosition = RecipeTrackerPanelPosition.Value; } }; HeaderGlowColor = config<Color>("5 - Recipe Tracker (Color)", "Header Glow Color", new Color(0.58f, 0.235f, 0.19f, 1f), new ConfigDescription("Change the color of the header glow. Default is dark red.", (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting: false); HeaderBraidColor = config<Color>("5 - Recipe Tracker (Color)", "Header Braid Color", new Color(1f, 0.717f, 0.356f, 1f), new ConfigDescription("Change the color of the header braid (decoration). Default is mustard yellow.", (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting: false); RecipeContainerBackgroundColor = config<Color>("5 - Recipe Tracker (Color)", "Recipe Container Background Color", new Color(0f, 0f, 0f, 0.5f), new ConfigDescription("Change the color of the recipe container background. Default is semi-transparent black.", (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting: false); ItemNameColor = config<Color>("5 - Recipe Tracker (Color)", "Item Name Color (Color)", new Color(1f, 61f / 85f, 49f / 136f, 1f), new ConfigDescription("Change the color of the item name. Default is yellow.", (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting: false); RecipeNameColorComplete = config<Color>("5 - Recipe Tracker (Color)", "Recipe Complete Name Color", Color.white, new ConfigDescription("Change the color of the item name. Default is yellow.", (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting: false); RecipeNameColorInComplete = config<Color>("5 - Recipe Tracker (Color)", "Recipe Incomplete Name Color", new Color(1f, 1f, 1f, 0.192f), new ConfigDescription("Change the color of the item name. Default is yellow.", (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting: false); RecipeCompleteColor = config<Color>("5 - Recipe Tracker (Color)", "Recipe Complete Color", new Color(0f, 1f, 0.44f, 0.37f), new ConfigDescription("Change the color of the text when the requirement is met. Default is green.", (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting: false); RecipeIncompleteRightColor = config<Color>("5 - Recipe Tracker (Color)", "Recipe Incomplete Right Color", new Color(1f, 0.31f, 0f, 1f), new ConfigDescription("Change the color of the text when the requirement is not met. Default is red.", (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting: false); RecipeIncompleteLeftColor = config<Color>("5 - Recipe Tracker (Color)", "Recipe Incomplete Left Color", Color.white, new ConfigDescription("Change the color of the text when the requirement is not met. Default is red.", (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting: false); RecipeTrackerPanelScale = config<Vector2>("5 - Recipe Tracker (Sizes)", "Recipe Tracker Panel Scale", new Vector2(0.75f, 0.75f), new ConfigDescription("Change the scale of the recipe tracker panel. Default is 1.0f.", (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting: false); RecipeTrackerItemNameMin = config("5 - Recipe Tracker (Sizes)", "Recipe Tracker Item Name Min", 12f, new ConfigDescription("Change the minimum size of the recipe tracker item name. Default is 12.", (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting: false); RecipeTrackerItemNameMax = config("5 - Recipe Tracker (Sizes)", "Recipe Tracker Item Name Max", 20f, new ConfigDescription("Change the maximum size of the recipe tracker item name. Default is 20.", (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting: false); RecipeTrackerReqNameMin = config("5 - Recipe Tracker (Sizes)", "Recipe Tracker Req Name Min", 12f, new ConfigDescription("Change the minimum size of the recipe tracker requirement name. Default is 12.", (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting: false); RecipeTrackerReqNameMax = config("5 - Recipe Tracker (Sizes)", "Recipe Tracker Req Name Max", 20f, new ConfigDescription("Change the maximum size of the recipe tracker requirement name. Default is 20.", (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting: false); RecipeTrackerPanelScale.SettingChanged += delegate { UpdateAllRecipesOnChange(); }; RecipeTrackerItemNameMin.SettingChanged += delegate { UpdateAllRecipesOnChange(); }; RecipeTrackerItemNameMax.SettingChanged += delegate { UpdateAllRecipesOnChange(); }; RecipeTrackerReqNameMin.SettingChanged += delegate { UpdateAllRecipesOnChange(); }; RecipeTrackerReqNameMax.SettingChanged += delegate { UpdateAllRecipesOnChange(); }; HeaderGlowColor.SettingChanged += delegate { UpdateAllRecipesOnChange(); }; HeaderBraidColor.SettingChanged += delegate { UpdateAllRecipesOnChange(); }; RecipeContainerBackgroundColor.SettingChanged += delegate { UpdateAllRecipesOnChange(); }; ItemNameColor.SettingChanged += delegate { UpdateAllRecipesOnChange(); }; RecipeNameColorComplete.SettingChanged += delegate { UpdateAllRecipesOnChange(); }; RecipeNameColorInComplete.SettingChanged += delegate { UpdateAllRecipesOnChange(); }; RecipeCompleteColor.SettingChanged += delegate { UpdateAllRecipesOnChange(); }; RecipeIncompleteRightColor.SettingChanged += delegate { UpdateAllRecipesOnChange(); }; RecipeIncompleteLeftColor.SettingChanged += delegate { UpdateAllRecipesOnChange(); }; LoadAssets(); Assembly executingAssembly = Assembly.GetExecutingAssembly(); harmony.PatchAll(executingAssembly); SetupWatcher(); } private static AssetBundle? GetAssetBundleFromResources(string filename) { string filename2 = filename; try { Assembly executingAssembly = Assembly.GetExecutingAssembly(); string[] manifestResourceNames = executingAssembly.GetManifestResourceNames(); AntiArthriticCraftingLogger.LogIfBuildDebug("Checking for " + filename2 + "\nAvailable resources: " + string.Join(", ", manifestResourceNames)); string text = manifestResourceNames.SingleOrDefault((string str) => str.EndsWith(filename2, StringComparison.OrdinalIgnoreCase)); if (text == null) { AntiArthriticCraftingLogger.LogError((object)("Resource '" + filename2 + "' not found in embedded resources.")); throw new InvalidOperationException("Resource '" + filename2 + "' not found."); } using Stream stream = executingAssembly.GetManifestResourceStream(text); if (stream != null) { AntiArthriticCraftingLogger.LogIfBuildDebug("Successfully loaded resource: " + text); return AssetBundle.LoadFromStream(stream); } AntiArthriticCraftingLogger.LogError((object)("Failed to load asset bundle stream for resource: " + text)); throw new InvalidOperationException("Failed to load asset bundle stream for resource: " + text); } catch (Exception ex) { AntiArthriticCraftingLogger.LogError((object)("Error loading AssetBundle '" + filename2 + "': " + ex.Message)); throw; } } private static byte[] ReadEmbeddedFileBytes(string name) { try { using MemoryStream memoryStream = new MemoryStream(); string name2 = Assembly.GetExecutingAssembly().GetName().Name + "." + name; using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(name2); if (stream == null) { AntiArthriticCraftingLogger.LogError((object)("Embedded file '" + name + "' not found.")); throw new InvalidOperationException("Embedded file '" + name + "' not found."); } stream.CopyTo(memoryStream); AntiArthriticCraftingLogger.LogIfBuildDebug("Successfully read embedded file: " + name); return memoryStream.ToArray(); } catch (Exception ex) { AntiArthriticCraftingLogger.LogError((object)("Error reading embedded file '" + name + "': " + ex.Message)); throw; } } internal static Sprite loadSprite(string name, bool isEmbed = false) { //IL_002c: 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) Texture2D val = loadTexture(name, isEmbed); if (!((Object)(object)val != (Object)null)) { return null; } return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), Vector2.zero); } internal static Texture2D loadTexture(string name, bool isEmbed = false) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown string name2 = name; Texture2D val = new Texture2D(0, 0); if (isEmbed) { ImageConversion.LoadImage(val, ReadEmbeddedFileBytes("assets." + name2)); } else { string directoryName = Path.GetDirectoryName(Paths.ConfigPath); if (directoryName == null) { return val; } List<string> list = Directory.GetFiles(directoryName, "AAA_favorite.png", SearchOption.AllDirectories).OrderBy(Path.GetFileName).ToList(); try { byte[] array = File.ReadAllBytes(list.Find((string x) => x.Contains(name2))); ImageConversion.LoadImage(val, array); } catch (Exception arg) { AntiArthriticCraftingLogger.LogWarning((object)$"The file {name2} couldn't be found in the directory path {directoryName}. Please make sure you are naming the file AAA_favorite.png and it is located somewhere in the BepInEx/config folder.\n{arg}"); val = null; } } return val; } public void UpdateAllRecipesOnChange() { if (!((Object)(object)RecipeTrackerUIPrefab == (Object)null)) { RecipeTrackerUI.Instance.UpdateAllRecipes(); } } public static void LoadAssets() { Asset = GetAssetBundleFromResources("paginator"); Asset2 = GetAssetBundleFromResources("aaarecipetracker"); ShaderAssetBundle = GetAssetBundleFromResources("aaa_shader"); if ((Object)(object)ShaderAssetBundle != (Object)null) { AssetBundle? shaderAssetBundle = ShaderAssetBundle; overlayShader = ((shaderAssetBundle != null) ? shaderAssetBundle.LoadAsset<Shader>("OverlayWithHole") : null); if ((Object)(object)overlayShader != (Object)null) { AntiArthriticCraftingLogger.LogIfBuildDebug("Successfully loaded overlay shader"); ShaderAssetBundle.Unload(false); } else { AntiArthriticCraftingLogger.LogError((object)"Failed to load overlay shader"); } } } private void Start() { AssetLoadTracker.MapPrefabsToBundles(); AssetLoadTracker.MapBundlesToAssemblies(); if (Jewelcrafting.API.IsLoaded()) { Jewelcrafting.API.OnItemBreak(AzuAntiArthriticCrafting.Utilities.Utilities.OnItemBreak); } Chainloader.PluginInfos.TryGetValue("Azumatt.AzuCraftyBoxes", out var value); Chainloader.PluginInfos.TryGetValue("aedenthorn.CraftFromContainers", out var value2); Chainloader.PluginInfos.TryGetValue("com.odinplusqol.mod", out var value3); Chainloader.PluginInfos.TryGetValue("kwilson.TillValhalla", out var value4); Chainloader.PluginInfos.TryGetValue("randyknapp.mods.improvedbuildhud", out var value5); Chainloader.PluginInfos.TryGetValue("shudnal.MyLittleUI", out var value6); Chainloader.PluginInfos.TryGetValue("ZenDragon.ZenUI", out var value7); if (value != null && (Object)(object)value.Instance != (Object)null) { CfcLoaded = true; } if (value3 != null && (Object)(object)value3.Instance != (Object)null) { CfcLoaded = true; } if (value2 != null && (Object)(object)value2.Instance != (Object)null) { CfcLoaded = true; } if (value4 != null && (Object)(object)value4.Instance != (Object)null) { CfcLoaded = true; } if (value5 != null && (Object)(object)value5.Instance != (Object)null) { RandyInstance = value5.Instance; } if (value6 != null && (Object)(object)value6.Instance != (Object)null) { ConfigEntry<bool> val = default(ConfigEntry<bool>); if (value6.Instance.Config.TryGetEntry<bool>("Item - Available resources amount", "Multicraft", ref val) && val.Value) { val.Value = false; } ConfigEntry<bool> val2 = default(ConfigEntry<bool>); if (value6.Instance.Config.TryGetEntry<bool>("Item - Crafting - Filter", "Enabled", ref val2) && val2.Value) { val2.Value = false; } value6.Instance.Config.Save(); } if (value7 != null && (Object)(object)value7.Instance != (Object)null) { bool flag = default(bool); foreach (KeyValuePair<ConfigDefinition, ConfigEntryBase> item in ((IEnumerable<KeyValuePair<ConfigDefinition, ConfigEntryBase>>)value7.Instance.Config).Where((KeyValuePair<ConfigDefinition, ConfigEntryBase> entry) => entry.Key.Section == "Crafting Panel" && entry.Value.SettingType == typeof(bool)).ToList()) { object boxedValue = item.Value.BoxedValue; int num; if (boxedValue is bool) { flag = (bool)boxedValue; num = 1; } else { num = 0; } if (((uint)num & (flag ? 1u : 0u)) != 0) { item.Value.BoxedValue = false; } } value7.Instance.Config.Save(); } if (RnR.IsLoaded()) { RnR.Init(); } } private void OnDestroy() { ((BaseUnityPlugin)this).Config.Save(); } private void SetupWatcher() { FileSystemWatcher fileSystemWatcher = new FileSystemWatcher(Paths.ConfigPath, ConfigFileName); fileSystemWatcher.Changed += ReadConfigValues; fileSystemWatcher.Created += ReadConfigValues; fileSystemWatcher.Renamed += ReadConfigValues; fileSystemWatcher.IncludeSubdirectories = true; fileSystemWatcher.SynchronizingObject = ThreadingHelper.SynchronizingObject; fileSystemWatcher.EnableRaisingEvents = true; } private void ReadConfigValues(object sender, FileSystemEventArgs e) { if (!File.Exists(ConfigFileFullPath)) { return; } try { AntiArthriticCraftingLogger.LogDebug((object)"ReadConfigValues called"); ((BaseUnityPlugin)this).Config.Reload(); } catch { AntiArthriticCraftingLogger.LogError((object)("There was an issue loading your " + ConfigFileName)); AntiArthriticCraftingLogger.LogError((object)"Please check your config entries for spelling and format!"); } } private ConfigEntry<T> config<T>(string group, string name, T value, ConfigDescription description, bool synchronizedSetting = true) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown ConfigDescription val = new ConfigDescription(description.Description + (synchronizedSetting ? " [Synced with Server]" : " [Not Synced with Server]"), description.AcceptableValues, description.Tags); ConfigEntry<T> val2 = ((BaseUnityPlugin)this).Config.Bind<T>(group, name, value, val); ConfigSync.AddConfigEntry<T>(val2).SynchronizedConfig = synchronizedSetting; return val2; } private ConfigEntry<T> config<T>(string group, string name, T value, string description, bool synchronizedSetting = true) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown return config(group, name, value, new ConfigDescription(description, (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting); } static AzuAntiArthriticCraftingPlugin() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown string configPath = Paths.ConfigPath; char directorySeparatorChar = Path.DirectorySeparatorChar; ConfigFileFullPath = configPath + directorySeparatorChar + ConfigFileName; instance = null; ConnectionError = ""; harmony = new Harmony("Azumatt.AzuAntiArthriticCrafting"); Asset = null; Asset2 = null; ShaderAssetBundle = null; overlayShader = null; AntiArthriticCraftingLogger = Logger.CreateLogSource("AzuAntiArthriticCrafting"); ConfigSync = new ConfigSync("Azumatt.AzuAntiArthriticCrafting") { DisplayName = "AzuAntiArthriticCrafting", CurrentVersion = "2.0.2", MinimumRequiredVersion = "2.0.2" }; RecipeTrackerUIPrefab = null; RandyInstance = null; _serverConfigLocked = null; ResetCraftingValueOnRecChange = null; Paginator = null; FavoritingSystem = null; IncrementalAmount = null; ShowMaxCraftAmountToggle = null; OverrideCraftingDuration = null; CraftingDuration = null; RequirementTextFormatting = null; InputEnabledText = null; InputDisabledText = null; InputTextColor = null; MinusKeybind = null; ToggleUIKeyBind = null; MaxCraftModifier = null; IncrementalModifier = null; FavoriteToggle = null; HeaderGlowColor = null; HeaderBraidColor = null; RecipeContainerBackgroundColor = null; ItemNameColor = null; RecipeNameColorComplete = null; RecipeNameColorInComplete = null; RecipeCompleteColor = null; RecipeIncompleteRightColor = null; RecipeIncompleteLeftColor = null; RecipeTrackerPanelScale = null; RecipeTrackerItemNameMin = null; RecipeTrackerItemNameMax = null; RecipeTrackerReqNameMin = null; RecipeTrackerReqNameMax = null; RecipeTrackerPanelPosition = null; } } public static class KeyboardExtensions { public static bool IsKeyDown(this KeyboardShortcut shortcut) { //IL_0002: 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) if ((int)((KeyboardShortcut)(ref shortcut)).MainKey != 0 && Input.GetKeyDown(((KeyboardShortcut)(ref shortcut)).MainKey)) { return ((KeyboardShortcut)(ref shortcut)).Modifiers.All((Func<KeyCode, bool>)Input.GetKey); } return false; } public static bool IsKeyHeld(this KeyboardShortcut shortcut) { //IL_0002: 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) if ((int)((KeyboardShortcut)(ref shortcut)).MainKey != 0 && Input.GetKey(((KeyboardShortcut)(ref shortcut)).MainKey)) { return ((KeyboardShortcut)(ref shortcut)).Modifiers.All((Func<KeyCode, bool>)Input.GetKey); } return false; } } public static class LoggingExtensions { public static void LogIfBuildDebug(this ManualLogSource logger, string message) { } public static void LogErrorIfBuildDebug(this ManualLogSource logger, string message) { } } public static class ToggleExtensions { public static bool IsOn(this ConfigEntry<AzuAntiArthriticCraftingPlugin.Toggle> toggle) { return toggle.Value == AzuAntiArthriticCraftingPlugin.Toggle.On; } public static bool IsOff(this ConfigEntry<AzuAntiArthriticCraftingPlugin.Toggle> toggle) { return toggle.Value == AzuAntiArthriticCraftingPlugin.Toggle.Off; } } } namespace AzuAntiArthriticCrafting.Utilities { public class AssetLoadTracker { private static readonly Dictionary<string, string> PrefabToBundleMapping = new Dictionary<string, string>(); private static readonly Dictionary<string, Assembly> BundleToAssemblyMapping = new Dictionary<string, Assembly>(); internal static void MapPrefabsToBundles() { foreach (AssetBundle allLoadedAssetBundle in AssetBundle.GetAllLoadedAssetBundles()) { foreach (string item in from name in allLoadedAssetBundle.GetAllAssetNames() where name.EndsWith(".prefab") select name) { string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(item); PrefabToBundleMapping[fileNameWithoutExtension] = ((Object)allLoadedAssetBundle).name; AzuAntiArthriticCraftingPlugin.AntiArthriticCraftingLogger.LogErrorIfBuildDebug("Mapped original name " + item + " [" + fileNameWithoutExtension + "] to " + ((Object)allLoadedAssetBundle).name); } } } internal static void MapBundlesToAssemblies() { List<Assembly> list = Chainloader.PluginInfos.Select((KeyValuePair<string, PluginInfo> keyValuePair) => ((object)keyValuePair.Value.Instance).GetType().Assembly).ToList(); foreach (string bundleName in PrefabToBundleMapping.Values.Distinct()) { foreach (Assembly item in list) { try { if (item.GetManifestResourceNames().Any((string resourceName) => resourceName.EndsWith(bundleName))) { BundleToAssemblyMapping[bundleName] = item; break; } } catch (Exception arg) { AzuAntiArthriticCraftingPlugin.AntiArthriticCraftingLogger.LogError((object)$"Error while getting manifest resource names for assembly {item.GetName().Name}: {arg}"); } } } } public static Assembly? GetAssemblyForPrefab(string prefabName) { if (PrefabToBundleMapping.TryGetValue(prefabName, out string value) && BundleToAssemblyMapping.TryGetValue(value, out Assembly value2)) { return value2; } return null; } public static string GetBundleForPrefab(string prefabName) { if (!PrefabToBundleMapping.TryGetValue(prefabName, out string value)) { return ""; } return value; } } public class DragWindowCntrl : MonoBehaviour, IBeginDragHandler, IEventSystemHandler, IDragHandler, IEndDragHandler { private RectTransform _window; private Vector2 _delta; public static void ApplyDragWindowCntrl(GameObject go) { go.AddComponent<DragWindowCntrl>(); } private void Awake() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown _window = (RectTransform)((Component)this).transform; } private void Start() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Vector2 value = AzuAntiArthriticCraftingPlugin.RecipeTrackerPanelPosition.Value; _window.anchoredPosition = value; } public void OnBeginDrag(PointerEventData eventData) { //IL_0011: 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_002c: 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_0036: Unknown result type (might be due to invalid IL or missing references) Transform parent = ((Transform)_window).parent; Vector2 val = default(Vector2); RectTransformUtility.ScreenPointToLocalPointInRectangle((RectTransform)(object)((parent is RectTransform) ? parent : null), eventData.position, eventData.pressEventCamera, ref val); _delta = val - _window.anchoredPosition; } public void OnDrag(PointerEventData eventData) { //IL_0011: 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_0027: 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_0031: 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) Transform parent = ((Transform)_window).parent; Vector2 val = default(Vector2); if (RectTransformUtility.ScreenPointToLocalPointInRectangle((RectTransform)(object)((parent is RectTransform) ? parent : null), eventData.position, eventData.pressEventCamera, ref val)) { Vector2 anchoredPosition = val - _delta; _window.anchoredPosition = anchoredPosition; } } public void OnEndDrag(PointerEventData eventData) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) AzuAntiArthriticCraftingPlugin.RecipeTrackerPanelPosition.Value = _window.anchoredPosition; } public void ResetToDefaultPosition() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) _window.anchoredPosition = AzuAntiArthriticCraftingPlugin.RecipeTrackerPanelPosition.Value; } } public abstract class Utilities { private static string _name = ""; public static string Name { get { return _name; } set { if (!(Name == value)) { _name = value; UnityEvent onRecipeChange = InventoryGuiShowCraftingPanelPatch.OnRecipeChange; if (onRecipeChange != null) { onRecipeChange.Invoke(); } ClearRequirements(); } } } public static void AddToUIGroupHandlers(UIGroupHandler newGroup) { if (!((Object)(object)InventoryGui.instance == (Object)null) && !((Object)(object)newGroup == (Object)null)) { UIGroupHandler[] uiGroups = InventoryGui.instance.m_uiGroups; UIGroupHandler[] array = (UIGroupHandler[])(object)new UIGroupHandler[uiGroups.Length + 1]; Array.Copy(uiGroups, array, uiGroups.Length); array[uiGroups.Length] = newGroup; InventoryGui.instance.m_uiGroups = array; Debug.Log((object)$"Successfully added a new UIGroupHandler. Total count: {array.Length}"); } } public static void AddCompToRequirement(Transform elementRoot, Requirement requirement) { NoCostReqHandler component = ((Component)elementRoot).GetComponent<NoCostReqHandler>(); if ((Object)(object)component == (Object)null) { component = ((Component)elementRoot).gameObject.AddComponent<NoCostReqHandler>(); component.m_requirement = requirement; } else { component.m_requirement = requirement; } } public static void ResetAacCrafting() { } public static void CancelCrafting() { InventoryGuiShowCraftingPanelPatch.WasCrafting = false; if (Object.op_Implicit((Object)(object)InventoryGui.instance) && InventoryGui.instance.InCraftTab()) { if (AzuAntiArthriticCraftingPlugin.ResetCraftingValueOnRecChange.IsOff()) { InventoryGuiShowCraftingPanelPatch.OnCraftAmountChanged(InventoryGui.instance, AAACraft.inputAmount.text); } UnblockInput(); } } publ