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 QuickChat v1.0.2
QuickChat.dll
Decompiled 34 minutes agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("Autodesk.Fbx")] [assembly: IgnoresAccessChecksTo("Discord.Sdk")] [assembly: IgnoresAccessChecksTo("Domain_Reload")] [assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")] [assembly: IgnoresAccessChecksTo("FbxBuildTestAssets")] [assembly: IgnoresAccessChecksTo("Klattersynth")] [assembly: IgnoresAccessChecksTo("Photon3Unity3D")] [assembly: IgnoresAccessChecksTo("PhotonChat")] [assembly: IgnoresAccessChecksTo("PhotonRealtime")] [assembly: IgnoresAccessChecksTo("PhotonUnityNetworking")] [assembly: IgnoresAccessChecksTo("PhotonUnityNetworking.Utilities")] [assembly: IgnoresAccessChecksTo("PhotonVoice.API")] [assembly: IgnoresAccessChecksTo("PhotonVoice")] [assembly: IgnoresAccessChecksTo("PhotonVoice.PUN")] [assembly: IgnoresAccessChecksTo("SingularityGroup.HotReload.Runtime.Public")] [assembly: IgnoresAccessChecksTo("Sirenix.OdinInspector.Attributes")] [assembly: IgnoresAccessChecksTo("Sirenix.OdinInspector.Modules.Unity.Addressables")] [assembly: IgnoresAccessChecksTo("Sirenix.OdinInspector.Modules.UnityLocalization")] [assembly: IgnoresAccessChecksTo("Sirenix.Serialization.Config")] [assembly: IgnoresAccessChecksTo("Sirenix.Serialization")] [assembly: IgnoresAccessChecksTo("Sirenix.Utilities")] [assembly: IgnoresAccessChecksTo("Unity.Addressables")] [assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")] [assembly: IgnoresAccessChecksTo("Unity.Burst")] [assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")] [assembly: IgnoresAccessChecksTo("Unity.Collections")] [assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")] [assembly: IgnoresAccessChecksTo("Unity.Formats.Fbx.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")] [assembly: IgnoresAccessChecksTo("Unity.InternalAPIEngineBridge.013")] [assembly: IgnoresAccessChecksTo("Unity.Localization")] [assembly: IgnoresAccessChecksTo("Unity.Mathematics")] [assembly: IgnoresAccessChecksTo("Unity.MemoryProfiler")] [assembly: IgnoresAccessChecksTo("Unity.Postprocessing.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")] [assembly: IgnoresAccessChecksTo("Unity.ResourceManager")] [assembly: IgnoresAccessChecksTo("Unity.ScriptableBuildPipeline")] [assembly: IgnoresAccessChecksTo("Unity.Splines")] [assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")] [assembly: IgnoresAccessChecksTo("Unity.Timeline")] [assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Antlr3.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Core")] [assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Flow")] [assembly: IgnoresAccessChecksTo("Unity.VisualScripting.State")] [assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: IgnoresAccessChecksTo("websocket-sharp")] [assembly: AssemblyCompany("Exypson")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("This mod introduces a quality of life communication feature for R.E.P.O by adding a quick chat wheel.")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+f8e6b8415f7d4d87dcf7bad2061c8868beabb575")] [assembly: AssemblyProduct("QuickChat")] [assembly: AssemblyTitle("QuickChat")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace QuickChat { [HarmonyPatch] public class QuickChatPatches { [HarmonyPatch(typeof(ChatManager), "Awake")] [HarmonyPostfix] public static void ChatManagerAwakePostfix(ChatManager __instance) { if ((Object)(object)((Component)__instance).gameObject.GetComponent<QuickChatWheel>() == (Object)null) { ((Component)__instance).gameObject.AddComponent<QuickChatWheel>(); QuickChatPlugin.Log.LogInfo((object)"[Harmony] Successfully attached QuickChatWheel to ChatManager!"); } } [HarmonyPatch(typeof(ChatManager), "Update")] [HarmonyPrefix] public static bool ChatManagerUpdatePrefix() { if ((Object)(object)MenuManager.instance != (Object)null && MenuManager.instance.textInputActive) { return false; } return true; } } [BepInPlugin("com.exypson.quickchat", "QuickChat", "1.0.0")] public class QuickChatPlugin : BaseUnityPlugin { public static ConfigEntry<string> ConfigTop; public static ConfigEntry<string> ConfigTopRight; public static ConfigEntry<string> ConfigRight; public static ConfigEntry<string> ConfigBottomRight; public static ConfigEntry<string> ConfigBottom; public static ConfigEntry<string> ConfigBottomLeft; public static ConfigEntry<string> ConfigLeft; public static ConfigEntry<string> ConfigTopLeft; internal static ManualLogSource Log { get; private set; } private void Awake() { Log = ((BaseUnityPlugin)this).Logger; ConfigTop = ((BaseUnityPlugin)this).Config.Bind<string>("Chat Wheel Presets", "1. Top", "Yes", "Text for the Top slice."); ConfigTopRight = ((BaseUnityPlugin)this).Config.Bind<string>("Chat Wheel Presets", "2. Top Right", "Help", "Text for the Top-Right slice."); ConfigRight = ((BaseUnityPlugin)this).Config.Bind<string>("Chat Wheel Presets", "3. Right", "Run", "Text for the Right slice."); ConfigBottomRight = ((BaseUnityPlugin)this).Config.Bind<string>("Chat Wheel Presets", "4. Bottom Right", "Thanks", "Text for the Bottom-Right slice."); ConfigBottom = ((BaseUnityPlugin)this).Config.Bind<string>("Chat Wheel Presets", "5. Bottom", "No", "Text for the Bottom slice."); ConfigBottomLeft = ((BaseUnityPlugin)this).Config.Bind<string>("Chat Wheel Presets", "6. Bottom Left", "Hide", "Text for the Bottom-Left slice."); ConfigLeft = ((BaseUnityPlugin)this).Config.Bind<string>("Chat Wheel Presets", "7. Left", "Stop", "Text for the Left slice."); ConfigTopLeft = ((BaseUnityPlugin)this).Config.Bind<string>("Chat Wheel Presets", "8. Top Left", "Follow Me", "Text for the Top-Left slice."); Harmony.CreateAndPatchAll(typeof(QuickChatPatches), (string)null); Log.LogInfo((object)"QuickChat mod loaded! Harmony patches applied successfully."); } } public class QuickChatWheel : MonoBehaviour { private bool isWheelActive = false; private int selectedIndex = -1; private MethodInfo chatResetMethod; private Texture2D bgTexture; private Texture2D highlightTexture; private readonly float bgSize = 450f; private readonly float textRadius = 140f; private void Start() { BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; chatResetMethod = typeof(ChatManager).GetMethod("ChatReset", bindingAttr); if (chatResetMethod == null) { QuickChatPlugin.Log.LogError((object)"[QuickChatWheel] Could not find ChatReset method!"); } GenerateTextures(); } private void GenerateTextures() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0270: 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) int num = 256; int num2 = num * 2; bgTexture = new Texture2D(num2, num2, (TextureFormat)5, false); highlightTexture = new Texture2D(num2, num2, (TextureFormat)5, false); Color clear = Color.clear; Color val = default(Color); ((Color)(ref val))..ctor(1f, 1f, 1f, 0.8f); for (int i = 0; i < num2; i++) { for (int j = 0; j < num2; j++) { float num3 = j - num; float num4 = i - num; float num5 = Mathf.Sqrt(num3 * num3 + num4 * num4); if (num5 < (float)num) { float num6 = Mathf.Atan2(num3, num4) * 57.29578f; if (num6 < 0f) { num6 += 360f; } bool flag = false; if (num5 > 35f && num5 < 40f) { flag = true; } if (num5 > 44f && num5 < 46f) { flag = true; } float num7 = (num6 - 22.5f) % 45f; if (num7 < 0f) { num7 += 45f; } float num8 = Mathf.Min(num7, 45f - num7); float num9 = num8 * (MathF.PI / 180f) * num5; if (num5 > 50f && num9 < 1f) { flag = true; } if (flag) { bgTexture.SetPixel(j, i, val); } else { bgTexture.SetPixel(j, i, clear); } float num10 = num6; if (num10 > 180f) { num10 -= 360f; } float num11 = (num6 - 22.5f) % 45f; if (num11 < 0f) { num11 += 45f; } float num12 = Mathf.Min(num11, 45f - num11); float num13 = num12 * (MathF.PI / 180f) * num5; if (num5 < (float)num - 3f && num5 > 50f && num10 > -22.5f && num10 < 22.5f && num13 >= 1f) { float num14 = 0.25f * (1f - num5 / (float)num); highlightTexture.SetPixel(j, i, new Color(1f, 1f, 1f, num14)); } else { highlightTexture.SetPixel(j, i, clear); } } else { bgTexture.SetPixel(j, i, clear); highlightTexture.SetPixel(j, i, clear); } } } bgTexture.Apply(); highlightTexture.Apply(); } private void Update() { try { if ((Object)(object)ChatManager.instance == (Object)null) { return; } bool flag = ChatManager.instance.chatActive; if ((Object)(object)MenuManager.instance != (Object)null) { flag = flag || MenuManager.instance.textInputActive; } bool flag2 = false; if (Keyboard.current != null) { flag2 = ((ButtonControl)Keyboard.current.vKey).isPressed; } if (flag2 && !flag) { if (!isWheelActive) { isWheelActive = true; Cursor.lockState = (CursorLockMode)0; Cursor.visible = false; } } else if (isWheelActive) { isWheelActive = false; Cursor.lockState = (CursorLockMode)1; Cursor.visible = false; if (selectedIndex != -1 && !flag) { SendQuickChat(selectedIndex); } } } catch (Exception arg) { QuickChatPlugin.Log.LogError((object)$"[QuickChatWheel] Error in Update: {arg}"); } } private void OnGUI() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) if (!isWheelActive) { return; } Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor((float)Screen.width / 2f, (float)Screen.height / 2f); Vector2 mousePosition = Event.current.mousePosition; float num = Vector2.Distance(val, mousePosition); float num2 = 0.13671875f * (bgSize / 2f); if (num < num2) { selectedIndex = -1; } else { Vector2 val2 = mousePosition - val; float num3 = Mathf.Atan2(val2.y, val2.x) * 57.29578f; num3 += 90f; if (num3 < 0f) { num3 += 360f; } selectedIndex = Mathf.FloorToInt((num3 + 22.5f) / 45f) % 8; } DrawWheel(val); } private void DrawWheel(Vector2 center) { //IL_0003: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Expected O, but got Unknown //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Expected O, but got Unknown //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) Rect val = default(Rect); ((Rect)(ref val))..ctor(center.x - bgSize / 2f, center.y - bgSize / 2f, bgSize, bgSize); if ((Object)(object)bgTexture != (Object)null) { GUI.DrawTexture(val, (Texture)(object)bgTexture); } if (selectedIndex != -1 && (Object)(object)highlightTexture != (Object)null) { Matrix4x4 matrix = GUI.matrix; float num = (float)selectedIndex * 45f; GUIUtility.RotateAroundPivot(num, center); GUI.DrawTexture(val, (Texture)(object)highlightTexture); GUI.matrix = matrix; } string[] array = new string[8] { QuickChatPlugin.ConfigTop.Value, QuickChatPlugin.ConfigTopRight.Value, QuickChatPlugin.ConfigRight.Value, QuickChatPlugin.ConfigBottomRight.Value, QuickChatPlugin.ConfigBottom.Value, QuickChatPlugin.ConfigBottomLeft.Value, QuickChatPlugin.ConfigLeft.Value, QuickChatPlugin.ConfigTopLeft.Value }; GUIStyle val2 = new GUIStyle(GUI.skin.label); val2.alignment = (TextAnchor)4; val2.fontStyle = (FontStyle)1; val2.fontSize = 17; val2.normal.textColor = new Color(0.9f, 0.9f, 0.9f, 1f); GUIStyle val3 = new GUIStyle(val2); val3.normal.textColor = Color.white; val3.fontSize = 19; Rect val6 = default(Rect); for (int i = 0; i < 8; i++) { float num2 = -90f + (float)i * 45f; float num3 = num2 * (MathF.PI / 180f); GUIStyle val4 = ((i == selectedIndex) ? val3 : val2); Vector2 val5 = val4.CalcSize(new GUIContent(array[i])); float num4 = val5.x + 20f; float num5 = val5.y + 10f; float num6 = center.x + Mathf.Cos(num3) * textRadius - num4 / 2f; float num7 = center.y + Mathf.Sin(num3) * textRadius - num5 / 2f; ((Rect)(ref val6))..ctor(num6, num7, num4, num5); GUI.Label(val6, array[i], val4); } } private void SendQuickChat(int index) { string text = ""; switch (index) { case 0: text = QuickChatPlugin.ConfigTop.Value; break; case 1: text = QuickChatPlugin.ConfigTopRight.Value; break; case 2: text = QuickChatPlugin.ConfigRight.Value; break; case 3: text = QuickChatPlugin.ConfigBottomRight.Value; break; case 4: text = QuickChatPlugin.ConfigBottom.Value; break; case 5: text = QuickChatPlugin.ConfigBottomLeft.Value; break; case 6: text = QuickChatPlugin.ConfigLeft.Value; break; case 7: text = QuickChatPlugin.ConfigTopLeft.Value; break; } if (!string.IsNullOrEmpty(text)) { chatResetMethod?.Invoke(ChatManager.instance, null); string text2 = text; foreach (char c in text2) { ChatManager.instance.AddLetterToChat(c.ToString()); } ChatManager.instance.ForceConfirmChat(); } } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }