using 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.Versioning; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.SceneManagement; using UnityEngine.UI; using WhiteKnuckleItemTooltips.Compatibility; using WhiteKnuckleItemTooltips.Core; using WhiteKnuckleItemTooltips.Detection; using WhiteKnuckleItemTooltips.Localization; using WhiteKnuckleItemTooltips.Runtime; using WhiteKnuckleItemTooltips.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("WhiteKnuckleItemTooltips")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.3.0.0")] [assembly: AssemblyInformationalVersion("0.3.0")] [assembly: AssemblyProduct("WhiteKnuckleItemTooltips")] [assembly: AssemblyTitle("WhiteKnuckleItemTooltips")] [assembly: AssemblyVersion("0.3.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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] [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] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace WhiteKnuckleItemTooltips { [BepInPlugin("kos.whiteknuckle.itemtooltipsru", "White Knuckle Item Tooltips", "0.3.0")] public sealed class Plugin : BaseUnityPlugin { public const string PluginGuid = "kos.whiteknuckle.itemtooltipsru"; public const string PluginName = "White Knuckle Item Tooltips"; public const string PluginVersion = "0.3.0"; private static MethodInfo? _itemObjectOnHoverTarget; private static int _instrumentedHoverCallSites; private void Awake() { RuntimeSettings settings = BindConfig(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"White Knuckle Item Tooltips 0.3.0 loading..."); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Reference mode: exact assemblies from this White Knuckle installation."); try { RuntimeService.Install(new RuntimeService(((BaseUnityPlugin)this).Config, ((BaseUnityPlugin)this).Logger, ((BaseUnityPlugin)this).Info.Location, settings)); } catch (Exception arg) { ((BaseUnityPlugin)this).Logger.LogError((object)$"Could not initialize Item Tooltips runtime service: {arg}"); return; } InstallNativeHoverBridge(); RuntimeHost.RegisterSceneCallback(); RuntimeHost.EnsureAlive(); } private void InstallNativeHoverBridge() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Expected O, but got Unknown //IL_011f: Expected O, but got Unknown try { Harmony val = new Harmony("kos.whiteknuckle.itemtooltipsru.interactionbridge"); Type type = AccessTools.TypeByName("Item_Object"); _itemObjectOnHoverTarget = ((type == null) ? null : AccessTools.Method(type, "OnHover", (Type[])null, (Type[])null)); if (_itemObjectOnHoverTarget == null) { ((BaseUnityPlugin)this).Logger.LogError((object)"Interaction bridge failed: Item_Object.OnHover was not found."); return; } Type type2 = AccessTools.TypeByName("ENT_Player"); MethodInfo methodInfo = ((type2 == null) ? null : AccessTools.Method(type2, "InteractCheck", new Type[1] { typeof(int) }, (Type[])null)); if (methodInfo == null) { ((BaseUnityPlugin)this).Logger.LogError((object)"Interaction bridge failed: ENT_Player.InteractCheck(int) was not found."); return; } MethodInfo methodInfo2 = AccessTools.Method(typeof(Plugin), "InteractCheckPrefix", (Type[])null, (Type[])null); MethodInfo methodInfo3 = AccessTools.Method(typeof(Plugin), "InteractCheckTranspiler", (Type[])null, (Type[])null); if (methodInfo2 == null || methodInfo3 == null) { ((BaseUnityPlugin)this).Logger.LogError((object)"Interaction bridge failed: patch methods were not found."); return; } _instrumentedHoverCallSites = 0; val.Patch((MethodBase)methodInfo, new HarmonyMethod(methodInfo2), (HarmonyMethod)null, new HarmonyMethod(methodInfo3), (HarmonyMethod)null, (HarmonyMethod)null); ((BaseUnityPlugin)this).Logger.LogInfo((object)("Interaction bridge installed on ENT_Player.InteractCheck(int). " + $"Instrumented Item_Object.OnHover call sites: {_instrumentedHoverCallSites}.")); if (_instrumentedHoverCallSites == 0) { ((BaseUnityPlugin)this).Logger.LogWarning((object)"No Item_Object.OnHover call sites were instrumented; runtime hover callbacks are unlikely to fire."); } } catch (Exception arg) { ((BaseUnityPlugin)this).Logger.LogError((object)$"Could not install interaction bridge: {arg}"); } } public static void InteractCheckPrefix() { RuntimeService.Current?.InteractionTick(); } public static IEnumerable InteractCheckTranspiler(IEnumerable instructions) { MethodInfo bridge = AccessTools.Method(typeof(Plugin), "ItemObjectHoverFromCallSite", (Type[])null, (Type[])null); MethodInfo target = _itemObjectOnHoverTarget; foreach (CodeInstruction instruction in instructions) { if (!(target != null) || !(bridge != null) || (!(instruction.opcode == OpCodes.Call) && !(instruction.opcode == OpCodes.Callvirt)) || !object.Equals(instruction.operand, target)) { yield return instruction; continue; } CodeInstruction val = new CodeInstruction(OpCodes.Dup, (object)null); MoveInstructionMetadata(instruction, val, "labels"); MoveInstructionMetadata(instruction, val, "blocks"); yield return val; yield return instruction; yield return new CodeInstruction(OpCodes.Call, (object)bridge); _instrumentedHoverCallSites++; } } private static void MoveInstructionMetadata(CodeInstruction source, CodeInstruction destination, string fieldName) { FieldInfo fieldInfo = AccessTools.Field(typeof(CodeInstruction), fieldName); if (fieldInfo == null) { return; } IList list = fieldInfo.GetValue(source) as IList; IList list2 = fieldInfo.GetValue(destination) as IList; if (list != null && list2 != null && list.Count != 0) { object[] array = new object[list.Count]; list.CopyTo(array, 0); object[] array2 = array; foreach (object value in array2) { list2.Add(value); } list.Clear(); } } public static void ItemObjectHoverFromCallSite(object itemObject) { RuntimeService.Current?.ItemHover(itemObject); } private RuntimeSettings BindConfig() { //IL_006e: Unknown result type (might be due to invalid IL or missing references) ConfigEntry enabled = ((BaseUnityPlugin)this).Config.Bind("General", "Enabled", true, "Enable item tooltips."); ConfigEntry language = ((BaseUnityPlugin)this).Config.Bind("Language", "Language", string.Empty, "Item Tooltips language. Valid persisted values: English or Russian. Use the main-menu LANGUAGE button to change it."); ConfigEntry fullInformation = ((BaseUnityPlugin)this).Config.Bind("Information", "FullInformation", false, "Show spoiler-bearing detailed descriptions. Toggled in game with ToggleFullInformationKey."); ConfigEntry toggleFullInformationKey = ((BaseUnityPlugin)this).Config.Bind("Information", "ToggleFullInformationKey", new KeyboardShortcut((KeyCode)120, Array.Empty()), "Hotkey that toggles spoiler-safe/full item descriptions."); ConfigEntry inventoryTooltipEnabled = ((BaseUnityPlugin)this).Config.Bind("UI", "InventoryTooltipEnabled", true, "Show tooltips when hovering items in the inventory."); ConfigEntry worldTooltipEnabled = ((BaseUnityPlugin)this).Config.Bind("UI", "WorldTooltipEnabled", true, "Show tooltips when aiming at pickup items in the world."); ConfigEntry useCustomTooltipCard = ((BaseUnityPlugin)this).Config.Bind("UI", "UseCustomTooltipCard", true, "Use the dedicated item tooltip card instead of White Knuckle's native description field."); ConfigEntry tooltipMaxWidth = ((BaseUnityPlugin)this).Config.Bind("UI", "TooltipMaxWidth", 620, "Maximum tooltip card width in screen pixels."); return new RuntimeSettings(enabled, language, fullInformation, toggleFullInformationKey, inventoryTooltipEnabled, worldTooltipEnabled, useCustomTooltipCard, tooltipMaxWidth); } } } namespace WhiteKnuckleItemTooltips.UI { public sealed class ResolvedTooltipFont { public Font Font { get; } public string Source { get; } public ResolvedTooltipFont(Font font, string source) { Font = font ?? throw new ArgumentNullException("font"); Source = source ?? string.Empty; } } public sealed class FontResolver { private ResolvedTooltipFont? _cached; private const string CyrillicProbe = "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя"; public ResolvedTooltipFont Resolve() { if (_cached != null) { return _cached; } if (IsWkLocLoaded()) { Font val = Resources.FindObjectsOfTypeAll().Where(IsCyrillicCapable).OrderBy(FontPriority) .FirstOrDefault(); if ((Object)(object)val != (Object)null && FontPriority(val) < 100) { return _cached = new ResolvedTooltipFont(val, "WKLoc loaded font: " + ((Object)val).name); } } try { Font val2 = Font.CreateDynamicFontFromOSFont(new string[2] { "Segoe UI", "Arial" }, 18); if ((Object)(object)val2 != (Object)null && IsCyrillicCapable(val2)) { return _cached = new ResolvedTooltipFont(val2, "Windows dynamic font: " + ((Object)val2).name); } } catch { } string[] array = new string[2] { "Arial.ttf", "LegacyRuntime.ttf" }; foreach (string text in array) { try { Font builtinResource = Resources.GetBuiltinResource(text); if ((Object)(object)builtinResource != (Object)null && IsCyrillicCapable(builtinResource)) { return _cached = new ResolvedTooltipFont(builtinResource, "Unity builtin font: " + text); } } catch { } } Font val3 = ((IEnumerable)Resources.FindObjectsOfTypeAll()).FirstOrDefault((Func)IsCyrillicCapable); if ((Object)(object)val3 != (Object)null) { return _cached = new ResolvedTooltipFont(val3, "Loaded Cyrillic font: " + ((Object)val3).name); } Font val4 = Resources.FindObjectsOfTypeAll().FirstOrDefault(); if ((Object)(object)val4 != (Object)null) { return _cached = new ResolvedTooltipFont(val4, "Last-resort loaded font: " + ((Object)val4).name); } throw new InvalidOperationException("No usable Unity font was found for the tooltip card."); } private static bool IsWkLocLoaded() { return Chainloader.PluginInfos.Values.Any((PluginInfo info) => string.Equals(info.Metadata.Name, "WKLoc", StringComparison.OrdinalIgnoreCase)); } private static bool IsCyrillicCapable(Font font) { try { font.RequestCharactersInTexture("АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя", 18, (FontStyle)0); return ((IEnumerable)"АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя").All((Func)font.HasCharacter); } catch { return false; } } private static int FontPriority(Font font) { string text = ((Object)font).name ?? string.Empty; if (text.Equals("main-legacy", StringComparison.OrdinalIgnoreCase)) { return 0; } if (text.Equals("main-legacy-os", StringComparison.OrdinalIgnoreCase)) { return 1; } if (text.IndexOf("main", StringComparison.OrdinalIgnoreCase) >= 0) { return 10; } return 100; } } public static class MenuCreditsContent { public const string TwitchPurpleHex = "#9146FF"; public const string AuthorMarkup = "Item Tooltips Mod by KoshGamer"; public const string TwitchUrl = "twitch.tv/koshgamer"; public const float TopOffsetPixels = 132f; public const float OverallOpacity = 0.9f; public static bool IsMainMenuScene(string? sceneName) { return string.Equals(sceneName, "Main-Menu", StringComparison.OrdinalIgnoreCase); } } public sealed class MenuCreditsView { private const float Width = 430f; private const float Height = 54f; private const float RightMargin = 18f; private static readonly Color TwitchPurple = new Color(29f / 51f, 14f / 51f, 1f, 1f); private static readonly Color UrlPurple = new Color(0.82f, 0.74f, 1f, 0.96f); private readonly GameObject _canvasObject; private readonly GameObject _creditsObject; private readonly Texture2D _twitchIconTexture; public bool IsVisible { get { if ((Object)(object)_creditsObject != (Object)null) { return _creditsObject.activeSelf; } return false; } } public MenuCreditsView(Font font) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00d5: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: 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) if ((Object)(object)font == (Object)null) { throw new ArgumentNullException("font"); } _canvasObject = new GameObject("WK Item Tooltips Menu Credits Canvas", new Type[1] { typeof(RectTransform) }); Object.DontDestroyOnLoad((Object)(object)_canvasObject); Canvas obj = _canvasObject.AddComponent(); obj.renderMode = (RenderMode)0; obj.sortingOrder = 31990; CanvasScaler obj2 = _canvasObject.AddComponent(); obj2.uiScaleMode = (ScaleMode)0; obj2.scaleFactor = 1f; _creditsObject = new GameObject("KoshGamer Menu Credit", new Type[1] { typeof(RectTransform) }); _creditsObject.transform.SetParent(_canvasObject.transform, false); RectTransform component = _creditsObject.GetComponent(); component.anchorMin = new Vector2(1f, 1f); component.anchorMax = new Vector2(1f, 1f); component.pivot = new Vector2(1f, 1f); component.anchoredPosition = new Vector2(-18f, -132f); component.sizeDelta = new Vector2(430f, 54f); CanvasGroup obj3 = _creditsObject.AddComponent(); obj3.alpha = 0.9f; obj3.interactable = false; obj3.blocksRaycasts = false; Text obj4 = CreateText("Author", font, 16, (TextAnchor)2, new Color(0.96f, 0.96f, 0.94f, 0.96f)); obj4.text = "Item Tooltips Mod by KoshGamer"; obj4.supportRichText = true; SetTopRightRect(((Graphic)obj4).rectTransform, 0f, 0f, 430f, 23f); _twitchIconTexture = CreateTwitchIconTexture(); GameObject val = new GameObject("Twitch Icon", new Type[1] { typeof(RectTransform) }); val.transform.SetParent(_creditsObject.transform, false); RawImage obj5 = val.AddComponent(); obj5.texture = (Texture)(object)_twitchIconTexture; ((Graphic)obj5).color = Color.white; ((Graphic)obj5).raycastTarget = false; SetTopRightRect(((Graphic)obj5).rectTransform, -194f, -28f, 18f, 18f); Text obj6 = CreateText("Twitch URL", font, 15, (TextAnchor)2, UrlPurple); obj6.text = "twitch.tv/koshgamer"; SetTopRightRect(((Graphic)obj6).rectTransform, 0f, -26f, 188f, 22f); _creditsObject.SetActive(false); } public void SetVisible(bool visible) { if ((Object)(object)_creditsObject != (Object)null && _creditsObject.activeSelf != visible) { _creditsObject.SetActive(visible); } } public void Destroy() { if ((Object)(object)_twitchIconTexture != (Object)null) { Object.Destroy((Object)(object)_twitchIconTexture); } if ((Object)(object)_canvasObject != (Object)null) { Object.Destroy((Object)(object)_canvasObject); } } private Text CreateText(string name, Font font, int size, TextAnchor alignment, Color color) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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) GameObject val = new GameObject(name, new Type[1] { typeof(RectTransform) }); val.transform.SetParent(_creditsObject.transform, false); Text obj = val.AddComponent(); obj.font = font; obj.fontSize = size; obj.alignment = alignment; ((Graphic)obj).color = color; obj.horizontalOverflow = (HorizontalWrapMode)1; obj.verticalOverflow = (VerticalWrapMode)1; ((Graphic)obj).raycastTarget = false; obj.supportRichText = true; Shadow obj2 = val.AddComponent(); obj2.effectColor = new Color(0f, 0f, 0f, 0.72f); obj2.effectDistance = new Vector2(1f, -1f); obj2.useGraphicAlpha = true; return obj; } private static void SetTopRightRect(RectTransform rect, float x, float y, float width, float height) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) rect.anchorMin = new Vector2(1f, 1f); rect.anchorMax = new Vector2(1f, 1f); rect.pivot = new Vector2(1f, 1f); rect.anchoredPosition = new Vector2(x, y); rect.sizeDelta = new Vector2(width, height); } private static Texture2D CreateTwitchIconTexture() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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) Texture2D val = new Texture2D(32, 32, (TextureFormat)4, false) { name = "KoshGamer Twitch Icon", filterMode = (FilterMode)0, wrapMode = (TextureWrapMode)1 }; Color32 val2 = default(Color32); ((Color32)(ref val2))..ctor((byte)0, (byte)0, (byte)0, (byte)0); Color32 color = default(Color32); ((Color32)(ref color))..ctor((byte)145, (byte)70, byte.MaxValue, byte.MaxValue); Color32 color2 = default(Color32); ((Color32)(ref color2))..ctor(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue); Color32[] array = (Color32[])(object)new Color32[1024]; for (int i = 0; i < array.Length; i++) { array[i] = val2; } FillRect(array, 32, 4, 5, 27, 26, color); FillRect(array, 32, 7, 2, 12, 7, color); FillRect(array, 32, 10, 0, 12, 4, color); FillRect(array, 32, 8, 9, 23, 22, color2); FillRect(array, 32, 12, 13, 14, 19, color); FillRect(array, 32, 18, 13, 20, 19, color); val.SetPixels32(array); val.Apply(false, false); return val; } private static void FillRect(Color32[] pixels, int stride, int minX, int minY, int maxX, int maxY, Color32 color) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) for (int i = minY; i <= maxY; i++) { for (int j = minX; j <= maxX; j++) { pixels[i * stride + j] = color; } } } } public static class MenuLanguageButtonContent { public const float Width = 230f; public const float Height = 54f; public const float RightMargin = 18f; public const float TopOffsetPixels = 198f; public const int FontSize = 20; public const int HoverHintFontSize = 13; public static string Label(TooltipLanguage language) { if (language != TooltipLanguage.Russian) { return "LANGUAGE: EN"; } return "LANGUAGE: RU"; } public static string HoverHint(TooltipLanguage language) { if (language != TooltipLanguage.Russian) { return "Click to switch language"; } return "Нажми, чтобы сменить язык"; } } public sealed class MenuLanguageButtonView { private readonly GameObject _canvasObject; private readonly GameObject _rootObject; private readonly Text _label; private readonly Text _hoverHint; private readonly Action _onClick; private TooltipLanguage _language; public bool IsVisible { get { if ((Object)(object)_rootObject != (Object)null) { return _rootObject.activeSelf; } return false; } } public MenuLanguageButtonView(Font font, Action onClick) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Expected O, but got Unknown //IL_00fd: 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_0127: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Expected O, but got Unknown //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Expected O, but got Unknown //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Expected O, but got Unknown //IL_0475: Unknown result type (might be due to invalid IL or missing references) //IL_04b9: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_04e3: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_050c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)font == (Object)null) { throw new ArgumentNullException("font"); } _onClick = onClick ?? throw new ArgumentNullException("onClick"); _canvasObject = new GameObject("WK Item Tooltips Language Canvas", new Type[1] { typeof(RectTransform) }); Object.DontDestroyOnLoad((Object)(object)_canvasObject); Canvas obj = _canvasObject.AddComponent(); obj.renderMode = (RenderMode)0; obj.sortingOrder = 31995; CanvasScaler obj2 = _canvasObject.AddComponent(); obj2.uiScaleMode = (ScaleMode)0; obj2.scaleFactor = 1f; _canvasObject.AddComponent(); _rootObject = new GameObject("LanguageButton", new Type[1] { typeof(RectTransform) }); _rootObject.transform.SetParent(_canvasObject.transform, false); RectTransform component = _rootObject.GetComponent(); component.anchorMin = new Vector2(1f, 1f); component.anchorMax = new Vector2(1f, 1f); component.pivot = new Vector2(1f, 1f); component.anchoredPosition = new Vector2(-18f, -198f); component.sizeDelta = new Vector2(230f, 54f); Image val = _rootObject.AddComponent(); ((Graphic)val).color = new Color(0.045f, 0.035f, 0.065f, 0.88f); ((Graphic)val).raycastTarget = true; Outline outline = _rootObject.AddComponent(); ((Shadow)outline).effectColor = new Color(29f / 51f, 14f / 51f, 1f, 0.95f); ((Shadow)outline).effectDistance = new Vector2(2f, -2f); ((Shadow)outline).useGraphicAlpha = true; Button obj3 = _rootObject.AddComponent