Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of AugaLite v1.0.5
plugins/AugaLite.dll
Decompiled a month agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Threading; using AugaLite.Utilities; using AugaUnity; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using TMPro; using UnityEngine; using UnityEngine.UI; using fastJSON; [assembly: AssemblyFileVersion("1.3.11.0")] [assembly: Guid("bcc7dd31-d943-4684-800e-176a97dddb8f")] [assembly: ComVisible(false)] [assembly: AssemblyTrademark("")] [assembly: AssemblyCopyright("Copyright © Randy Knapp 2021")] [assembly: AssemblyProduct("Auga")] [assembly: AssemblyCompany("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyDescription("")] [assembly: AssemblyTitle("Auga")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.3.11.0")] [module: UnverifiableCode] namespace AugaLite { public class AugaAssets { public GameObject Hud; public Texture2D Cursor; public GameObject MessageHud; public GameObject DamageText; } public class AugaColors { public string BrightestGold = "#FFBF1B"; public string Topic = "#EAA800"; public string Emphasis = "#1AACEF"; public Color Healing = new Color(0.5f, 1f, 0.5f, 0.7f); public Color PlayerDamage = new Color(1f, 0f, 0f, 1f); public Color PlayerNoDamage = new Color(0.5f, 0.5f, 0.5f, 1f); public Color NormalDamage = new Color(1f, 1f, 1f, 1f); public Color ResistDamage = new Color(0.6f, 0.6f, 0.6f, 1f); public Color WeakDamage = new Color(1f, 1f, 0f, 1f); public Color ImmuneDamage = new Color(0.6f, 0.6f, 0.6f, 1f); public Color TooHard = new Color(0.8f, 0.7f, 0.7f, 1f); } [BepInPlugin("ZenDragon.AugaLite", "AugaLite", "1.0.5")] public class AugaLite : BaseUnityPlugin { public enum StatBarTextDisplayMode { JustValue, ValueAndMax, ValueMaxPercent, JustPercent } public enum StatBarTextPosition { Off = -1, Above, Below, Center, Start, End } public const string PluginID = "ZenDragon.AugaLite"; public const string PluginName = "AugaLite"; public const string Version = "1.0.5"; private static ConfigEntry<bool> _loggingEnabled; private static ConfigEntry<LogLevel> _logLevel; public static ConfigEntry<bool> HealthBarShow; public static ConfigEntry<int> HealthBarFixedSize; public static ConfigEntry<StatBarTextDisplayMode> HealthBarTextDisplay; public static ConfigEntry<StatBarTextPosition> HealthBarTextPosition; public static ConfigEntry<bool> HealthBarShowTicks; public static ConfigEntry<bool> StaminaBarShow; public static ConfigEntry<int> StaminaBarFixedSize; public static ConfigEntry<StatBarTextDisplayMode> StaminaBarTextDisplay; public static ConfigEntry<StatBarTextPosition> StaminaBarTextPosition; public static ConfigEntry<bool> StaminaBarShowTicks; public static ConfigEntry<bool> EitrBarShow; public static ConfigEntry<int> EitrBarFixedSize; public static ConfigEntry<StatBarTextDisplayMode> EitrBarTextDisplay; public static ConfigEntry<StatBarTextPosition> EitrBarTextPosition; public static ConfigEntry<bool> EitrBarShowTicks; public static readonly AugaAssets Assets = new AugaAssets(); public static readonly AugaColors Colors = new AugaColors(); private static AugaLite _instance; private Harmony _harmony; public static AugaLite instance => _instance; public void Awake() { //IL_0086: 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_0097: Unknown result type (might be due to invalid IL or missing references) _instance = this; if (int.TryParse(Assembly.GetExecutingAssembly().GetName().Version.ToString().Split(new char[1] { '.' })[3], out var result) && result > 0) { Debug.LogWarning((object)"=============================================================================="); Debug.LogWarning((object)"You are using a PTB version of this mod. It will not work in prior versions."); Debug.LogWarning((object)$"Project Auga - Version {Assembly.GetExecutingAssembly().GetName().Version}"); Debug.LogWarning((object)("Valheim - Version " + Version.GetVersionString(false))); if ((Version.CurrentVersion.m_minor != 217 || Version.CurrentVersion.m_patch < 27) && Version.CurrentVersion.m_minor <= 217) { Debug.LogError((object)">>>>>>>>> GAME VERSION MISMATCH - EXITING <<<<<<<<"); Debug.LogWarning((object)"=============================================================================="); Thread.Sleep(10000); Object.Destroy((Object)(object)this); return; } Debug.LogWarning((object)"GAME VERSION CHECK - PASSED"); Debug.LogWarning((object)"=============================================================================="); } LoadDependencies(); LoadTranslations(); LoadConfig(); LoadAssets(); _harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "ZenDragon.AugaLite"); } public void OnDestroy() { _instance = null; } private void LoadDependencies() { Assembly callingAssembly = Assembly.GetCallingAssembly(); LoadEmbeddedAssembly(callingAssembly, "fastJSON.dll"); LoadEmbeddedAssembly(callingAssembly, "Unity.AugaLite.dll"); } private static void LoadEmbeddedAssembly(Assembly assembly, string assemblyName) { Stream manifestResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(assembly.GetName().Name + "." + assemblyName); if (manifestResourceStream == null) { LogError("Could not load embedded assembly (" + assemblyName + ")!"); return; } using (manifestResourceStream) { byte[] array = new byte[manifestResourceStream.Length]; manifestResourceStream.Read(array, 0, array.Length); Assembly.Load(array); } } private static void LoadTranslations() { string text = LoadJsonText("translations.json"); if (string.IsNullOrEmpty(text)) { return; } foreach (KeyValuePair<string, object> item in (IDictionary<string, object>)JSON.Parse(text)) { if (!string.IsNullOrEmpty(item.Key) && !string.IsNullOrEmpty(item.Value.ToString())) { Localization.instance.AddWord(item.Key, item.Value.ToString()); } } } private void LoadConfig() { _loggingEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Logging", "LoggingEnabled", false, "Enable logging"); _logLevel = ((BaseUnityPlugin)this).Config.Bind<LogLevel>("Logging", "LogLevel", (LogLevel)16, "Only log messages of the selected level or higher"); HealthBarShow = ((BaseUnityPlugin)this).Config.Bind<bool>("StatBars", "HealthBarShow", true, "If false, hides the health bar completely."); HealthBarFixedSize = ((BaseUnityPlugin)this).Config.Bind<int>("StatBars", "HealthBarFixedSize", 0, "If greater than 0, forces the health bar to be that many pixels long, regardless of the player's max health."); HealthBarTextDisplay = ((BaseUnityPlugin)this).Config.Bind<StatBarTextDisplayMode>("StatBars", "HealthBarTextDisplay", StatBarTextDisplayMode.JustValue, "Changes how the label of the health bar is displayed."); HealthBarTextPosition = ((BaseUnityPlugin)this).Config.Bind<StatBarTextPosition>("StatBars", "HealthBarTextPosition", StatBarTextPosition.Center, "Changes where the label of the health bar is displayed."); HealthBarShowTicks = ((BaseUnityPlugin)this).Config.Bind<bool>("StatBars", "HealthBarShowTicks", false, "Show a faint line on the bar every 25 units"); StaminaBarShow = ((BaseUnityPlugin)this).Config.Bind<bool>("StatBars", "StaminaBarShow", true, "If false, hides the stamina bar completely."); StaminaBarFixedSize = ((BaseUnityPlugin)this).Config.Bind<int>("StatBars", "StaminaBarFixedSize", 0, "If greater than 0, forces the stamina bar to be that many pixels long, regardless of the player's max stamina."); StaminaBarTextDisplay = ((BaseUnityPlugin)this).Config.Bind<StatBarTextDisplayMode>("StatBars", "StaminaBarTextDisplay", StatBarTextDisplayMode.JustValue, "Changes how the label of the stamina bar is displayed."); StaminaBarTextPosition = ((BaseUnityPlugin)this).Config.Bind<StatBarTextPosition>("StatBars", "StaminaBarTextPosition", StatBarTextPosition.Center, "Changes where the label of the stamina bar is displayed."); StaminaBarShowTicks = ((BaseUnityPlugin)this).Config.Bind<bool>("StatBars", "StaminaBarShowTicks", false, "Show a faint line on the bar every 25 units"); EitrBarShow = ((BaseUnityPlugin)this).Config.Bind<bool>("StatBars", "EitrBarShow", true, "If false, hides the eitr bar completely."); EitrBarFixedSize = ((BaseUnityPlugin)this).Config.Bind<int>("StatBars", "EitrBarFixedSize", 0, "If greater than 0, forces the eitr bar to be that many pixels long, regardless of the player's max eitr. Eitr bar still hides if max eitr is zero."); EitrBarTextDisplay = ((BaseUnityPlugin)this).Config.Bind<StatBarTextDisplayMode>("StatBars", "EitrBarTextDisplay", StatBarTextDisplayMode.JustValue, "Changes how the label of the eitr bar is displayed."); EitrBarTextPosition = ((BaseUnityPlugin)this).Config.Bind<StatBarTextPosition>("StatBars", "EitrBarTextPosition", StatBarTextPosition.Center, "Changes where the label of the eitr bar is displayed."); EitrBarShowTicks = ((BaseUnityPlugin)this).Config.Bind<bool>("StatBars", "EitrBarShowTicks", false, "Show a faint line on the bar every 25 units"); } private static void LoadAssets() { AssetBundle val = LoadAssetBundle("augaassets"); Assets.Cursor = val.LoadAsset<Texture2D>("Cursor2"); Assets.Hud = val.LoadAsset<GameObject>("HUD"); Assets.MessageHud = val.LoadAsset<GameObject>("AugaMessageHud"); Assets.DamageText = val.LoadAsset<GameObject>("AugaDamageText"); } private static void ApplyCursor() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) Cursor.SetCursor(Assets.Cursor, new Vector2(6f, 5f), (CursorMode)0); } public static AssetBundle LoadAssetBundle(string filename) { string assetPath = GetAssetPath(filename); if (!string.IsNullOrEmpty(assetPath)) { return AssetBundle.LoadFromFile(assetPath); } Assembly callingAssembly = Assembly.GetCallingAssembly(); return AssetBundle.LoadFromStream(callingAssembly.GetManifestResourceStream(callingAssembly.GetName().Name + "." + filename)); } public static string LoadJsonText(string filename) { string assetPath = GetAssetPath(filename); if (string.IsNullOrEmpty(assetPath)) { return null; } return File.ReadAllText(assetPath); } public static string GetAssetPath(string assetName) { string text = Path.Combine(Paths.PluginPath, "Auga", assetName); if (!File.Exists(text)) { text = Path.Combine(Path.GetDirectoryName(typeof(AugaLite).Assembly.Location) ?? string.Empty, assetName); if (!File.Exists(text)) { LogError("Could not find asset (" + assetName + ")"); return null; } } return text; } public static void Log(string message) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 if (_loggingEnabled.Value && (int)_logLevel.Value <= 16) { ((BaseUnityPlugin)_instance).Logger.LogInfo((object)message); } } public static void LogWarning(string message) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Invalid comparison between Unknown and I4 if (_loggingEnabled.Value && (int)_logLevel.Value <= 4) { ((BaseUnityPlugin)_instance).Logger.LogWarning((object)message); } } public static void LogError(string message) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Invalid comparison between Unknown and I4 if (_loggingEnabled.Value && (int)_logLevel.Value <= 2) { ((BaseUnityPlugin)_instance).Logger.LogError((object)message); } } public static void UpdateStatBars() { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: 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_016b: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Hud.instance != (Object)null)) { return; } Transform val = ((Component)Hud.instance).transform.Find("hudroot/HealthBar"); Transform val2 = ((Component)Hud.instance).transform.Find("hudroot/StaminaBar"); Transform val3 = ((Component)Hud.instance).transform.Find("hudroot/EitrBar"); if ((Object)(object)val != (Object)null) { AugaHealthBar component = ((Component)val).GetComponent<AugaHealthBar>(); if (component != null) { component.Hide = !HealthBarShow.Value; component.FixedLength = HealthBarFixedSize.Value; component.TextDisplay = (TextDisplayMode)HealthBarTextDisplay.Value; component.DisplayTextPosition = (TextPosition)HealthBarTextPosition.Value; component.ShowTicks = HealthBarShowTicks.Value; } } if ((Object)(object)val2 != (Object)null) { AugaHealthBar component2 = ((Component)val2).GetComponent<AugaHealthBar>(); if (component2 != null) { component2.Hide = !StaminaBarShow.Value; component2.FixedLength = StaminaBarFixedSize.Value; component2.TextDisplay = (TextDisplayMode)StaminaBarTextDisplay.Value; component2.DisplayTextPosition = (TextPosition)StaminaBarTextPosition.Value; component2.ShowTicks = StaminaBarShowTicks.Value; } } if ((Object)(object)val3 != (Object)null) { AugaHealthBar component3 = ((Component)val3).GetComponent<AugaHealthBar>(); if (component3 != null) { component3.Hide = !EitrBarShow.Value; component3.FixedLength = EitrBarFixedSize.Value; component3.TextDisplay = (TextDisplayMode)EitrBarTextDisplay.Value; component3.DisplayTextPosition = (TextPosition)EitrBarTextPosition.Value; component3.ShowTicks = EitrBarShowTicks.Value; } } } } public class MovableHudElement : MonoBehaviour { public ConfigEntry<TextAnchor> Anchor; public ConfigEntry<Vector2> Position; public ConfigEntry<float> Scale; public void Init(TextAnchor defaultAnchor, float defaultPositionX, float defaultPositionY) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) Init(((Object)((Component)this).gameObject).name, defaultAnchor, defaultPositionX, defaultPositionY); } public void Init(string nameOverride, TextAnchor defaultAnchor, float defaultPositionX, float defaultPositionY) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) Anchor = ((BaseUnityPlugin)AugaLite.instance).Config.Bind<TextAnchor>(nameOverride, nameOverride + "Anchor", defaultAnchor, "Anchor for " + nameOverride); Position = ((BaseUnityPlugin)AugaLite.instance).Config.Bind<Vector2>(nameOverride, nameOverride + "Position", new Vector2(defaultPositionX, defaultPositionY), "Position for " + nameOverride); Scale = ((BaseUnityPlugin)AugaLite.instance).Config.Bind<float>(nameOverride, nameOverride + "Scale", 1f, "Uniform scale for " + nameOverride); } public void Update() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected I4, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: 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_00a8: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0102: 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_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0128: 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) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) if (Anchor != null && Position != null && Scale != null) { RectTransform val = (RectTransform)((Component)this).transform; TextAnchor value = Anchor.Value; Vector2 val2 = default(Vector2); switch ((int)value) { case 0: { ((Vector2)(ref val2))..ctor(0f, 1f); val.anchorMax = val2; Vector2 pivot = (val.anchorMin = val2); val.pivot = pivot; break; } case 1: { ((Vector2)(ref val2))..ctor(0.5f, 1f); val.anchorMax = val2; Vector2 pivot = (val.anchorMin = val2); val.pivot = pivot; break; } case 2: { ((Vector2)(ref val2))..ctor(1f, 1f); val.anchorMax = val2; Vector2 pivot = (val.anchorMin = val2); val.pivot = pivot; break; } case 3: { ((Vector2)(ref val2))..ctor(0f, 0.5f); val.anchorMax = val2; Vector2 pivot = (val.anchorMin = val2); val.pivot = pivot; break; } case 4: { ((Vector2)(ref val2))..ctor(0.5f, 0.5f); val.anchorMax = val2; Vector2 pivot = (val.anchorMin = val2); val.pivot = pivot; break; } case 5: { ((Vector2)(ref val2))..ctor(1f, 0.5f); val.anchorMax = val2; Vector2 pivot = (val.anchorMin = val2); val.pivot = pivot; break; } case 6: { ((Vector2)(ref val2))..ctor(0f, 0f); val.anchorMax = val2; Vector2 pivot = (val.anchorMin = val2); val.pivot = pivot; break; } case 7: { ((Vector2)(ref val2))..ctor(0.5f, 0f); val.anchorMax = val2; Vector2 pivot = (val.anchorMin = val2); val.pivot = pivot; break; } case 8: { ((Vector2)(ref val2))..ctor(1f, 0f); val.anchorMax = val2; Vector2 pivot = (val.anchorMin = val2); val.pivot = pivot; break; } } val.anchoredPosition = Position.Value; ((Transform)val).localScale = new Vector3(Scale.Value, Scale.Value); } } } [Flags] public enum ReplaceFlags { None = 0, Instantiate = 1, DestroyOriginal = 2 } public static class AugaExtensions { public static RectTransform RectTransform(this Component c) { Transform transform = c.transform; return (RectTransform)(object)((transform is RectTransform) ? transform : null); } public static RectTransform RectTransform(this GameObject go) { Transform transform = go.transform; return (RectTransform)(object)((transform is RectTransform) ? transform : null); } public static void HideElement(this Component c) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)c != (Object)null) { c.gameObject.SetActive(false); c.gameObject.transform.localScale = Vector3.zero; } } public static void HideElementByType<T>(this Component parent) where T : Component { if (!((Object)(object)parent == (Object)null)) { ((Component)(object)parent.GetComponentInChildren<T>()).HideElement(); } } public static void HideElementByName(this GameObject parent, string name) { ((Component)(object)parent.transform).HideElementByName(name); } public static void HideElementByName(this Component parent, string name) { if (!((Object)(object)parent == (Object)null)) { ((Component)(object)parent.transform.Find(name)).HideElement(); } } public static Transform Replace(this Transform c, string findPath, Transform other, string otherFindPath = null, ReplaceFlags flags = ReplaceFlags.Instantiate | ReplaceFlags.DestroyOriginal) { Transform val = c.Find(findPath); if ((Object)(object)val == (Object)null) { return null; } otherFindPath = otherFindPath ?? findPath; Transform val2 = other.Find(otherFindPath); if ((Object)(object)val2 == (Object)null) { return null; } Transform parent = val.parent; int siblingIndex = val.GetSiblingIndex(); val.SetParent((Transform)null); if ((flags & ReplaceFlags.DestroyOriginal) != 0) { Object.Destroy((Object)(object)((Component)val).gameObject); } if ((flags & ReplaceFlags.Instantiate) != 0) { val2 = Object.Instantiate<Transform>(val2, parent); ((Object)val2).name = ((Object)val2).name.Replace("(Clone)", "").Replace("(clone)", ""); } else { val2.SetParent(parent); } val2.SetSiblingIndex(siblingIndex); return val2; } public static Transform Replace(this Component c, string findPath, GameObject other, string otherFindPath = null, ReplaceFlags flags = ReplaceFlags.Instantiate | ReplaceFlags.DestroyOriginal) { return c.transform.Replace(findPath, other.transform, otherFindPath, flags); } public static Transform Replace(this Transform c, string findPath, GameObject other, string otherFindPath = null, ReplaceFlags flags = ReplaceFlags.Instantiate | ReplaceFlags.DestroyOriginal) { return c.Replace(findPath, other.transform, otherFindPath, flags); } public static Transform Replace(this GameObject go, string findPath, Transform other, string otherFindPath = null, ReplaceFlags flags = ReplaceFlags.Instantiate | ReplaceFlags.DestroyOriginal) { return go.transform.Replace(findPath, other, otherFindPath, flags); } public static Transform Replace(this GameObject go, string findPath, GameObject other, string otherFindPath = null, ReplaceFlags flags = ReplaceFlags.Instantiate | ReplaceFlags.DestroyOriginal) { return go.transform.Replace(findPath, other.transform, otherFindPath, flags); } public static Transform CopyOver(this GameObject go, string findPath, GameObject other, int siblingIndex) { Transform val = other.transform.Find(findPath); if ((Object)(object)val == (Object)null) { return null; } val = Object.Instantiate<Transform>(val, go.transform); ((Object)val).name = ((Object)val).name.Replace("(Clone)", "").Replace("(clone)", ""); val.SetSiblingIndex(siblingIndex); return val; } public static T RequireComponent<T>(this Component c) where T : Component { T val = c.GetComponent<T>(); if ((Object)(object)val == (Object)null) { val = c.gameObject.AddComponent<T>(); } return val; } public static T RequireComponent<T>(this GameObject go) where T : Component { T val = go.GetComponent<T>(); if ((Object)(object)val == (Object)null) { val = go.AddComponent<T>(); } return val; } } [HarmonyPatch(typeof(GuiBar), "SetBar")] public static class GuiBar_Patch { public static bool Prefix(GuiBar __instance, float i) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Invalid comparison between Unknown and I4 if ((Object)(object)__instance != (Object)null && (Object)(object)__instance.m_barImage != (Object)null && (int)__instance.m_barImage.type == 3) { __instance.m_barImage.fillAmount = i; return false; } return true; } } [HarmonyPatch(typeof(Hud))] public static class Hud_Setup { [HarmonyPostfix] [HarmonyPatch("Awake")] [HarmonyPriority(800)] public static void Hud_Awake_Postfix(Hud __instance) { //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Expected O, but got Unknown //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Expected O, but got Unknown __instance.m_saveIcon = ((Component)((Component)(object)__instance).Replace("hudroot/SaveIcon", AugaLite.Assets.Hud)).gameObject; __instance.m_saveIconImage = __instance.m_saveIcon.GetComponent<Image>(); __instance.m_badConnectionIcon = ((Component)((Component)(object)__instance).Replace("hudroot/BadConnectionIcon", AugaLite.Assets.Hud)).gameObject; DreamTexts dreamTexts = __instance.m_sleepingProgress.GetComponent<SleepText>().m_dreamTexts; Transform val = ((Component)(object)__instance).Replace("LoadingBlack", AugaLite.Assets.Hud); __instance.m_loadingScreen = ((Component)val).GetComponent<CanvasGroup>(); __instance.m_loadingProgress = ((Component)val.Find("Loading")).gameObject; __instance.m_sleepingProgress = ((Component)val.Find("Sleeping")).gameObject; __instance.m_teleportingProgress = ((Component)val.Find("Teleporting")).gameObject; __instance.m_loadingImage = ((Component)val.Find("Loading/Image")).GetComponent<Image>(); __instance.m_loadingTip = ((Component)val.Find("Loading/Tip")).GetComponent<TMP_Text>(); __instance.m_sleepingProgress.GetComponent<SleepText>().m_dreamTexts = dreamTexts; __instance.m_eventBar = ((Component)((Component)(object)__instance).Replace("hudroot/EventBar", AugaLite.Assets.Hud)).gameObject; __instance.m_eventName = __instance.m_eventBar.GetComponentInChildren<TMP_Text>(); __instance.m_eventBar.gameObject.AddComponent<MovableHudElement>().Init((TextAnchor)1, 0f, -90f); __instance.m_damageScreen = ((Component)((Component)(object)__instance).Replace("hudroot/Damaged", AugaLite.Assets.Hud)).GetComponent<Image>(); TextMeshProUGUI component = ((Component)AugaLite.Assets.Hud.transform.Find("hudroot/crosshair/Dummy/HoverName")).GetComponent<TextMeshProUGUI>(); TMP_FontAsset font = ((TMP_Text)__instance.m_hoverName).font; ((TMP_Text)__instance.m_hoverName).font = ((TMP_Text)component).font; ((TMP_Text)__instance.m_hoverName).font.fallbackFontAssetTable.Insert(0, font); Material material = ((Graphic)__instance.m_gpIcon).material; __instance.m_gpRoot = (RectTransform)((Component)(object)__instance).Replace("hudroot/GuardianPower", AugaLite.Assets.Hud); __instance.m_gpName = ((Component)((Transform)__instance.m_gpRoot).Find("Name")).GetComponent<TMP_Text>(); __instance.m_gpIcon = ((Component)((Transform)__instance.m_gpRoot).Find("Icon")).GetComponent<Image>(); ((Graphic)__instance.m_gpIcon).material = material; __instance.m_gpCooldown = ((Component)((Transform)__instance.m_gpRoot).Find("GPTimeText")).GetComponent<TMP_Text>(); ((Component)(object)((Transform)__instance.m_gpRoot).Find("GPKey")).HideElement(); ((Component)__instance.m_gpRoot).gameObject.AddComponent<MovableHudElement>().Init((TextAnchor)6, 60f, 70f); foreach (Transform item in (Transform)__instance.m_healthPanel) { ((Component)item).HideElement(); } ((Component)(object)__instance.m_staminaBar2Root).HideElement(); ((Component)(object)__instance.m_eitrBarRoot).HideElement(); Transform obj = ((Component)__instance).transform.Find("hudroot"); Transform val2 = ((Component)obj).gameObject.CopyOver("hudroot/FoodPanel0", AugaLite.Assets.Hud, 5); Transform val3 = ((Component)obj).gameObject.CopyOver("hudroot/FoodPanel1", AugaLite.Assets.Hud, 6); Transform val4 = ((Component)obj).gameObject.CopyOver("hudroot/FoodPanel2", AugaLite.Assets.Hud, 7); Transform val5 = ((Component)obj).gameObject.CopyOver("hudroot/HealthBar", AugaLite.Assets.Hud, 8); Transform val6 = ((Component)obj).gameObject.CopyOver("hudroot/StaminaBar", AugaLite.Assets.Hud, 9); Transform val7 = ((Component)obj).gameObject.CopyOver("hudroot/EitrBar", AugaLite.Assets.Hud, 10); ((Component)val2).gameObject.AddComponent<MovableHudElement>().Init((TextAnchor)6, 138f, 66f); ((Component)val3).gameObject.AddComponent<MovableHudElement>().Init((TextAnchor)6, 167f, 95f); ((Component)val4).gameObject.AddComponent<MovableHudElement>().Init((TextAnchor)6, 138f, 124f); ((Component)val5).gameObject.AddComponent<MovableHudElement>().Init((TextAnchor)6, 208f, 123.5f); ((Component)val6).gameObject.AddComponent<MovableHudElement>().Init((TextAnchor)6, 208f, 99.5f); ((Component)val7).gameObject.AddComponent<MovableHudElement>().Init((TextAnchor)6, 185f, 74.5f); __instance.m_healthAnimator = ((Component)val5).GetComponent<Animator>(); __instance.m_foodBars = Array.Empty<Image>(); __instance.m_foodIcons = Array.Empty<Image>(); __instance.m_staminaAnimator = ((Component)val6).GetComponent<Animator>(); __instance.m_eitrAnimator = ((Component)val7).GetComponent<Animator>(); __instance.m_actionBarRoot = ((Component)((Component)(object)__instance).Replace("hudroot/action_progress", AugaLite.Assets.Hud)).gameObject; __instance.m_actionName = __instance.m_actionBarRoot.GetComponentInChildren<TMP_Text>(); __instance.m_actionProgress = __instance.m_actionBarRoot.GetComponent<GuiBar>(); __instance.m_actionBarRoot.gameObject.AddComponent<MovableHudElement>().Init("ActionProgress", (TextAnchor)7, 0f, 226f); Transform val8 = ((Component)(object)__instance).Replace("hudroot/staggerpanel", AugaLite.Assets.Hud); __instance.m_staggerAnimator = ((Component)val8).GetComponent<Animator>(); __instance.m_staggerProgress = ((Component)val8.Find("staggerbar/RightBar/Background/FillMask/FillFast")).GetComponent<GuiBar>(); ((Component)val8).gameObject.AddComponent<MovableHudElement>().Init("StaggerPanel", (TextAnchor)7, 0f, 151f); AugaLite.UpdateStatBars(); Localization.instance.Localize(((Component)__instance).transform); } [HarmonyPatch("UpdateFood")] [HarmonyPrefix] public static bool Hud_UpdateFood_Prefix() { return false; } [HarmonyPrefix] [HarmonyPatch("SetHealthBarSize")] public static bool Hud_SetHealthBarSize_Prefix() { return false; } [HarmonyPatch("SetStaminaBarSize")] [HarmonyPrefix] public static bool Hud_SetStaminaBarSize_Prefix() { return false; } [HarmonyPatch("UpdateHealth")] [HarmonyPrefix] public static bool Hud_UpdateHealth_Prefix() { return false; } [HarmonyPrefix] [HarmonyPatch("UpdateStamina")] public static bool Hud_UpdateStamina_Prefix() { return false; } [HarmonyPrefix] [HarmonyPatch("UpdateEitr")] public static bool Hud_UpdateEitr_Prefix() { return false; } } [HarmonyPatch(typeof(Hud), "StaminaBarEmptyFlash")] public static class Hud_StaminaBarEmptyFlash_Patch { [CompilerGenerated] private sealed class <FlashStaminaBar>d__3 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Hud instance; private Image <staminaBarBorder>5__2; private int <i>5__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <FlashStaminaBar>d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <staminaBarBorder>5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <staminaBarBorder>5__2 = ((Component)((Component)instance.m_staminaAnimator).transform.Find("Background/Border")).GetComponent<Image>(); <i>5__3 = 0; break; case 1: <>1__state = -1; ((Graphic)<staminaBarBorder>5__2).color = Color.black; <>2__current = (object)new WaitForSeconds(0.15f); <>1__state = 2; return true; case 2: <>1__state = -1; <i>5__3++; break; } if (<i>5__3 < 3) { ((Graphic)<staminaBarBorder>5__2).color = Color.white; <>2__current = (object)new WaitForSeconds(0.15f); <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private const float FlashDuration = 0.15f; private static Coroutine _staminaFlashCoroutine; public static bool Prefix(Hud __instance) { if (_staminaFlashCoroutine != null) { ((MonoBehaviour)__instance).StopCoroutine(_staminaFlashCoroutine); } _staminaFlashCoroutine = ((MonoBehaviour)__instance).StartCoroutine(FlashStaminaBar(__instance)); return false; } [IteratorStateMachine(typeof(<FlashStaminaBar>d__3))] private static IEnumerator FlashStaminaBar(Hud instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <FlashStaminaBar>d__3(0) { instance = instance }; } } [RequireComponent(typeof(Player))] public class LastHitTracker : MonoBehaviour { public HitData LastHit; protected Player _player; public void Awake() { _player = ((Component)this).GetComponent<Player>(); } public virtual void OnDamaged(HitData hitData) { LastHit = hitData; } } [HarmonyPatch(typeof(Player), "OnDamaged")] public static class Player_OnDamaged_Patch { public static void Postfix(Player __instance, HitData hit) { ((Component)(object)__instance).RequireComponent<LastHitTracker>().OnDamaged(hit); } } public static class MessageHud_Setup { [HarmonyPrefix] [HarmonyPatch(typeof(MessageHud), "Awake")] public static bool MessageHud_Awake_Prefix(MessageHud __instance) { return !SetupHelper.IndirectTwoObjectReplace(((Component)__instance).transform, AugaLite.Assets.MessageHud, "HudMessage", "TopLeftMessage", "AugaMessageHud"); } [HarmonyPostfix] [HarmonyPatch(typeof(MessageHud), "Awake")] public static void MessageHud_Awake_Postfix(MessageHud __instance) { if (!((Object)(object)__instance == (Object)null)) { AugaTopLeftMessageController component = ((Component)__instance).GetComponent<AugaTopLeftMessageController>(); if (Object.op_Implicit((Object)(object)component)) { ((Component)((Transform)component.LogContainer).parent).gameObject.AddComponent<MovableHudElement>().Init((TextAnchor)0, 55f, -115f); } ((Component)__instance.m_messageCenterText).gameObject.AddComponent<MovableHudElement>().Init((TextAnchor)4, 0f, 150f); } } [HarmonyPostfix] [HarmonyPatch(typeof(MessageHud), "ShowMessage")] public static void MessageHud_ShowMessage_Postfix(MessageHud __instance, MessageType type, string text, int amount, Sprite icon) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Invalid comparison between Unknown and I4 if (!Hud.IsUserHidden()) { text = Localization.instance.Localize(text); if ((int)type == 1) { ((Component)__instance).GetComponent<AugaTopLeftMessageController>().AddMessage(text, icon, amount); } } } } public static class SetupHelper { public static bool DirectObjectReplace(Transform original, GameObject prefab, string originalName) { GameObject newObject; return DirectObjectReplace(original, prefab, originalName, out newObject); } public static bool DirectObjectReplace(Transform original, GameObject prefab, string originalName, out GameObject newObject) { if (((Object)original).name != originalName) { newObject = null; return false; } Transform parent = original.parent; int siblingIndex = original.GetSiblingIndex(); Object.DestroyImmediate((Object)(object)((Component)original).gameObject); newObject = Object.Instantiate<GameObject>(prefab, parent, false); newObject.transform.SetSiblingIndex(siblingIndex); return true; } public static bool IndirectTwoObjectReplace(Transform primaryOriginal, GameObject prefab, string originalName, string secondaryName, string newPrimaryName) { if (((Object)primaryOriginal).name.StartsWith("Auga")) { return false; } if (((Object)primaryOriginal).name != originalName) { return false; } if (!Object.op_Implicit((Object)(object)prefab)) { AugaLite.LogWarning("Prefab for " + originalName + " converting to " + newPrimaryName + " for " + secondaryName + " not found."); return false; } Transform parent = primaryOriginal.parent; if ((Object)(object)parent != (Object)null) { Transform val = parent.Find(secondaryName); if ((Object)(object)val != (Object)null) { int siblingIndex = val.GetSiblingIndex(); int siblingIndex2 = primaryOriginal.GetSiblingIndex(); Object.DestroyImmediate((Object)(object)((Component)val).gameObject); Object.DestroyImmediate((Object)(object)((Component)primaryOriginal).gameObject); GameObject obj = Object.Instantiate<GameObject>(prefab, parent); Transform val2 = obj.transform.Find(secondaryName); Transform obj2 = obj.transform.Find(newPrimaryName); val2.SetParent(parent); obj2.SetParent(parent); val2.SetSiblingIndex(siblingIndex); obj2.SetSiblingIndex(siblingIndex2); Object.Destroy((Object)(object)obj); return true; } } return false; } } [HarmonyPatch(typeof(Text))] public static class Text_Patch { public static TextInfo TextInfo = new CultureInfo("en-US").TextInfo; [HarmonyPatch(/*Could not decode attribute arguments.*/)] public static bool Prefix(Text __instance, ref string value) { if ((Object)(object)__instance == (Object)null || string.IsNullOrEmpty(value)) { return true; } if ((Object)(object)((Component)__instance).GetComponent<AlwaysUpper>() != (Object)null) { if (value.StartsWith("$")) { value = Localization.instance.Localize(value); } value = value.ToUpper(); } else if ((Object)(object)((Component)__instance).GetComponent<TitleCase>() != (Object)null) { if (value.StartsWith("$")) { value = Localization.instance.Localize(value); } value = TextInfo.ToTitleCase(value); } return true; } } } namespace AugaLite.Utilities { public class TranspilerHelpers { private int _counter; private bool _enableLogging; public TranspilerHelpers(bool loggingEnabled = false) { _enableLogging = loggingEnabled; } public CodeInstruction LogMessage(CodeInstruction instruction) { if (!_enableLogging) { return instruction; } _counter++; return instruction; } public CodeInstruction FindInstructionWithLabel(List<CodeInstruction> codeInstructions, int index, Label label) { if (index >= codeInstructions.Count) { return null; } if (codeInstructions[index].labels.Contains(label)) { return codeInstructions[index]; } return FindInstructionWithLabel(codeInstructions, index + 1, label); } } } namespace AugaLite.Compat { public static class Jewelcrafting { [CompilerGenerated] private sealed class <AddSocketAddingTab_InventoryGui_Awake_Transpiler>d__20 : IEnumerable<CodeInstruction>, IEnumerable, IEnumerator<CodeInstruction>, IDisposable, IEnumerator { private int <>1__state; private CodeInstruction <>2__current; private int <>l__initialThreadId; private IEnumerable<CodeInstruction> instructions; public IEnumerable<CodeInstruction> <>3__instructions; private List<CodeInstruction> <instrs>5__2; private TranspilerHelpers <th>5__3; private int <i>5__4; CodeInstruction IEnumerator<CodeInstruction>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <AddSocketAddingTab_InventoryGui_Awake_Transpiler>d__20(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { <instrs>5__2 = null; <th>5__3 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <instrs>5__2 = instructions.ToList(); <th>5__3 = new TranspilerHelpers(); <i>5__4 = 0; break; case 1: { <>1__state = -1; int num = <i>5__4 + 1; <i>5__4 = num; break; } } if (<i>5__4 < <instrs>5__2.Count) { <>2__current = <th>5__3.LogMessage(<instrs>5__2[<i>5__4]); <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator<CodeInstruction> IEnumerable<CodeInstruction>.GetEnumerator() { <AddSocketAddingTab_InventoryGui_Awake_Transpiler>d__20 <AddSocketAddingTab_InventoryGui_Awake_Transpiler>d__; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; <AddSocketAddingTab_InventoryGui_Awake_Transpiler>d__ = this; } else { <AddSocketAddingTab_InventoryGui_Awake_Transpiler>d__ = new <AddSocketAddingTab_InventoryGui_Awake_Transpiler>d__20(0); } <AddSocketAddingTab_InventoryGui_Awake_Transpiler>d__.instructions = <>3__instructions; return <AddSocketAddingTab_InventoryGui_Awake_Transpiler>d__; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable<CodeInstruction>)this).GetEnumerator(); } } [CompilerGenerated] private sealed class <DisplaySynergyView_Awake_Transpiler>d__23 : IEnumerable<CodeInstruction>, IEnumerable, IEnumerator<CodeInstruction>, IDisposable, IEnumerator { private int <>1__state; private CodeInstruction <>2__current; private int <>l__initialThreadId; private IEnumerable<CodeInstruction> instructions; public IEnumerable<CodeInstruction> <>3__instructions; private List<CodeInstruction> <instrs>5__2; private TranspilerHelpers <th>5__3; private int <i>5__4; CodeInstruction IEnumerator<CodeInstruction>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <DisplaySynergyView_Awake_Transpiler>d__23(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { <instrs>5__2 = null; <th>5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected O, but got Unknown int num; switch (<>1__state) { default: return false; case 0: <>1__state = -1; <instrs>5__2 = instructions.ToList(); <th>5__3 = new TranspilerHelpers(); <i>5__4 = 0; break; case 1: <>1__state = -1; goto IL_00fc; case 2: { <>1__state = -1; goto IL_00fc; } IL_00fc: num = <i>5__4 + 1; <i>5__4 = num; break; } if (<i>5__4 < <instrs>5__2.Count) { if (<i>5__4 > 0 && <instrs>5__2[<i>5__4].opcode == OpCodes.Ldstr && <instrs>5__2[<i>5__4].operand.Equals("ac_text")) { <>2__current = <th>5__3.LogMessage(new CodeInstruction(OpCodes.Ldstr, (object)"Text")); <>1__state = 1; return true; } <>2__current = <th>5__3.LogMessage(<instrs>5__2[<i>5__4]); <>1__state = 2; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator<CodeInstruction> IEnumerable<CodeInstruction>.GetEnumerator() { <DisplaySynergyView_Awake_Transpiler>d__23 <DisplaySynergyView_Awake_Transpiler>d__; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; <DisplaySynergyView_Awake_Transpiler>d__ = this; } else { <DisplaySynergyView_Awake_Transpiler>d__ = new <DisplaySynergyView_Awake_Transpiler>d__23(0); } <DisplaySynergyView_Awake_Transpiler>d__.instructions = <>3__instructions; return <DisplaySynergyView_Awake_Transpiler>d__; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable<CodeInstruction>)this).GetEnumerator(); } } [CompilerGenerated] private sealed class <FusionBoxSetup_AddSealButton_Postfix_Transpiler>d__15 : IEnumerable<CodeInstruction>, IEnumerable, IEnumerator<CodeInstruction>, IDisposable, IEnumerator { private int <>1__state; private CodeInstruction <>2__current; private int <>l__initialThreadId; private IEnumerable<CodeInstruction> instructions; public IEnumerable<CodeInstruction> <>3__instructions; private TranspilerHelpers <th>5__2; private List<CodeInstruction> <instrs>5__3; private bool <skipRows>5__4; private int <i>5__5; CodeInstruction IEnumerator<CodeInstruction>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <FusionBoxSetup_AddSealButton_Postfix_Transpiler>d__15(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { <th>5__2 = null; <instrs>5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown int num; switch (<>1__state) { default: return false; case 0: <>1__state = -1; <th>5__2 = new TranspilerHelpers(); <instrs>5__3 = instructions.ToList(); <skipRows>5__4 = false; <i>5__5 = 0; goto IL_022e; case 1: <>1__state = -1; goto IL_021e; case 2: <>1__state = -1; <>2__current = <th>5__2.LogMessage(new CodeInstruction(OpCodes.Call, (object)AccessTools.DeclaredMethod(typeof(Jewelcrafting), "ChangeSealPosition", (Type[])null, (Type[])null))); <>1__state = 3; return true; case 3: <>1__state = -1; goto IL_021e; case 4: { <>1__state = -1; goto IL_021e; } IL_022e: if (<i>5__5 < <instrs>5__3.Count) { if (<i>5__5 > 0 && <instrs>5__3[<i>5__5].opcode == OpCodes.Ldstr && <instrs>5__3[<i>5__5].operand.Equals("Text")) { <>2__current = <th>5__2.LogMessage(new CodeInstruction(OpCodes.Ldstr, (object)"Label")); <>1__state = 1; return true; } if (<instrs>5__3[<i>5__5].opcode == OpCodes.Ldloca_S) { <skipRows>5__4 = true; } else { if (((<i>5__5 > 5) & <skipRows>5__4) && <instrs>5__3[<i>5__5].opcode == OpCodes.Ldloc_1 && <instrs>5__3[<i>5__5 - 1].opcode == OpCodes.Call) { <skipRows>5__4 = false; <>2__current = <th>5__2.LogMessage(<instrs>5__3[<i>5__5]); <>1__state = 2; return true; } if (!<skipRows>5__4) { <>2__current = <th>5__2.LogMessage(<instrs>5__3[<i>5__5]); <>1__state = 4; return true; } } goto IL_021e; } return false; IL_021e: num = <i>5__5 + 1; <i>5__5 = num; goto IL_022e; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator<CodeInstruction> IEnumerable<CodeInstruction>.GetEnumerator() { <FusionBoxSetup_AddSealButton_Postfix_Transpiler>d__15 <FusionBoxSetup_AddSealButton_Postfix_Transpiler>d__; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; <FusionBoxSetup_AddSealButton_Postfix_Transpiler>d__ = this; } else { <FusionBoxSetup_AddSealButton_Postfix_Transpiler>d__ = new <FusionBoxSetup_AddSealButton_Postfix_Transpiler>d__15(0); } <FusionBoxSetup_AddSealButton_Postfix_Transpiler>d__.instructions = <>3__instructions; return <FusionBoxSetup_AddSealButton_Postfix_Transpiler>d__; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable<CodeInstruction>)this).GetEnumerator(); } } [CompilerGenerated] private sealed class <GemCursor_CacheVanillaCursor_Postfix_Transpiler>d__19 : IEnumerable<CodeInstruction>, IEnumerable, IEnumerator<CodeInstruction>, IDisposable, IEnumerator { private int <>1__state; private CodeInstruction <>2__current; private int <>l__initialThreadId; private IEnumerable<CodeInstruction> instructions; public IEnumerable<CodeInstruction> <>3__instructions; private List<CodeInstruction> <instrs>5__2; private TranspilerHelpers <th>5__3; private bool <skipRows>5__4; private int <i>5__5; CodeInstruction IEnumerator<CodeInstruction>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <GemCursor_CacheVanillaCursor_Postfix_Transpiler>d__19(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { <instrs>5__2 = null; <th>5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Expected O, but got Unknown int num; switch (<>1__state) { default: return false; case 0: <>1__state = -1; <instrs>5__2 = instructions.ToList(); <th>5__3 = new TranspilerHelpers(); <skipRows>5__4 = false; <i>5__5 = 0; goto IL_01b8; case 1: <>1__state = -1; <skipRows>5__4 = !<skipRows>5__4; if (<skipRows>5__4) { <>2__current = <th>5__3.LogMessage(new CodeInstruction(OpCodes.Call, (object)AccessTools.DeclaredMethod(typeof(Jewelcrafting), "GetAugaCursor", (Type[])null, (Type[])null))); <>1__state = 2; return true; } goto IL_01a8; case 2: <>1__state = -1; goto IL_01a8; case 3: <>1__state = -1; goto IL_01a8; case 4: { <>1__state = -1; goto IL_01a8; } IL_01a8: num = <i>5__5 + 1; <i>5__5 = num; goto IL_01b8; IL_01b8: if (<i>5__5 < <instrs>5__2.Count) { if (<instrs>5__2[<i>5__5].opcode == OpCodes.Ldsflda) { <>2__current = <th>5__3.LogMessage(<instrs>5__2[<i>5__5]); <>1__state = 1; return true; } if ((<instrs>5__2[<i>5__5].opcode == OpCodes.Stfld) & <skipRows>5__4) { <>2__current = <th>5__3.LogMessage(<instrs>5__2[<i>5__5]); <>1__state = 3; return true; } if (!<skipRows>5__4) { <>2__current = <th>5__3.LogMessage(<instrs>5__2[<i>5__5]); <>1__state = 4; return true; } goto IL_01a8; } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator<CodeInstruction> IEnumerable<CodeInstruction>.GetEnumerator() { <GemCursor_CacheVanillaCursor_Postfix_Transpiler>d__19 <GemCursor_CacheVanillaCursor_Postfix_Transpiler>d__; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; <GemCursor_CacheVanillaCursor_Postfix_Transpiler>d__ = this; } else { <GemCursor_CacheVanillaCursor_Postfix_Transpiler>d__ = new <GemCursor_CacheVanillaCursor_Postfix_Transpiler>d__19(0); } <GemCursor_CacheVanillaCursor_Postfix_Transpiler>d__.instructions = <>3__instructions; return <GemCursor_CacheVanillaCursor_Postfix_Transpiler>d__; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable<CodeInstruction>)this).GetEnumerator(); } } [CompilerGenerated] private sealed class <GemStones_CloseFakeSocketsContainer_Prefix_Transpiler>d__16 : IEnumerable<CodeInstruction>, IEnumerable, IEnumerator<CodeInstruction>, IDisposable, IEnumerator { private int <>1__state; private CodeInstruction <>2__current; private int <>l__initialThreadId; private IEnumerable<CodeInstruction> instructions; public IEnumerable<CodeInstruction> <>3__instructions; private TranspilerHelpers <th>5__2; private List<CodeInstruction> <instrs>5__3; private bool <skipRows>5__4; private int <i>5__5; CodeInstruction IEnumerator<CodeInstruction>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <GemStones_CloseFakeSocketsContainer_Prefix_Transpiler>d__16(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { <th>5__2 = null; <instrs>5__3 = null; <>1__state = -2; } private bool MoveNext() { int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; goto IL_01a3; } <>1__state = -1; <th>5__2 = new TranspilerHelpers(); <instrs>5__3 = instructions.ToList(); <skipRows>5__4 = false; <i>5__5 = 0; goto IL_01b3; IL_01a3: int num2 = <i>5__5 + 1; <i>5__5 = num2; goto IL_01b3; IL_01b3: if (<i>5__5 < <instrs>5__3.Count) { if (<instrs>5__3[<i>5__5].opcode == OpCodes.Dup && <instrs>5__3[<i>5__5 + 1].opcode == OpCodes.Callvirt && <instrs>5__3[<i>5__5 + 2].opcode == OpCodes.Stloc_0 && <instrs>5__3[<i>5__5 + 3].opcode == OpCodes.Ldloca_S) { <skipRows>5__4 = true; } else if (((<i>5__5 > 5) & <skipRows>5__4) && <instrs>5__3[<i>5__5].opcode == OpCodes.Callvirt && <instrs>5__3[<i>5__5 - 1].opcode == OpCodes.Ldloc_0 && <instrs>5__3[<i>5__5 - 2].opcode == OpCodes.Dup) { <skipRows>5__4 = false; } else if (!<skipRows>5__4) { <>2__current = <th>5__2.LogMessage(<instrs>5__3[<i>5__5]); <>1__state = 1; return true; } goto IL_01a3; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator<CodeInstruction> IEnumerable<CodeInstruction>.GetEnumerator() { <GemStones_CloseFakeSocketsContainer_Prefix_Transpiler>d__16 <GemStones_CloseFakeSocketsContainer_Prefix_Transpiler>d__; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; <GemStones_CloseFakeSocketsContainer_Prefix_Transpiler>d__ = this; } else { <GemStones_CloseFakeSocketsContainer_Prefix_Transpiler>d__ = new <GemStones_CloseFakeSocketsContainer_Prefix_Transpiler>d__16(0); } <GemStones_CloseFakeSocketsContainer_Prefix_Transpiler>d__.instructions = <>3__instructions; return <GemStones_CloseFakeSocketsContainer_Prefix_Transpiler>d__; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable<CodeInstruction>)this).GetEnumerator(); } } [CompilerGenerated] private sealed class <GemStones_OpenFakeSocketsContainer_Open_Transpiler>d__17 : IEnumerable<CodeInstruction>, IEnumerable, IEnumerator<CodeInstruction>, IDisposable, IEnumerator { private int <>1__state; private CodeInstruction <>2__current; private int <>l__initialThreadId; private IEnumerable<CodeInstruction> instructions; public IEnumerable<CodeInstruction> <>3__instructions; private TranspilerHelpers <th>5__2; private List<CodeInstruction> <instrs>5__3; private bool <skipRows>5__4; private int <i>5__5; CodeInstruction IEnumerator<CodeInstruction>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <GemStones_OpenFakeSocketsContainer_Open_Transpiler>d__17(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { <th>5__2 = null; <instrs>5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Expected O, but got Unknown int num; switch (<>1__state) { default: return false; case 0: <>1__state = -1; <th>5__2 = new TranspilerHelpers(); <instrs>5__3 = instructions.ToList(); <skipRows>5__4 = false; <i>5__5 = 0; goto IL_034b; case 1: <>1__state = -1; <>2__current = <th>5__2.LogMessage(<instrs>5__3[<i>5__5 + 1]); <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = <th>5__2.LogMessage(<instrs>5__3[<i>5__5 + 3]); <>1__state = 3; return true; case 3: <>1__state = -1; <>2__current = <th>5__2.LogMessage(new CodeInstruction(OpCodes.Call, (object)AccessTools.DeclaredMethod(typeof(Jewelcrafting), "ChangeTakeAllPosition", (Type[])null, (Type[])null))); <>1__state = 4; return true; case 4: <>1__state = -1; <>2__current = <th>5__2.LogMessage(<instrs>5__3[<i>5__5 + 1]); <>1__state = 5; return true; case 5: <>1__state = -1; <skipRows>5__4 = true; goto IL_033b; case 6: <>1__state = -1; <>2__current = <th>5__2.LogMessage(<instrs>5__3[<i>5__5 - 1]); <>1__state = 7; return true; case 7: <>1__state = -1; <>2__current = <th>5__2.LogMessage(<instrs>5__3[<i>5__5]); <>1__state = 8; return true; case 8: <>1__state = -1; goto IL_033b; case 9: { <>1__state = -1; goto IL_033b; } IL_034b: if (<i>5__5 < <instrs>5__3.Count) { if (<instrs>5__3[<i>5__5].opcode == OpCodes.Callvirt && <instrs>5__3[<i>5__5 + 1].opcode == OpCodes.Stloc_S) { <>2__current = <th>5__2.LogMessage(<instrs>5__3[<i>5__5]); <>1__state = 1; return true; } if (((<i>5__5 > 5) & <skipRows>5__4) && <instrs>5__3[<i>5__5].opcode == OpCodes.Callvirt && <instrs>5__3[<i>5__5 - 1].opcode == OpCodes.Ldloc_S && <instrs>5__3[<i>5__5 - 2].opcode == OpCodes.Ldloc_3) { <skipRows>5__4 = false; <>2__current = <th>5__2.LogMessage(<instrs>5__3[<i>5__5 - 2]); <>1__state = 6; return true; } if (!<skipRows>5__4) { <>2__current = <th>5__2.LogMessage(<instrs>5__3[<i>5__5]); <>1__state = 9; return true; } goto IL_033b; } return false; IL_033b: num = <i>5__5 + 1; <i>5__5 = num; goto IL_034b; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator<CodeInstruction> IEnumerable<CodeInstruction>.GetEnumerator() { <GemStones_OpenFakeSocketsContainer_Open_Transpiler>d__17 <GemStones_OpenFakeSocketsContainer_Open_Transpiler>d__; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; <GemStones_OpenFakeSocketsContainer_Open_Transpiler>d__ = this; } else { <GemStones_OpenFakeSocketsContainer_Open_Transpiler>d__ = new <GemStones_OpenFakeSocketsContainer_Open_Transpiler>d__17(0); } <GemStones_OpenFakeSocketsContainer_Open_Transpiler>d__.instructions = <>3__instructions; return <GemStones_OpenFakeSocketsContainer_Open_Transpiler>d__; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable<CodeInstruction>)this).GetEnumerator(); } } public static Assembly ModAssembly; public static Type Synergy; public static Type DisplaySynergyView; public static Type AddSynergyIcon; public static Type SocketsBackground; public static Type FusionBoxSetup; public static Type AddSealButton; public static Type GemCursor; public static Type CacheVanillaCursor; public static Type GemStones; public static Type OpenFakeSocketsContainer; public static Type CloseFakeSocketsContainer; [HarmonyBefore(new string[] { "org.bepinex.plugins.jewelcrafting" })] public static void Hud_Awake_Prefix(Hud __instance) { ((Component)(object)__instance).Replace("hudroot/HotKeyBar", AugaLite.Assets.Hud, "hudroot/HotKeyBar"); } public static Vector2 ChangeSealPosition(Vector2 anchoredPosition) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) return new Vector2(41f, 340f); } public static Vector2 ChangeTakeAllPosition(Vector2 anchoredPosition) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return anchoredPosition; } [IteratorStateMachine(typeof(<FusionBoxSetup_AddSealButton_Postfix_Transpiler>d__15))] public static IEnumerable<CodeInstruction> FusionBoxSetup_AddSealButton_Postfix_Transpiler(IEnumerable<CodeInstruction> instructions) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <FusionBoxSetup_AddSealButton_Postfix_Transpiler>d__15(-2) { <>3__instructions = instructions }; } [IteratorStateMachine(typeof(<GemStones_CloseFakeSocketsContainer_Prefix_Transpiler>d__16))] public static IEnumerable<CodeInstruction> GemStones_CloseFakeSocketsContainer_Prefix_Transpiler(IEnumerable<CodeInstruction> instructions) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <GemStones_CloseFakeSocketsContainer_Prefix_Transpiler>d__16(-2) { <>3__instructions = instructions }; } [IteratorStateMachine(typeof(<GemStones_OpenFakeSocketsContainer_Open_Transpiler>d__17))] public static IEnumerable<CodeInstruction> GemStones_OpenFakeSocketsContainer_Open_Transpiler(IEnumerable<CodeInstruction> instructions) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <GemStones_OpenFakeSocketsContainer_Open_Transpiler>d__17(-2) { <>3__instructions = instructions }; } private static Texture2D GetAugaCursor() { return AugaLite.Assets.Cursor; } [IteratorStateMachine(typeof(<GemCursor_CacheVanillaCursor_Postfix_Transpiler>d__19))] public static IEnumerable<CodeInstruction> GemCursor_CacheVanillaCursor_Postfix_Transpiler(IEnumerable<CodeInstruction> instructions) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <GemCursor_CacheVanillaCursor_Postfix_Transpiler>d__19(-2) { <>3__instructions = instructions }; } [IteratorStateMachine(typeof(<AddSocketAddingTab_InventoryGui_Awake_Transpiler>d__20))] public static IEnumerable<CodeInstruction> AddSocketAddingTab_InventoryGui_Awake_Transpiler(IEnumerable<CodeInstruction> instructions) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <AddSocketAddingTab_InventoryGui_Awake_Transpiler>d__20(-2) { <>3__instructions = instructions }; } private static bool ConfigureForAuga() { return true; } [HarmonyAfter(new string[] { "org.bepinex.plugins.jewelcrafting" })] public static void IvnentoryGui_Awake_Postfix(InventoryGui __instance) { //IL_0098: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) Transform obj = ((Component)__instance.m_player).transform.Find("Jewelcrafting Synergy"); GameObject val = ((obj != null) ? ((Component)obj).gameObject : null); Transform obj2 = ((Component)__instance.m_player).transform.Find("TrashDivider/DividerLeft/Line"); GameObject val2 = ((obj2 != null) ? ((Component)obj2).gameObject : null); Transform obj3 = ((Component)__instance.m_player).transform.Find("StandardDivider/Center"); GameObject val3 = ((obj3 != null) ? ((Component)obj3).gameObject : null); Transform obj4 = ((Component)__instance.m_player).transform.Find("StandardDivider/Left"); GameObject val4 = ((obj4 != null) ? ((Component)obj4).gameObject : null); if ((Object)(object)val != (Object)null) { RectTransform obj5 = val.RectTransform(); obj5.anchoredPosition += new Vector2(80f, 78f); Image componentInChildren = val.GetComponentInChildren<Image>(); RectTransform val5 = ((Component)(object)componentInChildren).RectTransform(); ((Graphic)componentInChildren).color = Color.white; val5.sizeDelta = new Vector2(25f, 25f); } if ((Object)(object)val2 != (Object)null) { RectTransform obj6 = val2.RectTransform(); obj6.anchoredPosition = new Vector2(36f, 0f); obj6.sizeDelta = new Vector2(-80f, 2f); } if ((Object)(object)val3 != (Object)null) { RectTransform obj7 = val3.RectTransform(); obj7.anchoredPosition = new Vector2(75f, 0f); obj7.sizeDelta = new Vector2(-80f, 2f); } if ((Object)(object)val4 != (Object)null) { val4.RectTransform().anchoredPosition = new Vector2(72f, 0f); } } [IteratorStateMachine(typeof(<DisplaySynergyView_Awake_Transpiler>d__23))] public static IEnumerable<CodeInstruction> DisplaySynergyView_Awake_Transpiler(IEnumerable<CodeInstruction> instructions) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <DisplaySynergyView_Awake_Transpiler>d__23(-2) { <>3__instructions = instructions }; } } public static class SearsCatalog { public static Assembly SearsCatalogType; public static Type HudPatch; [HarmonyPriority(0)] public static void AwakePostfix_Patch(ref Hud __instance) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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) ((Transform)((Component)(object)__instance.m_pieceListRoot).RectTransform()).localPosition = new Vector3(((Transform)((Component)(object)__instance.m_pieceListRoot).RectTransform()).localPosition.x + 3f, ((Transform)((Component)(object)__instance.m_pieceListRoot).RectTransform()).localPosition.y - 3f, ((Transform)((Component)(object)__instance.m_pieceListRoot).RectTransform()).localPosition.z); } } }