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 RunicSigns v1.2.9
RunicSigns.dll
Decompiled 3 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Serialization.Json; using System.Runtime.Versioning; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Runic.Localization; using Runic.Shared; using RunicSigns.Core; using RunicSigns.Input; using RunicSigns.Runtime; using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("RunicSigns")] [assembly: AssemblyDescription("Simple synchronized labels and sizing for Valheim signs")] [assembly: AssemblyCompany("Chazman")] [assembly: AssemblyFileVersion("1.2.9.0")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyVersion("1.2.9.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Runic.Localization { internal sealed class LanguageCatalog { private readonly Dictionary<string, string> _english; private Dictionary<string, string> _selected = new Dictionary<string, string>(); private readonly Func<string, string> _read; private string _language; internal LanguageCatalog(string english, Func<string, string> read) { _english = Parse(english); _read = read; } internal static Dictionary<string, string> Parse(string json) { if (string.IsNullOrWhiteSpace(json)) { return new Dictionary<string, string>(); } if (json.Length > 2097152) { throw new InvalidDataException("Language file exceeds 2 MiB."); } DataContractJsonSerializer dataContractJsonSerializer = new DataContractJsonSerializer(typeof(Dictionary<string, string>), new DataContractJsonSerializerSettings { UseSimpleDictionaryFormat = true }); using MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(json.TrimStart('\ufeff'))); return ((Dictionary<string, string>)dataContractJsonSerializer.ReadObject(stream)) ?? new Dictionary<string, string>(); } internal void Select(string language) { language = (string.IsNullOrWhiteSpace(language) ? "English" : language); if (string.Equals(language, _language, StringComparison.Ordinal)) { return; } _language = language; _selected = new Dictionary<string, string>(); if (language.IndexOfAny(new char[4] { '/', '\\', ':', '\0' }) >= 0 || language == "." || language == "..") { return; } try { _selected = Parse(_read(language)); } catch (Exception) { } } internal string Get(string key) { _english.TryGetValue(key, out var value); if (_selected.TryGetValue(key, out var value2) && !string.IsNullOrWhiteSpace(value2) && (value == null || SameFields(value, value2))) { return value2; } return value ?? key; } internal string English(string key) { if (!_english.TryGetValue(key, out var value)) { return key; } return value; } internal string TranslateEnglish(string text) { foreach (KeyValuePair<string, string> item in _english) { if (item.Value == text) { return Get(item.Key); } } return text; } internal string Format(string key, params object[] args) { _english.TryGetValue(key, out var value); string text = Get(key); if (value != null && !SameFields(value, text)) { text = value; } try { return string.Format(CultureInfo.CurrentCulture, text, args); } catch (FormatException) { try { return string.Format(CultureInfo.CurrentCulture, value ?? key, args); } catch (FormatException) { return value ?? key; } } } private static bool SameFields(string a, string b) { try { return Fields(a).SetEquals(Fields(b)); } catch (FormatException) { return false; } } private static HashSet<int> Fields(string text) { HashSet<int> hashSet = new HashSet<int>(); for (int i = 0; i < text.Length; i++) { if (text[i] == '}') { if (i + 1 >= text.Length || text[i + 1] != '}') { throw new FormatException(); } i++; } else { if (text[i] != '{') { continue; } if (i + 1 < text.Length && text[i + 1] == '{') { i++; continue; } int num = ++i; for (; i < text.Length && char.IsDigit(text[i]); i++) { } if (num == i || !int.TryParse(text.Substring(num, i - num), out var result)) { throw new FormatException(); } hashSet.Add(result); for (; i < text.Length && text[i] != '}'; i++) { if (text[i] == '{') { throw new FormatException(); } } if (i == text.Length) { throw new FormatException(); } } } return hashSet; } } internal static class RunicText { private static readonly Assembly Owner = typeof(RunicText).Assembly; private static readonly string Module = Owner.GetName().Name; private static readonly LanguageCatalog Catalog = Create(); private static LanguageCatalog Create() { using Stream stream = Owner.GetManifestResourceStream("Runic.Localization.English.json"); using StreamReader streamReader = ((stream == null) ? null : new StreamReader(stream)); return new LanguageCatalog(streamReader?.ReadToEnd() ?? "{}", ReadLanguage); } private static string ReadLanguage(string language) { string path = Path.Combine(Path.Combine(Path.GetDirectoryName(Owner.Location), "Translations", Module), language + ".json"); if (!File.Exists(path)) { return null; } return File.ReadAllText(path); } private static void SelectLanguage() { string language = "English"; try { Localization instance = Localization.instance; language = ((instance != null) ? instance.GetSelectedLanguage() : null) ?? "English"; } catch { } Catalog.Select(language); } internal static string Get(string key) { SelectLanguage(); return Catalog.Get(key); } internal static string English(string key) { return Catalog.English(key); } internal static string TranslateEnglish(string text) { SelectLanguage(); return Catalog.TranslateEnglish(text); } internal static string Format(string key, params object[] args) { SelectLanguage(); return Catalog.Format(key, args); } } } namespace Runic.Shared { internal static class CaptionCurve { internal const float DisplayLimit = 100f; internal static float ToDisplay(float coefficient) { return coefficient * 100f; } internal static float FromDisplay(float value) { return value / 100f; } internal static float Step(float coefficient, int direction) { return FromDisplay((float)Math.Round(Math.Max(-100f, Math.Min(100f, ToDisplay(coefficient) + (float)direction)), 4)); } internal static bool Valid(float coefficient) { if (!float.IsNaN(coefficient) && !float.IsInfinity(coefficient)) { return Math.Abs(coefficient) <= 1f; } return false; } internal static float Arc(float x, float left, float right) { float num = (right - left) * 0.5f; if (!(num > 0.0001f)) { return 0f; } float num2 = (x - (left + num)) / num; return Math.Max(0f, 1f - num2 * num2) * num; } } internal static class CaptionMeshCurve { internal static bool Apply(TMP_TextInfo info, float vertical, float depth, out Vector3 min, out Vector3 max, float wrapRadius = 0f, float wrapDepthRadius = 0f) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) min = new Vector3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity); max = new Vector3(float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity); float num = float.PositiveInfinity; float num2 = float.NegativeInfinity; for (int i = 0; i < info.characterCount; i++) { TMP_CharacterInfo val = info.characterInfo[i]; if (val.isVisible) { Vector3[] vertices = info.meshInfo[val.materialReferenceIndex].vertices; for (int j = 0; j < 4; j++) { float x = vertices[val.vertexIndex + j].x; num = Math.Min(num, x); num2 = Math.Max(num2, x); } } } if (!(num2 > num)) { return false; } float num3 = (num + num2) * 0.5f; bool flag = wrapRadius > 0.0001f && wrapDepthRadius > 0.0001f; float num4 = Math.Max(0f, 1f + depth); if (flag && num4 > 0f) { float num5 = (num2 - num) * 0.5f * num4 / 1.45f; if (wrapRadius < num5) { wrapDepthRadius *= num5 / wrapRadius; wrapRadius = num5; } } for (int k = 0; k < info.characterCount; k++) { TMP_CharacterInfo val2 = info.characterInfo[k]; if (!val2.isVisible) { continue; } Vector3[] vertices2 = info.meshInfo[val2.materialReferenceIndex].vertices; for (int l = 0; l < 4; l++) { int num6 = val2.vertexIndex + l; Vector3 val3 = vertices2[num6]; float num7 = CaptionCurve.Arc(val3.x, num, num2); val3.y += num7 * vertical; if (flag) { if (num4 > 0.0001f) { double num8 = (val3.x - num3) * num4 / wrapRadius; val3.x = num3 + (float)((double)(wrapRadius / num4) * Math.Sin(num8)); val3.z += (float)((double)(wrapDepthRadius / num4) * (1.0 - Math.Cos(num8))); } } else { val3.z -= num7 * depth; } vertices2[num6] = val3; min.x = Math.Min(min.x, val3.x); max.x = Math.Max(max.x, val3.x); min.y = Math.Min(min.y, val3.y); max.y = Math.Max(max.y, val3.y); min.z = Math.Min(min.z, val3.z); max.z = Math.Max(max.z, val3.z); } } return true; } } internal static class EmojiCatalog { internal static readonly EmojiEntry[] Entries = new EmojiEntry[64] { new EmojiEntry(127830u, "Meat", "Food"), new EmojiEntry(127831u, "Poultry", "Food"), new EmojiEntry(128031u, "Fish", "Food"), new EmojiEntry(127838u, "Bread", "Food"), new EmojiEntry(129472u, "Cheese", "Food"), new EmojiEntry(129370u, "Egg", "Food"), new EmojiEntry(127812u, "Mushroom", "Food"), new EmojiEntry(127822u, "Apple", "Food"), new EmojiEntry(127827u, "Berry", "Food"), new EmojiEntry(129362u, "Cucumber", "Food"), new EmojiEntry(129365u, "Carrot", "Food"), new EmojiEntry(127805u, "Corn", "Food"), new EmojiEntry(127855u, "Honey", "Food"), new EmojiEntry(127866u, "Ale", "Food"), new EmojiEntry(127858u, "Soup", "Food"), new EmojiEntry(127815u, "Grapes", "Food"), new EmojiEntry(129717u, "Wood", "Materials"), new EmojiEntry(129704u, "Stone", "Materials"), new EmojiEntry(128293u, "Fire", "Materials"), new EmojiEntry(128167u, "Water", "Materials"), new EmojiEntry(127806u, "Grain", "Materials"), new EmojiEntry(127793u, "Seedling", "Materials"), new EmojiEntry(127803u, "Flower", "Materials"), new EmojiEntry(127794u, "Fir", "Materials"), new EmojiEntry(127795u, "Tree", "Materials"), new EmojiEntry(127811u, "Leaves", "Materials"), new EmojiEntry(128142u, "Gem", "Materials"), new EmojiEntry(129521u, "Brick", "Materials"), new EmojiEntry(129525u, "Thread", "Materials"), new EmojiEntry(129526u, "Yarn", "Materials"), new EmojiEntry(129718u, "Feather", "Materials"), new EmojiEntry(129460u, "Bone", "Materials"), new EmojiEntry(129683u, "Axe", "Equipment"), new EmojiEntry(128296u, "Hammer", "Equipment"), new EmojiEntry(128295u, "Wrench", "Equipment"), new EmojiEntry(128297u, "Parts", "Equipment"), new EmojiEntry(129522u, "Magnet", "Equipment"), new EmojiEntry(127993u, "Bow", "Equipment"), new EmojiEntry(128737u, "Shield", "Equipment"), new EmojiEntry(128481u, "Sword", "Equipment"), new EmojiEntry(129514u, "Potion", "Equipment"), new EmojiEntry(129520u, "Tools", "Equipment"), new EmojiEntry(127890u, "Backpack", "Equipment"), new EmojiEntry(128094u, "Shoes", "Equipment"), new EmojiEntry(128081u, "Crown", "Equipment"), new EmojiEntry(128141u, "Ring", "Equipment"), new EmojiEntry(128273u, "Key", "Equipment"), new EmojiEntry(128274u, "Lock", "Equipment"), new EmojiEntry(127968u, "Home", "Places"), new EmojiEntry(127984u, "Castle", "Places"), new EmojiEntry(128682u, "Door", "Places"), new EmojiEntry(128719u, "Bed", "Places"), new EmojiEntry(128230u, "Storage", "Places"), new EmojiEntry(128674u, "Ship", "Places"), new EmojiEntry(128758u, "Canoe", "Places"), new EmojiEntry(129517u, "Compass", "Places"), new EmojiEntry(128506u, "Map", "Places"), new EmojiEntry(127956u, "Mountain", "Places"), new EmojiEntry(127754u, "Ocean", "Places"), new EmojiEntry(128128u, "Danger", "Places"), new EmojiEntry(128683u, "Forbidden", "Places"), new EmojiEntry(128681u, "Flag", "Places"), new EmojiEntry(128161u, "Idea", "Places"), new EmojiEntry(127775u, "Star", "Places") }; } internal sealed class EmojiInput : MonoBehaviour { private TMP_InputField _input; internal static void Attach(TMP_InputField input) { EmojiRenderer.Attach(input.textComponent); input.richText = false; input.resetOnDeActivation = false; input.onFocusSelectAll = false; ((Component)input).gameObject.AddComponent<EmojiInput>()._input = input; } private void LateUpdate() { if (Object.op_Implicit((Object)(object)_input) && string.IsNullOrEmpty(Input.compositionString)) { string text = EmojiText.Clean(_input.text, (_input.characterLimit > 0) ? _input.characterLimit : int.MaxValue); if (!(text == _input.text)) { int length = EmojiText.Clean(_input.text.Substring(0, Mathf.Min(_input.stringPosition, _input.text.Length)), text.Length).Length; _input.text = text; _input.stringPosition = length; } } } } internal static class EmojiPicker { internal static GameObject Open(Transform parent, TMP_InputField input, TMP_FontAsset font) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) int anchor = input.selectionStringAnchorPosition; int focus = input.selectionStringFocusPosition; RectTransform root = Rect(parent, "EmojiPicker", 0f, 0f, 0f, 0f); root.anchorMin = Vector2.zero; root.anchorMax = Vector2.one; RectTransform obj = root; Vector2 offsetMin = (root.offsetMax = Vector2.zero); obj.offsetMin = offsetMin; ((Graphic)((Component)root).gameObject.AddComponent<Image>()).color = new Color(0f, 0f, 0f, 0.75f); RectTransform val = Rect((Transform)(object)root, "EmojiPanel", 0f, 0f, 640f, 410f); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(0.5f, 0.5f); val.pivot = val2; offsetMin = (val.anchorMax = val2); val.anchorMin = offsetMin; ((Graphic)((Component)val).gameObject.AddComponent<Image>()).color = new Color(0.1f, 0.12f, 0.13f); Text((Transform)(object)val, "Choose an emoji", 18f, 10f, 490f, 32f, font, 24); Action close = delegate { ((Component)root).gameObject.SetActive(false); Object.Destroy((Object)(object)((Component)root).gameObject); }; Button((Transform)(object)val, "Close", 530f, 12f, 92f, 30f, font, close); TMP_Text status = Text((Transform)(object)val, "Select an icon to insert at the cursor. Each icon uses 2 character units.", 18f, 336f, 604f, 32f, font, 15); Text((Transform)(object)val, "Twemoji · Twitter and contributors · CC BY 4.0", 18f, 377f, 604f, 20f, font, 13); RectTransform grid = Rect((Transform)(object)val, "Icons", 18f, 98f, 604f, 230f); string[] array = new string[4] { "Food", "Materials", "Equipment", "Places" }; for (int num = 0; num < array.Length; num++) { string group = array[num]; Button((Transform)(object)val, group, 18 + num * 152, 55f, 146f, 32f, font, delegate { Show(group); }); } Show(array[0]); return ((Component)root).gameObject; void Show(string text) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) foreach (Transform item in (Transform)grid) { ((Component)item).gameObject.SetActive(false); Object.Destroy((Object)(object)((Component)item).gameObject); } int num2 = 0; foreach (EmojiEntry item2 in EmojiCatalog.Entries.Where((EmojiEntry e) => e.Group == text)) { EmojiEntry selected = item2; Button((Transform)(object)grid, item2.Text + " " + item2.Name, num2 % 4 * 152, num2 / 4 * 57, 146f, 49f, font, delegate { string result; int caret; if (!Object.op_Implicit((Object)(object)input) || !((Selectable)input).interactable) { close(); } else if (!EmojiText.Insert(input.text, anchor, focus, selected.Text, input.characterLimit, out result, out caret)) { status.text = "Label is full. Close this picker and shorten the text first."; } else { input.text = result; input.ActivateInputField(); input.stringPosition = caret; close(); } }); num2++; } } } private static RectTransform Rect(Transform parent, string name, float x, float y, float w, float h) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown GameObject val = new GameObject(name, new Type[1] { typeof(RectTransform) }); val.transform.SetParent(parent, false); RectTransform val2 = (RectTransform)val.transform; Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(0f, 1f); val2.pivot = val3; Vector2 anchorMin = (val2.anchorMax = val3); val2.anchorMin = anchorMin; val2.anchoredPosition = new Vector2(x, 0f - y); val2.sizeDelta = new Vector2(w, h); return val2; } private static TMP_Text Text(Transform parent, string value, float x, float y, float w, float h, TMP_FontAsset font, int size) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) TextMeshProUGUI obj = ((Component)Rect(parent, "Text", x, y, w, h)).gameObject.AddComponent<TextMeshProUGUI>(); ((TMP_Text)obj).font = font; ((TMP_Text)obj).fontSize = size; ((TMP_Text)obj).text = value; ((Graphic)obj).color = Color.white; ((TMP_Text)obj).richText = false; ((Graphic)obj).raycastTarget = false; ((TMP_Text)obj).alignment = (TextAlignmentOptions)4097; EmojiRenderer.Attach((TMP_Text)(object)obj); return (TMP_Text)(object)obj; } private static void Button(Transform parent, string value, float x, float y, float w, float h, TMP_FontAsset font, Action action) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown RectTransform obj = Rect(parent, value, x, y, w, h); Image val = ((Component)obj).gameObject.AddComponent<Image>(); ((Graphic)val).color = new Color(0.23f, 0.26f, 0.28f); Button obj2 = ((Component)obj).gameObject.AddComponent<Button>(); ((Selectable)obj2).targetGraphic = (Graphic)(object)val; ((UnityEvent)obj2.onClick).AddListener((UnityAction)delegate { action(); }); Text((Transform)(object)obj, value, 6f, 0f, w - 12f, h, font, 17).alignment = (TextAlignmentOptions)514; } } internal sealed class EmojiRenderer : MonoBehaviour { private static TMP_SpriteAsset _asset; private static bool _failed; private TMP_Text _text; private TMP_SpriteAsset _original; private bool _tint; private static TMP_SpriteAsset Asset { get { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)_asset) || _failed) { return _asset; } Texture2D val = null; Material val2 = null; TMP_SpriteAsset val3 = null; try { using Stream stream = typeof(EmojiRenderer).Assembly.GetManifestResourceStream("Runic.Emoji.atlas.png"); if (stream == null) { throw new InvalidOperationException("Embedded emoji atlas missing."); } using MemoryStream memoryStream = new MemoryStream(); stream.CopyTo(memoryStream); val = new Texture2D(2, 2, (TextureFormat)4, false); ((Object)val).name = "Runic Emoji Atlas"; ((Object)val).hideFlags = (HideFlags)61; if (!ImageConversion.LoadImage(val, memoryStream.ToArray(), true)) { throw new InvalidOperationException("Emoji atlas could not be decoded."); } ((Texture)val).filterMode = (FilterMode)1; ((Texture)val).wrapMode = (TextureWrapMode)1; Shader obj = Shader.Find("TextMeshPro/Sprite"); if (!Object.op_Implicit((Object)(object)obj)) { throw new InvalidOperationException("TextMeshPro sprite shader unavailable."); } val2 = new Material(obj) { name = "Runic Emoji Material", mainTexture = (Texture)(object)val, hideFlags = (HideFlags)61 }; val3 = ScriptableObject.CreateInstance<TMP_SpriteAsset>(); ((Object)val3).name = "Runic Emoji"; ((Object)val3).hideFlags = (HideFlags)61; val3.spriteSheet = (Texture)(object)val; val3.spriteInfoList = new List<TMP_Sprite>(); for (int i = 0; i < EmojiCatalog.Entries.Length; i++) { EmojiEntry emojiEntry = EmojiCatalog.Entries[i]; val3.spriteInfoList.Add(new TMP_Sprite { id = i, name = emojiEntry.Name, unicode = (int)emojiEntry.Unicode, x = i % 8 * 76 + 2, y = 608 - (i / 8 * 76 + 2) - 72, width = 72f, height = 72f, xOffset = 0f, yOffset = 64f, xAdvance = 78f, scale = 1f }); } ((TMP_Asset)val3).material = val2; val3.UpdateLookupTables(); _asset = val3; } catch (Exception ex) { _failed = true; if (Object.op_Implicit((Object)(object)val3)) { Object.Destroy((Object)(object)val3); } if (Object.op_Implicit((Object)(object)val2)) { Object.Destroy((Object)(object)val2); } if (Object.op_Implicit((Object)(object)val)) { Object.Destroy((Object)(object)val); } Debug.LogWarning((object)("Runic emoji rendering unavailable; labels remain editable: " + ex.Message)); } return _asset; } } internal static void Attach(TMP_Text text) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 if (Object.op_Implicit((Object)(object)text) && (int)SystemInfo.graphicsDeviceType != 4 && !Object.op_Implicit((Object)(object)((Component)text).GetComponent<EmojiRenderer>())) { TMP_SpriteAsset asset = Asset; if (Object.op_Implicit((Object)(object)asset)) { EmojiRenderer emojiRenderer = ((Component)text).gameObject.AddComponent<EmojiRenderer>(); emojiRenderer._text = text; emojiRenderer._original = text.spriteAsset; emojiRenderer._tint = text.tintAllSprites; text.spriteAsset = asset; text.tintAllSprites = false; } } } private void OnDestroy() { if (Object.op_Implicit((Object)(object)_text) && (Object)(object)_text.spriteAsset == (Object)(object)_asset) { _text.spriteAsset = _original; _text.tintAllSprites = _tint; } } internal static void Release() { EmojiRenderer[] array = Object.FindObjectsByType<EmojiRenderer>((FindObjectsSortMode)0); foreach (EmojiRenderer obj in array) { obj.OnDestroy(); Object.Destroy((Object)(object)obj); } if (Object.op_Implicit((Object)(object)_asset)) { Object.Destroy((Object)(object)((TMP_Asset)_asset).material); Object.Destroy((Object)(object)_asset.spriteSheet); Object.Destroy((Object)(object)_asset); } _asset = null; _failed = false; } } internal sealed class EmojiEntry { internal readonly uint Unicode; internal readonly string Name; internal readonly string Group; internal string Text => char.ConvertFromUtf32((int)Unicode); internal EmojiEntry(uint unicode, string name, string group) { Unicode = unicode; Name = name; Group = group; } } internal static class EmojiText { internal static bool ValidUnicode(string text) { if (text == null) { return false; } for (int i = 0; i < text.Length; i++) { if (char.IsSurrogate(text[i]) && (!char.IsHighSurrogate(text[i]) || ++i >= text.Length || !char.IsLowSurrogate(text[i]))) { return false; } } return true; } internal static string Clean(string text, int limit) { StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < (text ?? "").Length; i++) { if (stringBuilder.Length >= limit) { break; } char c = text[i]; if (!char.IsSurrogate(c)) { stringBuilder.Append(c); } else if (char.IsHighSurrogate(c) && i + 1 < text.Length && char.IsLowSurrogate(text[i + 1])) { if (stringBuilder.Length + 2 > limit) { break; } stringBuilder.Append(c).Append(text[++i]); } } return stringBuilder.ToString(); } internal static bool Insert(string text, int anchor, int focus, string emoji, int limit, out string result, out int caret) { if (text == null) { text = ""; } int num = Math.Max(0, Math.Min(text.Length, Math.Min(anchor, focus))); int num2 = Math.Max(0, Math.Min(text.Length, Math.Max(anchor, focus))); bool flag = num != num2; if (num > 0 && num < text.Length && char.IsLowSurrogate(text[num])) { num--; } if (num2 > 0 && num2 < text.Length && char.IsLowSurrogate(text[num2])) { num2 += (flag ? 1 : (-1)); } result = text; caret = num; if (!ValidUnicode(text) || !ValidUnicode(emoji) || text.Length - (num2 - num) + emoji.Length > limit) { return false; } result = text.Substring(0, num) + emoji + text.Substring(num2); caret = num + emoji.Length; return true; } } } namespace RunicSigns { [BepInPlugin("chazman.RunicSigns", "RunicSigns", "1.2.9")] [BepInIncompatibility("chazman.BetterSigns")] public sealed class Plugin : BaseUnityPlugin { public const string Guid = "chazman.RunicSigns"; public const string Version = "1.2.9"; private Harmony _harmony; internal static ManualLogSource Log; private void Awake() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; SignPlacement.Bind(((BaseUnityPlugin)this).Config); ModalGameplayInput.IsOpen = () => SignEditor.BlockGameplay; _harmony = new Harmony("chazman.RunicSigns"); _harmony.PatchAll(); ((Component)this).gameObject.AddComponent<SignEditor>(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"RunicSigns 1.2.9 loaded: F8 live label editor, [ / ] sign sizing."); } private void OnDestroy() { SignEditor.Close(); SignPlacementPreview[] array = Object.FindObjectsByType<SignPlacementPreview>((FindObjectsSortMode)0); for (int i = 0; i < array.Length; i++) { Object.Destroy((Object)(object)array[i]); } SignRuntime[] array2 = Object.FindObjectsByType<SignRuntime>((FindObjectsSortMode)0); for (int i = 0; i < array2.Length; i++) { Object.Destroy((Object)(object)array2[i]); } Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } EmojiRenderer.Release(); ModalGameplayInput.Reset(); } } } namespace RunicSigns.Input { internal static class ModalGameplayInput { internal static Func<bool> IsOpen; [ThreadStatic] private static int _cameraDepth; private static int _lastOpenFrame = -10; internal static bool Blocked { get { Func<bool> isOpen = IsOpen; if (isOpen != null && isOpen()) { _lastOpenFrame = Time.frameCount; return true; } return Time.frameCount <= _lastOpenFrame + 1; } } internal static bool CameraBlocked => _cameraDepth > 0; internal static void Reset() { IsOpen = null; _lastOpenFrame = -10; _cameraDepth = 0; } internal static void EnterCamera(bool blocked) { if (blocked) { _cameraDepth++; } } internal static void ExitCamera(bool blocked) { if (blocked) { _cameraDepth = Math.Max(0, _cameraDepth - 1); } } internal static bool GameplayAction(string name) { if (name != null) { if (!name.StartsWith("Hotbar", StringComparison.Ordinal)) { switch (name) { default: return name == "JoyGuardianPower"; case "JoyHotbarUse": case "Forward": case "Backward": case "Left": case "Right": case "Attack": case "JoyAttack": case "SecondaryAttack": case "JoySecondaryAttack": case "Block": case "JoyBlock": case "Jump": case "JoyJump": case "Crouch": case "JoyCrouch": case "Run": case "JoyRun": case "AutoRun": case "Dodge": case "JoyDodge": case "Use": case "JoyUse": case "Inventory": case "JoyInventory": case "Chat": case "Console": case "GuardianPower": break; } } return true; } return false; } } [HarmonyPatch(typeof(PlayerController), "TakeInput", new Type[] { typeof(bool) })] internal static class ModalControllerInputPatch { [HarmonyPostfix] [HarmonyPriority(0)] private static void Postfix(ref bool __result) { if (ModalGameplayInput.Blocked) { __result = false; } } } [HarmonyPatch(typeof(Player), "TakeInput")] internal static class ModalPlayerInputPatch { [HarmonyPostfix] [HarmonyPriority(0)] private static void Postfix(Player __instance, ref bool __result) { if ((Object)(object)__instance == (Object)(object)Player.m_localPlayer && ModalGameplayInput.Blocked) { __result = false; } } } [HarmonyPatch(typeof(Player), "SetControls")] internal static class ModalControlsPatch { [HarmonyPrefix] [HarmonyPriority(0)] private static void Prefix(Player __instance, ref Vector3 movedir, ref bool attack, ref bool attackHold, ref bool secondaryAttack, ref bool secondaryAttackHold, ref bool block, ref bool blockHold, ref bool jump, ref bool crouch, ref bool run, ref bool autoRun, ref bool dodge) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer) && ModalGameplayInput.Blocked) { movedir = Vector3.zero; attack = (attackHold = (secondaryAttack = (secondaryAttackHold = (block = (blockHold = (jump = (crouch = (run = (autoRun = (dodge = false)))))))))); } } } [HarmonyPatch] internal static class ModalCameraScopePatch { private static IEnumerable<MethodBase> TargetMethods() { return from m in typeof(GameCamera).GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) where m.DeclaringType == typeof(GameCamera) && (m.Name == "UpdateCamera" || m.Name == "UpdateFreeFly") select m; } [HarmonyPrefix] [HarmonyPriority(800)] private static void Prefix(out bool __state) { __state = ModalGameplayInput.Blocked; ModalGameplayInput.EnterCamera(__state); } [HarmonyFinalizer] private static Exception Finalizer(Exception __exception, bool __state) { ModalGameplayInput.ExitCamera(__state); return __exception; } } [HarmonyPatch] internal static class ModalCameraAxisPatch { private static IEnumerable<MethodBase> TargetMethods() { return from m in typeof(ZInput).GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) where m.ReturnType == typeof(float) && (m.Name == "GetMouseScrollWheel" || m.Name.StartsWith("GetJoyLeftStick", StringComparison.Ordinal) || m.Name.StartsWith("GetJoyRightStick", StringComparison.Ordinal) || m.Name == "GetJoyLTrigger" || m.Name == "GetJoyRTrigger") select m; } [HarmonyPostfix] [HarmonyPriority(0)] private static void Postfix(ref float __result) { if (ModalGameplayInput.CameraBlocked) { __result = 0f; } } } [HarmonyPatch(typeof(ZInput), "GetMouseDelta")] internal static class ModalCameraLookPatch { [HarmonyPostfix] [HarmonyPriority(0)] private static void Postfix(ref Vector2 __result) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (ModalGameplayInput.CameraBlocked) { __result = Vector2.zero; } } } [HarmonyPatch] internal static class ModalNamedActionPatch { private static IEnumerable<MethodBase> TargetMethods() { return ((IEnumerable<string>)new string[3] { "GetButton", "GetButtonDown", "GetButtonUp" }).Select((Func<string, MethodBase>)((string name) => AccessTools.Method(typeof(ZInput), name, new Type[1] { typeof(string) }, (Type[])null))); } [HarmonyPostfix] [HarmonyPriority(0)] private static void Postfix(string name, ref bool __result) { if (ModalGameplayInput.CameraBlocked || (ModalGameplayInput.Blocked && ModalGameplayInput.GameplayAction(name))) { __result = false; } } } [HarmonyPatch] internal static class ModalShortcutKeyPatch { private static IEnumerable<MethodBase> TargetMethods() { return from m in typeof(ZInput).GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) where m.ReturnType == typeof(bool) && (m.Name == "GetKey" || m.Name == "GetKeyDown" || m.Name == "GetKeyUp") && m.GetParameters().Length != 0 && m.GetParameters()[0].ParameterType == typeof(KeyCode) select m; } [HarmonyPostfix] [HarmonyPriority(0)] private static void Postfix(KeyCode key, ref bool __result) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Invalid comparison between Unknown and I4 if ((int)key != 27 && ((int)key < 323 || (int)key > 329) && ModalGameplayInput.Blocked) { __result = false; } } } } namespace RunicSigns.Runtime { internal static class SignAccess { private static readonly FieldInfo Areas = AccessTools.Field(typeof(PrivateArea), "m_allAreas"); private static readonly MethodInfo Permitted = AccessTools.Method(typeof(PrivateArea), "IsPermitted", (Type[])null, (Type[])null); private static readonly FieldInfo Viewable = AccessTools.Field(typeof(Sign), "m_isViewable"); internal static bool Eligible(Sign sign) { if (Object.op_Implicit((Object)(object)sign) && Object.op_Implicit((Object)(object)((Component)sign).GetComponent<Piece>()) && Object.op_Implicit((Object)(object)((Component)sign).GetComponent<ZNetView>()) && ((Component)sign).GetComponent<ZNetView>().IsValid()) { return Utils.GetPrefabName(((Component)sign).gameObject) == "sign"; } return false; } internal static bool CanView(Sign sign) { if (Object.op_Implicit((Object)(object)sign) && Viewable != null) { return (bool)Viewable.GetValue(sign); } return false; } internal static bool Local(Sign sign) { //IL_002a: 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_004c: Unknown result type (might be due to invalid IL or missing references) if (Eligible(sign) && Object.op_Implicit((Object)(object)Player.m_localPlayer) && !((Character)Player.m_localPlayer).IsDead() && Vector3.Distance(((Component)Player.m_localPlayer).transform.position, ((Component)sign).transform.position) <= 5f) { return PrivateArea.CheckAccess(((Component)sign).transform.position, 0f, false, false); } return false; } internal static bool Sender(Sign sign, long sender) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) if (sender == ZNet.GetUID()) { return Local(sign); } Player val = ((IEnumerable<Player>)Player.GetAllPlayers()).FirstOrDefault((Func<Player, bool>)delegate(Player p) { if (Object.op_Implicit((Object)(object)p)) { ZNetView component2 = ((Component)p).GetComponent<ZNetView>(); if (component2 == null) { return false; } ZDO zDO = component2.GetZDO(); return ((zDO != null) ? new long?(zDO.GetOwner()) : ((long?)null)) == sender; } return false; }); if (!Object.op_Implicit((Object)(object)val) || ((Character)val).IsDead() || Vector3.Distance(((Component)val).transform.position, ((Component)sign).transform.position) > 5f) { return false; } if (Areas == null || Permitted == null) { return false; } if (!(Areas.GetValue(null) is List<PrivateArea> list)) { return false; } bool flag = false; foreach (PrivateArea item in list) { object obj; if (!Object.op_Implicit((Object)(object)item)) { obj = null; } else { ZNetView component = ((Component)item).GetComponent<ZNetView>(); obj = ((component != null) ? component.GetZDO() : null); } ZDO val2 = (ZDO)obj; if (val2 != null && val2.GetBool(ZDOVars.s_enabled, false) && !(Utils.DistanceXZ(((Component)item).transform.position, ((Component)sign).transform.position) >= item.m_radius)) { flag = true; if (((Component)item).GetComponent<Piece>().GetCreator() == val.GetPlayerID() || (bool)Permitted.Invoke(item, new object[1] { val.GetPlayerID() })) { return true; } } } return !flag; } } internal sealed class SignAppearance : IDisposable { private sealed class VanillaPreview : ITextPreprocessor { internal string Text; internal Func<bool> Permitted; public string PreprocessText(string text) { if (Permitted != null && !Permitted()) { return text; } return Text; } } private sealed class Formatter : ITextPreprocessor { internal SignSettings Settings; internal string Draft; internal Func<bool> Permitted; public string PreprocessText(string text) { return SignFormatting.Render((Draft != null && (Permitted == null || Permitted())) ? Draft : text, Settings); } } private readonly Transform _root; private readonly TextMeshProUGUI _text; private readonly Vector3 _scale; private readonly Vector3 _position; private readonly float _font; private readonly float _min; private readonly float _max; private readonly bool _auto; private readonly bool _rich; private readonly bool _overrideColorTags; private readonly TextWrappingModes _wrapping; private float _curveVertical; private float _curveDepth; private readonly Color _color; private readonly FontStyles _style; private readonly TextAlignmentOptions _alignment; private readonly TextOverflowModes _overflow; private readonly ITextPreprocessor _preprocessor; private readonly Material _baseMaterial; private readonly TMP_SpriteAsset _nativeSprites; private readonly TMP_SpriteAsset _emojiSprites; private readonly bool _nativeTint; private readonly VanillaPreview _vanillaPreview = new VanillaPreview(); private readonly Formatter _formatter = new Formatter(); private Material _effectMaterial; private int _effect = -1; private Image _background; private int _backgroundMode; internal SignAppearance(Transform root, TextMeshProUGUI text) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010d: 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) _root = root; _text = text; _scale = root.localScale; if (Object.op_Implicit((Object)(object)text)) { _nativeSprites = ((TMP_Text)text).spriteAsset; _nativeTint = ((TMP_Text)text).tintAllSprites; EmojiRenderer.Attach((TMP_Text)(object)text); _emojiSprites = ((TMP_Text)text).spriteAsset; _position = ((Transform)((TMP_Text)text).rectTransform).localPosition; _wrapping = ((TMP_Text)text).textWrappingMode; ((TMP_Text)text).OnPreRenderText += BendText; _font = ((TMP_Text)text).fontSize; _min = ((TMP_Text)text).fontSizeMin; _max = ((TMP_Text)text).fontSizeMax; _auto = ((TMP_Text)text).enableAutoSizing; _rich = ((TMP_Text)text).richText; _color = ((Graphic)text).color; _overrideColorTags = ((TMP_Text)text).overrideColorTags; _style = ((TMP_Text)text).fontStyle; _alignment = ((TMP_Text)text).alignment; _overflow = ((TMP_Text)text).overflowMode; _preprocessor = ((TMP_Text)text).textPreprocessor; _baseMaterial = ((TMP_Text)text).fontSharedMaterial; } } internal void Apply(SignSettings s, string draft = null, Func<bool> permitted = null) { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0100: 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_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_025e: 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_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Expected O, but got Unknown //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) if (s.VanillaCompatible) { Restore(); if (Object.op_Implicit((Object)(object)_text) && draft != null) { _vanillaPreview.Text = Export(draft, s); _vanillaPreview.Permitted = permitted; ((TMP_Text)_text).textPreprocessor = (ITextPreprocessor)(object)_vanillaPreview; ((TMP_Text)_text).havePropertiesChanged = true; ((Graphic)_text).SetAllDirty(); } return; } _root.localScale = _scale * s.Scale; if (Object.op_Implicit((Object)(object)_text)) { ((TMP_Text)_text).spriteAsset = _emojiSprites; ((TMP_Text)_text).tintAllSprites = false; _formatter.Settings = s; _formatter.Draft = draft; _formatter.Permitted = permitted; ((TMP_Text)_text).textPreprocessor = (ITextPreprocessor)(object)_formatter; ((TMP_Text)_text).richText = true; ((TMP_Text)_text).fontStyle = (FontStyles)0; ((Graphic)_text).color = Color.white; ((TMP_Text)_text).overrideColorTags = false; ((TMP_Text)_text).alignment = (TextAlignmentOptions)((s.Alignment == 0) ? 513 : ((s.Alignment == 2) ? 516 : 514)); ((TMP_Text)_text).enableAutoSizing = s.Fit; ((TMP_Text)_text).fontSizeMax = _font * s.TextSize; ((TMP_Text)_text).fontSizeMin = Mathf.Min(((TMP_Text)_text).fontSizeMax, Mathf.Max(1f, _font * 0.25f)); ((TMP_Text)_text).fontSize = ((TMP_Text)_text).fontSizeMax; ((TMP_Text)_text).overflowMode = (TextOverflowModes)0; ((TMP_Text)_text).textWrappingMode = (TextWrappingModes)(s.Fit ? ((int)_wrapping) : 0); _curveVertical = s.CurveVertical; _curveDepth = s.CurveDepth; RectTransform rectTransform = ((TMP_Text)_text).rectTransform; ? val; if (s.OffsetUnit != 0) { val = new Vector2(((TMP_Text)_text).isOrthographic ? 1f : 0.1f, ((TMP_Text)_text).isOrthographic ? 1f : 0.1f); } else { Rect rect = rectTransform.rect; val = ((Rect)(ref rect)).size; } Vector2 val2 = (Vector2)val; Vector2 val3 = Vector2.Scale(val2, new Vector2(s.Horizontal, s.Vertical)); ((Transform)rectTransform).localPosition = _position + ((Transform)rectTransform).localRotation * Vector3.Scale(((Transform)rectTransform).localScale, new Vector3(val3.x, val3.y, (0f - val2.x) * s.Depth)); _backgroundMode = s.Background; if (!Object.op_Implicit((Object)(object)_background) && s.Background != 0) { GameObject val4 = new GameObject("RunicSignsBackground", new Type[3] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Image) }); val4.transform.SetParent(((TMP_Text)_text).transform.parent, false); _background = val4.GetComponent<Image>(); ((Graphic)_background).raycastTarget = false; RectTransform rectTransform2 = ((Graphic)_background).rectTransform; rectTransform2.anchorMin = rectTransform.anchorMin; rectTransform2.anchorMax = rectTransform.anchorMin; rectTransform2.pivot = new Vector2(0.5f, 0.5f); rectTransform2.sizeDelta = rectTransform.sizeDelta; ((Transform)rectTransform2).localRotation = ((Transform)rectTransform).localRotation; ((Transform)rectTransform2).localScale = ((Transform)rectTransform).localScale; ((Transform)rectTransform2).SetSiblingIndex(((Transform)rectTransform).GetSiblingIndex()); } if (Object.op_Implicit((Object)(object)_background)) { ((Component)_background).gameObject.SetActive(s.Background != 0); ((Transform)((Graphic)_background).rectTransform).localPosition = ((Transform)rectTransform).localPosition; ((Graphic)_background).color = ((s.Background == 1) ? Color.white : Color.black); } SetEffect(s.Effect); ((TMP_Text)_text).havePropertiesChanged = true; ((Graphic)_text).SetAllDirty(); } } private void SetEffect(int effect) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_007d: 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_0121: Unknown result type (might be due to invalid IL or missing references) if (_effect == effect) { return; } _effect = effect; if (Object.op_Implicit((Object)(object)_effectMaterial)) { Object.Destroy((Object)(object)_effectMaterial); } _effectMaterial = null; ((TMP_Text)_text).fontSharedMaterial = _baseMaterial; if (Object.op_Implicit((Object)(object)_baseMaterial)) { _effectMaterial = new Material(_baseMaterial); if (_effectMaterial.HasProperty("_FaceColor")) { _effectMaterial.SetColor("_FaceColor", Color.white); } if ((effect & 1) != 0 && _effectMaterial.HasProperty("_OutlineWidth")) { _effectMaterial.EnableKeyword("OUTLINE_ON"); _effectMaterial.SetFloat("_OutlineWidth", 0.16f); _effectMaterial.SetColor("_OutlineColor", Color.black); } if ((effect & 2) != 0 && _effectMaterial.HasProperty("_UnderlayOffsetX")) { _effectMaterial.EnableKeyword("UNDERLAY_ON"); _effectMaterial.SetColor("_UnderlayColor", new Color(0f, 0f, 0f, 0.8f)); _effectMaterial.SetFloat("_UnderlayOffsetX", 0.7f); _effectMaterial.SetFloat("_UnderlayOffsetY", -0.7f); _effectMaterial.SetFloat("_UnderlaySoftness", 0.25f); } ((TMP_Text)_text).fontSharedMaterial = _effectMaterial; ((TMP_Text)_text).UpdateMeshPadding(); } } private void BendText(TMP_TextInfo info) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) if (!CaptionMeshCurve.Apply(info, _curveVertical, _curveDepth, out var min, out var max)) { if (Object.op_Implicit((Object)(object)_background)) { ((Component)_background).gameObject.SetActive(false); } return; } float x = min.x; float y = min.y; float x2 = max.x; float y2 = max.y; float z = max.z; if (Object.op_Implicit((Object)(object)_background) && _backgroundMode != 0) { RectTransform rectTransform = ((TMP_Text)_text).rectTransform; RectTransform rectTransform2 = ((Graphic)_background).rectTransform; float num = Math.Max(1f, ((TMP_Text)_text).fontSize * 0.15f); rectTransform2.sizeDelta = new Vector2(x2 - x + num * 2f, y2 - y + num * 2f); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor((x + x2) * 0.5f, (y + y2) * 0.5f, z + 0.01f); ((Transform)rectTransform2).localPosition = ((Transform)rectTransform).localPosition + ((Transform)rectTransform).localRotation * Vector3.Scale(((Transform)rectTransform).localScale, val); ((Component)_background).gameObject.SetActive(true); } } internal void Restore() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)_root)) { _root.localScale = _scale; } _backgroundMode = 0; if (Object.op_Implicit((Object)(object)_background)) { ((Component)_background).gameObject.SetActive(false); } if (Object.op_Implicit((Object)(object)_text)) { ((TMP_Text)_text).spriteAsset = _nativeSprites; ((TMP_Text)_text).tintAllSprites = _nativeTint; ((TMP_Text)_text).textPreprocessor = _preprocessor; ((TMP_Text)_text).fontSize = _font; ((TMP_Text)_text).fontSizeMin = _min; ((TMP_Text)_text).fontSizeMax = _max; _curveVertical = (_curveDepth = 0f); ((TMP_Text)_text).textWrappingMode = _wrapping; ((TMP_Text)_text).enableAutoSizing = _auto; ((TMP_Text)_text).richText = _rich; ((Graphic)_text).color = _color; ((TMP_Text)_text).overrideColorTags = _overrideColorTags; ((TMP_Text)_text).fontStyle = _style; ((TMP_Text)_text).alignment = _alignment; ((TMP_Text)_text).overflowMode = _overflow; ((Transform)((TMP_Text)_text).rectTransform).localPosition = _position; ((TMP_Text)_text).fontSharedMaterial = _baseMaterial; _effect = -1; ((TMP_Text)_text).havePropertiesChanged = true; ((Graphic)_text).SetAllDirty(); } } public void Dispose() { Restore(); if (Object.op_Implicit((Object)(object)_text)) { ((TMP_Text)_text).OnPreRenderText -= BendText; } if (Object.op_Implicit((Object)(object)_background)) { Object.Destroy((Object)(object)((Component)_background).gameObject); } if (Object.op_Implicit((Object)(object)_effectMaterial)) { Object.Destroy((Object)(object)_effectMaterial); } } internal string Export(string caption, SignSettings settings) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) float font = _font; float width; Rect rect; if (!Object.op_Implicit((Object)(object)_text)) { width = 0f; } else { rect = ((TMP_Text)_text).rectTransform.rect; width = ((Rect)(ref rect)).size.x; } float height; if (!Object.op_Implicit((Object)(object)_text)) { height = 0f; } else { rect = ((TMP_Text)_text).rectTransform.rect; height = ((Rect)(ref rect)).size.y; } return VanillaSignText.Encode(caption, settings, font, width, height, !Object.op_Implicit((Object)(object)_text) || ((TMP_Text)_text).isOrthographic); } } internal sealed class SignEditor : MonoBehaviour { [CompilerGenerated] private static class <>O { public static UnityAction <0>__Close; } private static SignEditor _instance; private static readonly EditorInputState InputState = new EditorInputState(); private static bool _pollingCancel; private static int _cancelFrame = -10; private GameObject _canvas; private GameObject _emojiPicker; private GameObject _colorPicker; private GameObject _effectsPicker; private Sign _sign; private SignRuntime _runtime; private SignPlacementPreview _ghost; private SignSettings _draft; private string _expectedStyle; private string _expectedText; private string _text; private bool _placement; private bool _closing; private bool _oldCursorVisible; private bool _coarse; private CursorLockMode _oldCursorLock; private TMP_FontAsset _font; private TMP_InputField _caption; private TMP_InputField _x; private TMP_InputField _y; private TMP_InputField _z; private TMP_InputField _sizeField; private TMP_InputField _inkField; private TMP_InputField _opacityField; private TMP_InputField _curveV; private TMP_InputField _curveD; private TMP_Text _status; private TMP_Text _target; private TMP_Text _board; private TMP_Text _units; private TMP_Text _fit; private TMP_Text _background; private TMP_Text _alignment; private TMP_Text _effect; private TMP_Text _step; private Button _save; private TMP_Text _compatibility; private readonly List<Selectable> _modOnly = new List<Selectable>(); private string _compatibilityError = ""; private CanvasGroup _fields; private readonly HashSet<TMP_InputField> _invalid = new HashSet<TMP_InputField>(); private int _start; private int _end; internal static bool IsOpen { get { if (InputState.IsOpen && Object.op_Implicit((Object)(object)_instance) && ((Behaviour)_instance).isActiveAndEnabled && Object.op_Implicit((Object)(object)_instance._canvas)) { return _instance._canvas.activeInHierarchy; } return false; } } internal static bool BlockGameplay => IsOpen; internal static bool SuppressCancel { get { if (!_pollingCancel) { if (!IsOpen) { return Time.frameCount == _cancelFrame; } return true; } return false; } } private bool Saving { get { if (Object.op_Implicit((Object)(object)_runtime)) { return _runtime.Saving; } return false; } } internal static bool IsPlacementTarget(GameObject ghost) { if (IsOpen && _instance._placement && Object.op_Implicit((Object)(object)_instance._sign)) { return (Object)(object)((Component)_instance._sign).gameObject == (Object)(object)ghost; } return false; } private void Awake() { InputState.Reset(); _instance = this; } internal static void Open(Sign sign) { OpenEditor(sign, placement: false); } internal static void OpenPlacement(Sign sign) { OpenEditor(sign, placement: true); } private static void OpenEditor(Sign sign, bool placement) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_instance) || !Object.op_Implicit((Object)(object)sign) || !Object.op_Implicit((Object)(object)sign.m_textWidget) || (!placement && (!SignAccess.Local(sign) || !SignAccess.CanView(sign)))) { return; } Close(); SignEditor instance = _instance; instance._sign = sign; instance._placement = placement; instance._oldCursorVisible = Cursor.visible; instance._oldCursorLock = Cursor.lockState; try { if (placement) { instance._ghost = ((Component)sign).GetComponent<SignPlacementPreview>(); if (!Object.op_Implicit((Object)(object)instance._ghost)) { return; } instance._draft = SignPlacement.CurrentSettings; instance._text = SignPlacement.Caption ?? sign.m_defaultText; } else { instance._runtime = SignRuntime.Attach(sign); if (!Object.op_Implicit((Object)(object)instance._runtime)) { return; } instance._expectedStyle = instance._runtime.Raw; instance._expectedText = instance._runtime.NativeText; if (!SignSettings.TryDecode(instance._expectedStyle, out instance._draft)) { Player localPlayer = Player.m_localPlayer; if (localPlayer != null) { ((Character)localPlayer).Message((MessageType)2, RunicText.Get("text_7bd0f355b778"), 0, (Sprite)null, false); } return; } instance._text = sign.GetText(); if (instance._text != instance._expectedText) { instance._draft.Runs.Clear(); } if (instance._draft.VanillaCompatible) { instance._text = VanillaSignText.Caption(instance._text); } } SignFormatting.NormalizeEditorOpacity(instance._draft); instance._font = ((TMP_Text)sign.m_textWidget).font; instance._start = (instance._end = 0); instance._coarse = false; instance._invalid.Clear(); instance.Build(); instance._canvas.SetActive(true); InputState.Open(); instance.SyncStyleFields(); instance.Refresh(); instance.RenewCursor(); } catch (Exception ex) { Close(); Plugin.Log.LogError((object)("Sign designer could not open: " + ex)); } } private void Update() { if (!InputState.IsOpen) { return; } try { bool num; if (IsOpen && Object.op_Implicit((Object)(object)_sign) && Object.op_Implicit((Object)(object)Player.m_localPlayer) && !((Character)Player.m_localPlayer).IsDead()) { if (!_placement) { if (Object.op_Implicit((Object)(object)_runtime) && SignAccess.Local(_sign)) { num = !SignAccess.CanView(_sign); goto IL_0092; } } else if (Object.op_Implicit((Object)(object)_ghost)) { num = !((Component)_sign).gameObject.activeInHierarchy; goto IL_0092; } } goto IL_0094; IL_0092: if (!num) { _pollingCancel = true; bool flag; try { flag = ZInput.GetKeyDown((KeyCode)27, false) || ZInput.GetButtonDown("JoyButtonB"); } finally { _pollingCancel = false; } if (flag) { _cancelFrame = Time.frameCount; if (Object.op_Implicit((Object)(object)_effectsPicker)) { CloseEffects(); } else if (Object.op_Implicit((Object)(object)_colorPicker)) { CloseColors(); } else if (Object.op_Implicit((Object)(object)_emojiPicker)) { _emojiPicker.SetActive(false); Object.Destroy((Object)(object)_emojiPicker); _emojiPicker = null; } else { Close(); } } else { if (_caption.isFocused) { CaptureSelection(); } bool flag2 = Object.op_Implicit((Object)(object)_colorPicker) || Object.op_Implicit((Object)(object)_emojiPicker) || Object.op_Implicit((Object)(object)_effectsPicker); _fields.interactable = !Saving && !flag2; ((Selectable)_save).interactable = !Saving && !flag2 && _invalid.Count == 0 && _draft.Valid && _compatibilityError.Length == 0; RenewCursor(); } return; } goto IL_0094; IL_0094: Close(); } catch (Exception ex) { Close(); Plugin.Log.LogError((object)("Sign designer failed; controls restored: " + ex)); } } private void LateUpdate() { if (IsOpen) { RenewCursor(); } } private void RenewCursor() { Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; } internal static void KeepCursor() { if (IsOpen) { _instance.RenewCursor(); } } internal static bool SuppressClosingAction(string name) { EditorInputState inputState = InputState; ZInput instance = ZInput.instance; int held; if (instance == null) { held = 0; } else { ButtonDef buttonDef = instance.GetButtonDef(name); held = ((((buttonDef != null) ? new bool?(buttonDef.Held) : ((bool?)null)) == true) ? 1 : 0); } return inputState.SuppressClosingAction(name, (byte)held != 0, Time.unscaledTime); } internal static void Close() { //IL_01a6: Unknown result type (might be due to invalid IL or missing references) SignEditor instance = _instance; if (!Object.op_Implicit((Object)(object)instance)) { InputState.Reset(); } else { if (instance._closing) { return; } instance._closing = true; bool flag = Object.op_Implicit((Object)(object)instance._canvas); InputState.Close(Time.unscaledTime, 0u); try { uint num = 0u; for (int i = 0; i < EditorInputState.ClosingActions.Length; i++) { ZInput instance2 = ZInput.instance; if (instance2 != null) { ButtonDef buttonDef = instance2.GetButtonDef(EditorInputState.ClosingActions[i]); if (((buttonDef != null) ? new bool?(buttonDef.Held) : ((bool?)null)) == true) { num |= (uint)(1 << i); } } } InputState.Close(Time.unscaledTime, num); if (Object.op_Implicit((Object)(object)instance._runtime)) { instance._runtime.CancelSave(); instance._runtime.EndPreview(); } if (Object.op_Implicit((Object)(object)instance._ghost) && Object.op_Implicit((Object)(object)Player.m_localPlayer)) { instance._ghost.Apply(SignPlacement.CurrentSettings, SignPlacement.Caption, Player.m_localPlayer); } if (Object.op_Implicit((Object)(object)instance._caption)) { instance._caption.DeactivateInputField(false); } } catch (Exception ex) { Plugin.Log.LogWarning((object)("Designer cleanup: " + ex.Message)); } finally { GameObject canvas = instance._canvas; instance._canvas = null; instance._sign = null; instance._runtime = null; instance._ghost = null; instance._caption = null; instance._emojiPicker = null; instance._colorPicker = null; instance._effectsPicker = null; instance._invalid.Clear(); instance._closing = false; if (flag) { Cursor.visible = instance._oldCursorVisible; Cursor.lockState = instance._oldCursorLock; } if (Object.op_Implicit((Object)(object)canvas)) { canvas.SetActive(false); Object.Destroy((Object)(object)canvas); } } } } private void OnDisable() { if ((Object)(object)_instance == (Object)(object)this) { Close(); } } private void OnDestroy() { Close(); InputState.Reset(); if ((Object)(object)_instance == (Object)(object)this) { _instance = null; } } private void Build() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_016a: 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_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Expected O, but got Unknown //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Expected O, but got Unknown //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Expected O, but got Unknown //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Expected O, but got Unknown //IL_056f: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Expected O, but got Unknown //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_05ab: Expected O, but got Unknown //IL_05cf: Unknown result type (might be due to invalid IL or missing references) //IL_05d9: Expected O, but got Unknown //IL_0606: Unknown result type (might be due to invalid IL or missing references) //IL_0610: Expected O, but got Unknown //IL_063d: Unknown result type (might be due to invalid IL or missing references) //IL_0647: Expected O, but got Unknown //IL_0674: Unknown result type (might be due to invalid IL or missing references) //IL_067e: Expected O, but got Unknown //IL_06d2: Unknown result type (might be due to invalid IL or missing references) //IL_06dc: Expected O, but got Unknown //IL_06ff: Unknown result type (might be due to invalid IL or missing references) //IL_0709: Expected O, but got Unknown //IL_072c: Unknown result type (might be due to invalid IL or missing references) //IL_0736: Expected O, but got Unknown //IL_075a: Unknown result type (might be due to invalid IL or missing references) //IL_0764: Expected O, but got Unknown //IL_085a: Unknown result type (might be due to invalid IL or missing references) //IL_0864: Expected O, but got Unknown //IL_0887: Unknown result type (might be due to invalid IL or missing references) //IL_0891: Expected O, but got Unknown //IL_08b4: Unknown result type (might be due to invalid IL or missing references) //IL_08be: Expected O, but got Unknown //IL_08e1: Unknown result type (might be due to invalid IL or missing references) //IL_08eb: Expected O, but got Unknown //IL_0978: Unknown result type (might be due to invalid IL or missing references) //IL_0982: Expected O, but got Unknown //IL_09aa: Unknown result type (might be due to invalid IL or missing references) //IL_09b4: Expected O, but got Unknown //IL_09d8: Unknown result type (might be due to invalid IL or missing references) //IL_09e2: Expected O, but got Unknown //IL_0a13: Unknown result type (might be due to invalid IL or missing references) //IL_0a1d: Expected O, but got Unknown //IL_0a41: Unknown result type (might be due to invalid IL or missing references) //IL_0a4b: Expected O, but got Unknown //IL_0aca: Unknown result type (might be due to invalid IL or missing references) //IL_0ad4: Expected O, but got Unknown //IL_0b09: Unknown result type (might be due to invalid IL or missing references) //IL_0b0e: Unknown result type (might be due to invalid IL or missing references) //IL_0b14: Expected O, but got Unknown _modOnly.Clear(); _compatibilityError = ""; _canvas = new GameObject("RunicSignDesigner", new Type[4] { typeof(RectTransform), typeof(Canvas), typeof(CanvasScaler), typeof(GraphicRaycaster) }); _canvas.SetActive(false); Canvas component = _canvas.GetComponent<Canvas>(); component.renderMode = (RenderMode)0; component.sortingOrder = 2000; CanvasScaler component2 = _canvas.GetComponent<CanvasScaler>(); component2.uiScaleMode = (ScaleMode)1; component2.referenceResolution = new Vector2(1440f, 900f); component2.screenMatchMode = (ScreenMatchMode)1; RectTransform rectTransform = ((Graphic)Box(_canvas.transform, "Input shield", 0f, 0f, 0f, 0f, new Color(0f, 0f, 0f, 0.04f))).rectTransform; rectTransform.anchorMin = Vector2.zero; rectTransform.anchorMax = Vector2.one; Vector2 val = (rectTransform.offsetMin = (rectTransform.offsetMax = Vector2.zero)); RectTransform rectTransform2 = ((Graphic)Box(_canvas.transform, "Designer", 24f, 0f, 484f, 850f, new Color(0.07f, 0.085f, 0.09f, 0.97f))).rectTransform; ((Vector2)(ref val))..ctor(0f, 0.5f); rectTransform2.anchorMax = val; rectTransform2.anchorMin = val; rectTransform2.pivot = new Vector2(0f, 0.5f); Text((Transform)(object)rectTransform2, _placement ? RunicText.Get("text_0e0052261f59") : RunicText.Get("text_869cad5c228a"), 18f, 12f, 448f, 34f, 25); Text((Transform)(object)rectTransform2, RunicText.Get("text_db228dce09d4"), 18f, 50f, 448f, 25f, 16); RectTransform val3 = Rect("Fields", (Transform)(object)rectTransform2, 0f, 82f, 484f, 668f); _fields = ((Component)val3).gameObject.AddComponent<CanvasGroup>(); Text((Transform)(object)val3, RunicText.Get("text_87d296ec9489"), 18f, 0f, 290f, 24f); ModButton((Transform)(object)val3, RunicText.Get("text_9491fc41c391"), 342f, -3f, 124f, 29f, (UnityAction)delegate { if (!Object.op_Implicit((Object)(object)_emojiPicker)) { _emojiPicker = EmojiPicker.Open(_canvas.transform, _caption, _font); } }); _caption = Input((Transform)(object)val3, _text, 18f, 30f, 448f, 95f, 1024, multi: true); EmojiInput.Attach(_caption); ((UnityEvent<string>)(object)_caption.onDeselect).AddListener((UnityAction<string>)delegate { CaptureSelection(); }); ((UnityEvent<string>)(object)_caption.onValueChanged).AddListener((UnityAction<string>)delegate(string value) { string text = value.Replace("\r\n", "\n").Replace('\r', '\n'); if (text != value) { value = text; _caption.SetTextWithoutNotify(value); } if (!SignSettings.ValidText(value)) { _invalid.Add(_caption); return; } _invalid.Remove(_caption); try { _draft.Runs = SignFormatting.Edit(_text, value, _draft.Runs); _text = value; Refresh(); } catch (ArgumentException ex) { _caption.SetTextWithoutNotify(_text); _status.text = ex.Message; } }); _target = Text((Transform)(object)val3, RunicText.Get("text_ad17cd50f8a8"), 18f, 130f, 320f, 25f, 14); Button((Transform)(object)val3, RunicText.Get("text_1fc9a387654d"), 364f, 129f, 102f, 27f, (UnityAction)delegate { _caption.selectionStringAnchorPosition = 0; _caption.selectionStringFocusPosition = _text.Length; CaptureSelection(); }); Button((Transform)(object)val3, RunicText.Get("text_94fee62e68e2"), 18f, 163f, 104f, 32f, (UnityAction)delegate { Style(delegate(TextStyle s) { s.Bold = ((!((s.Bold == -1) ? _draft.Bold : (s.Bold == 1))) ? 1 : 0); }); }); Button((Transform)(object)val3, RunicText.Get("text_9bf37cb58a69"), 130f, 163f, 104f, 32f, (UnityAction)delegate { Style(delegate(TextStyle s) { s.Italic = ((!((s.Italic == -1) ? _draft.Italic : (s.Italic == 1))) ? 1 : 0); }); }); Text((Transform)(object)val3, RunicText.Get("text_1795efa176d4"), 250f, 163f, 85f, 32f, 17); _sizeField = Number((Transform)(object)val3, _draft.TextSize, 338f, 163f, 128f, 0.1f, 20f, delegate(float value) { Style(delegate(TextStyle s) { s.Size = value; }); }); Text((Transform)(object)val3, RunicText.Get("text_a8516e586340"), 18f, 205f, 120f, 30f, 17); TMP_InputField ink = (_inkField = Input((Transform)(object)val3, (_draft.Ink == "") ? LabelColors.Names[_draft.Color] : _draft.Ink, 144f, 205f, 186f, 30f, 32, multi: false)); ((UnityEvent<string>)(object)ink.onValueChanged).AddListener((UnityAction<string>)delegate(string value) { if (!SignFormatting.TryColor(value, out var hex)) { _invalid.Add(ink); _status.text = RunicText.Get("text_00725bb5d8b3"); } else { _invalid.Remove(ink); Style(delegate(TextStyle s) { s.Ink = hex; }); } }); Text((Transform)(object)val3, RunicText.Get("text_074aeca55852"), 18f, 245f, 120f, 30f, 17); _opacityField = Number((Transform)(object)val3, _draft.Opacity * 100f, 144f, 245f, 90f, 0f, 100f, delegate(float value) { Style(delegate(TextStyle s) { string text = ((s.Ink != "") ? s.Ink : ((_draft.Ink != "") ? _draft.Ink : LabelColors.Hex[_draft.Color])); s.Ink = text.Substring(0, 7) + ((int)Math.Round((double)value * 2.55)).ToString("X2"); }); }); Button((Transform)(object)val3, RunicText.Get("text_aebb29d51c14"), 250f, 245f, 216f, 30f, (UnityAction)delegate { SignFormatting.ResetText(_draft); _start = (_end = 0); TMP_InputField caption2 = _caption; int selectionStringAnchorPosition = (_caption.selectionStringFocusPosition = 0); caption2.selectionStringAnchorPosition = selectionStringAnchorPosition; _target.text = RunicText.Get("text_56daa5d66c4f"); SyncStyleFields(); Refresh(); _status.text = RunicText.Get("text_fd60b1e12fd8"); }); Button((Transform)(object)val3, RunicText.Get("text_3a8d02640242"), 18f, 282f, 448f, 30f, new UnityAction(ShowColors)); _fit = ((Component)ModButton((Transform)(object)val3, "", 18f, 322f, 218f, 30f, (UnityAction)delegate { _draft.Fit = !_draft.Fit; Refresh(); })).GetComponentInChildren<TMP_Text>(); _alignment = ((Component)Button((Transform)(object)val3, "", 248f, 322f, 218f, 30f, (UnityAction)delegate { _draft.Alignment = (_draft.Alignment + 1) % 3; Refresh(); })).GetComponentInChildren<TMP_Text>(); _background = ((Component)ModButton((Transform)(object)val3, "", 18f, 361f, 218f, 30f, (UnityAction)delegate { _draft.Background = (_draft.Background + 1) % 3; Refresh(); })).GetComponentInChildren<TMP_Text>(); _effect = ((Component)ModButton((Transform)(object)val3, "", 248f, 361f, 218f, 30f, new UnityAction(ShowEffects))).GetComponentInChildren<TMP_Text>(); _board = Text((Transform)(object)val3, "", 18f, 401f, 218f, 30f, 17); ModButton((Transform)(object)val3, "−", 248f, 401f, 64f, 30f, (UnityAction)delegate { Resize(-0.25f); }); ModButton((Transform)(object)val3, "+", 324f, 401f, 64f, 30f, (UnityAction)delegate { Resize(0.25f); }); ModButton((Transform)(object)val3, "1×", 400f, 401f, 66f, 30f, (UnityAction)delegate { _draft.Scale = 1f; Refresh(); }); _units = ((Component)Button((Transform)(object)val3, "", 18f, 442f, 448f, 30f, new UnityAction(ChangeUnits))).GetComponentInChildren<TMP_Text>(); Text((Transform)(object)val3, RunicText.Get("text_0abba441f16e"), 18f, 481f, 120f, 30f, 17); _x = Number((Transform)(object)val3, _draft.Horizontal, 144f, 481f, 122f, -2000f, 2000f, delegate(float value) { _draft.Horizontal = value; Refresh(); }); Text((Transform)(object)val3, RunicText.Get("text_727cd3a64d79"), 18f, 520f, 120f, 30f, 17); _y = Number((Transform)(object)val3, _draft.Vertical, 144f, 520f, 122f, -2000f, 2000f, delegate(float value) { _draft.Vertical = value; Refresh(); }); Button((Transform)(object)val3, "←", 282f, 481f, 85f, 30f, (UnityAction)delegate { Move(-1, 0); }); Button((Transform)(object)val3, "→", 381f, 481f, 85f, 30f, (UnityAction)delegate { Move(1, 0); }); Button((Transform)(object)val3, "↓", 282f, 520f, 85f, 30f, (UnityAction)delegate { Move(0, -1); }); Button((Transform)(object)val3, "↑", 381f, 520f, 85f, 30f, (UnityAction)delegate { Move(0, 1); }); Text((Transform)(object)val3, RunicText.Get("text_f1dbc33978a9"), 18f, 559f, 120f, 30f, 17); _z = Number((Transform)(object)val3, _draft.Depth, 144f, 559f, 122f, -2000f, 2000f, delegate(float value) { _draft.Depth = value; Refresh(); }); ModButton((Transform)(object)val3, RunicText.Get("text_76900f1bfd16"), 282f, 559f, 85f, 30f, (UnityAction)delegate { Move(0, 0, -1); }); ModButton((Transform)(object)val3, RunicText.Get("text_f1c65e14817e"), 381f, 559f, 85f, 30f, (UnityAction)delegate { Move(0, 0, 1); }); _step = ((Component)Button((Transform)(object)val3, "", 18f, 598f, 218f, 30f, (UnityAction)delegate { _coarse = !_coarse; Refresh(); })).GetComponentInChildren<TMP_Text>(); Button((Transform)(object)val3, RunicText.Get("text_e02bdedb2cd9"), 248f, 598f, 218f, 30f, (UnityAction)delegate { _draft.Horizontal = (_draft.Vertical = (_draft.Depth = 0f)); UpdateOffsets(); Refresh(); }); _compatibility = ((Component)Button((Transform)(object)val3, "", 18f, 634f, 448f, 32f, (UnityAction)delegate { _draft.VanillaCompatible = !_draft.VanillaCompatible; Refresh(); })).GetComponentInChildren<TMP_Text>(); _modOnly.Add((Selectable)(object)_z); _status = Text((Transform)(object)rectTransform2, "", 18f, 748f, 448f, 44f, 16); _save = Button((Transform)(object)rectTransform2, _placement ? RunicText.Get("text_7726ebd914f1") : RunicText.Get("text_7ce42330a8fc"), 18f, 800f, 218f, 34f, new UnityAction(Save)); string caption = RunicText.Get("text_19766ed6ccb2"); object obj = <>O.<0>__Close; if (obj == null) { UnityAction val4 = Close; <>O.<0>__Close = val4; obj = (object)val4; } Button((Transform)(object)rectTransform2, caption, 248f, 800f, 218f, 34f, (UnityAction)obj); } private void CaptureSelection() { if (Object.op_Implicit((Object)(object)_caption) && !_closing && !Object.op_Implicit((Object)(object)_colorPicker)) { int start = _start; int end = _end; _start = _caption.selectionStringAnchorPosition; _end = _caption.selectionStringFocusPosition; SignFormatting.Selection(_text, ref _start, ref _end); if (Object.op_Implicit((Object)(object)_target)) { _target.text = ((_start == _end) ? RunicText.Get("text_ad17cd50f8a8") : RunicText.Format("text_351e25982bab", _end - _start)); } if (start != _start || end != _end) { SyncStyleFields(); } } } private void Style(Action<TextStyle> selection) { try { SignFormatting.ApplyEditor(_draft, _text, _start, _end, selection); SyncStyleFields(); Refresh(); } catch (ArgumentException ex) { _status.text = ex.Message; } } private void CloseColors() { if (Object.op_Implicit((Object)(object)_colorPicker)) { _colorPicker.SetActive(false); Object.Destroy((Object)(object)_colorPicker); _colorPicker = null; _fields.interactable = !Saving; } } private void ShowColors() { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_0104: 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_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Expected O, but got Unknown //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Expected O, but got Unknown //IL_02b0: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)_colorPicker) || Saving) { return; } int start = _start; int end = _end; string caption = _text; Image val = Box(_canvas.transform, "NamedColorPicker", 0f, 0f, 0f, 0f, new Color(0f, 0f, 0f, 0.65f)); _colorPicker = ((Component)val).gameObject; ((Graphic)val).rectTransform.anchorMin = Vector2.zero; ((Graphic)val).rectTransform.anchorMax = Vector2.one; RectTransform rectTransform = ((Graphic)val).rectTransform; Vector2 offsetMin = (((Graphic)val).rectTransform.offsetMax = Vector2.zero); rectTransform.offsetMin = offsetMin; RectTransform rectTransform2 = ((Graphic)Box(((Component)val).transform, "Colors", 0f, 0f, 660f, 530f, new Color(0.07f, 0.085f, 0.09f))).rectTransform; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(0.5f, 0.5f); rectTransform2.pivot = val2; offsetMin = (rectTransform2.anchorMax = val2); rectTransform2.anchorMin = offsetMin; Text((Transform)(object)rectTransform2, RunicText.Get("text_46a8d1ebf257"), 20f, 14f, 500f, 34f, 25); Button((Transform)(object)rectTransform2, RunicText.Get("text_7d9eb7acb13e"), 546f, 16f, 94f, 30f, new UnityAction(CloseColors)); string text = caption.Substring(start, end - start).Replace("\n", " "); Text((Transform)(object)rectTransform2, (start == end) ? RunicText.Get("text_41e3fd80fa3d") : (RunicText.Get("text_3fa806630387") + text + "”"), 20f, 56f, 620f, 30f, 17); Color color = default(Color); for (int i = 0; i < LabelColors.Names.Length; i++) { int index = i; float x = 20 + i % 3 * 210; float y = 100 + i / 3 * 47; Button val4 = Button((Transform)(object)rectTransform2, "", x, y, 200f, 40f, (UnityAction)delegate { CloseColors(); if (_text != caption) { _status.text = RunicText.Get("text_022d7444f525"); } else { _start = start; _end = end; Style(delegate(TextStyle style) { style.Ink = LabelColors.Hex[index]; }); _inkField.SetTextWithoutNotify(LabelColors.Names[index]); _invalid.Remove(_inkField); _status.text = LabelColors.Names[index] + ((start == end) ? RunicText.Get("text_93d085f09127") : RunicText.Get("text_5d2783bbe912")); } }); ColorUtility.TryParseHtmlString(LabelColors.Hex[index], ref color); ((Graphic)Box(((Component)val4).transform, "Swatch", 9f, 8f, 24f, 24f, color)).raycastTarget = false; Text(((Component)val4).transform, LabelColors.Names[index], 43f, 0f, 150f, 40f, 18); } Text((Transform)(object)rectTransform2, RunicText.Get("text_8cbe2e50c200"), 20f, 489f, 620f, 25f, 16); _fields.interactable = false; ((Selectable)_save).interactable = false; } private void CloseEffects() { if (Object.op_Implicit((Object)(object)_effectsPicker)) { _invalid.Remove(_curveV); _invalid.Remove(_curveD); _effectsPicker.SetActive(false); Object.Destroy((Object)(object)_effectsPicker); _effectsPicker = null; _curveV = (_curveD = null); _fields.interactable = !Saving; Refresh(); } } private void ShowEffects() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Expected O, but got Unknown //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Expected O, but got Unknown //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Expected O, but got Unknown //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Expected O, but got Unknown TMP_Text outline; TMP_Text shadow; if (!Object.op_Implicit((Object)(object)_effectsPicker) && !Saving) { Image val = Box(_canvas.transform, "TextEffects", 0f, 0f, 0f, 0f, new Color(0f, 0f, 0f, 0.65f)); _effectsPicker = ((Component)val).gameObject; ((Graphic)val).rectTransform.anchorMin = Vector2.zero; ((Graphic)val).rectTransform.anchorMax = Vector2.one; RectTransform rectTransform = ((Graphic)val).rectTransform; Vector2 offsetMin = (((Graphic)val).rectTransform.offsetMax = Vector2.zero); rectTransform.offsetMin = offsetMin; RectTransform rectTransform2 = ((Graphic)Box(((Component)val).transform, "Effects", 0f, 0f, 660f, 410f, new Color(0.07f, 0.085f, 0.09f))).rectTransform; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(0.5f, 0.5f); rectTransform2.pivot = val2; offsetMin = (rectTransform2.anchorMax = val2); rectTransform2.anchorMin = offsetMin; Text((Transform)(object)rectTransform2, RunicText.Get("text_b6a04be45d40"), 20f, 14f, 490f, 34f, 25); Button((Transform)(object)rectTransform2, RunicText.Get("text_11a6767d5674"), 546f, 16f, 94f, 30f, new UnityAction(CloseEffects)); Text((Transform)(object)rectTransform2, RunicText.Get("text_5da37bd17aa1"), 20f, 56f, 620f, 30f, 17); outline = null; shadow = null; outline = ((Component)Button((Transform)(object)rectTransform2, "", 20f, 100f, 300f, 36f, (UnityAction)delegate { _draft.Effect ^= 1; Labels(); Refresh(); })).GetComponentInChildren<TMP_Text>(); shadow = ((Component)Button((Transform)(object)rectTransform2, "", 340f, 100f, 300f, 36f, (UnityAction)delegate { _draft.Effect ^= 2; Labels(); Refresh(); })).GetComponentInChildren<TMP_Text>(); Labels(); Text((Transform)(object)rectTransform2, RunicText.Get("text_9ff470f1393a"), 20f, 158f, 280f, 30f, 20); _curveV = CurveNumber((Transform)(object)rectTransform2, 158f, () => _draft.CurveVertical, delegate(float v) { _draft.CurveVertical = v; }); Text((Transform)(object)rectTransform2, RunicText.Get("text_f2639c60f10b"), 20f, 194f, 620f, 26f, 17); Text((Transform)(object)rectTransform2, RunicText.Get("text_c35dca4d4d30"), 20f, 238f, 370f, 30f, 20); _curveD = CurveNumber((Transform)(object)rectTransform2, 238f, () => _draft.CurveDepth, delegate(float v) { _draft.CurveDepth = v; }); Text((Transform)(object)rectTransform2, RunicText.Get("text_0432312ecc2d"), 20f, 274f, 620f, 26f, 17); Text((Transform)(object)rectTransform2, RunicText.Get("text_f79f5f759f39"), 20f, 310f, 620f, 26f, 17); Button((Transform)(object)rectTransform2, RunicText.Get("text_844efb5d0703"), 20f, 356f, 620f, 34f, (UnityAction)delegate { _draft.Effect = 0; _draft.CurveVertical = (_draft.CurveDepth = 0f); _curveV.SetTextWithoutNotify("0"); _curveD.SetTextWithoutNotify("0"); _invalid.Remove(_curveV); _invalid.Remove(_curveD); Labels(); Refresh(); }); _fields.interactable = false; ((Selectable)_save).interactable = false; } void Labels() { outline.text = RunicText.Get("text_43d3183fc46b") + (((_draft.Effect & 1) != 0) ? RunicText.Get("text_130011756125") : RunicText.Get("text_ca7981b46ecf")); shadow.text = RunicText.Get("text_febfba761071") + (((_draft.Effect & 2) != 0) ? RunicText.Get("text_130011756125") : RunicText.Get("text_ca7981b46ecf")); } } private TMP_InputField CurveNumber(Transform panel, float y, Func<float> read, Action<float> write) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown TMP_InputField field = Number(panel, CaptionCurve.ToDisplay(read()), 455f, y, 140f, -100f, 100f, delegate(float value) { write(CaptionCurve.FromDisplay(value)); Refresh(); }); Button(panel, "−", 410f, y, 38f, 30f, (UnityAction)delegate { Nudge(-1); }); Button(panel, "+", 602f, y, 38f, 30f, (UnityAction)delegate { Nudge(1); }); return field; void Nudge(int direction) { write(CaptionCurve.Step(read(), direction)); field.SetTextWithoutNotify(F(CaptionCurve.ToDisplay(read()))); _invalid.Remove(field); Refresh(); } } private void SyncStyleFields() { TextStyle textStyle = ((_start == _end) ? null : _draft.Runs.Find((StyleRun r) => r.Start <= _start && r.Start + r.Length > _start)?.Style); string text = ((textStyle != null && textStyle.Ink != "") ? textStyle.Ink : ((_draft.Ink != "") ? _draft.Ink : LabelColors.Hex[_draft.Color])); SetField(_sizeField, F((_start == _end) ? _draft.TextSize : ((textStyle != null && textStyle.Size != 0f) ? textStyle.Size : 1f))); SetField(_inkField, text); SetField(_opacityField, F((float)Convert.ToInt32(text.Substring(7, 2), 16) / 2.55f)); } private void SetField(TMP_InputField field, string value) { if (Object.op_Implicit((Object)(object)field) && !field.isFocused) { field.SetTextWithoutNotify(value); _invalid.Remove(field); } } private void Resize(float delta) { _draft.Scale = Mathf.Clamp(_draft.Scale + delta, 0.25f, 4f); Refresh(); } private void Move(int x, int y, int z = 0) { float num = ((_draft.OffsetUnit != 0) ? ((float)((!_coarse) ? 1 : 25)) : (_coarse ? 1f : 0.05f)); _draft.Horizontal = Mathf.Clamp(_draft.Horizontal + (float)x * num, 0f - _draft.OffsetLimit, _draft.OffsetLimit); _draft.Vertical = Mathf.Clamp(_draft.Vertical + (float)y * num, 0f - _draft.OffsetLimit, _draft.OffsetLimit); _draft.Depth = Mathf.Clamp(_draft.Depth + (float)z * num, 0f - _draft.OffsetLimit, _draft.OffsetLimit); UpdateOffsets(); Refresh(); } private void ChangeUnits() { //IL_0011: 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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing refe