using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Cryptography;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GUIFramework;
using HarmonyLib;
using JetBrains.Annotations;
using Microsoft.CodeAnalysis;
using Newtonsoft.Json;
using ServerSync;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.UI;
[assembly: AssemblyFileVersion("3.0.0")]
[assembly: Guid("4358610B-F3F4-4843-B7AF-98B7BC60DCDE")]
[assembly: ComVisible(false)]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyProduct("RpChatter")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyTitle("RpChatter")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: CompilationRelaxations(8)]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyCompany("Arielle")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("3.0.0.0")]
[module: <a74e3992-e682-4f61-a4c3-7f60ae42738e>RefSafetyRules(11)]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[<ceb68210-b7b4-42bf-aea1-0c220e946ca4>Embedded]
internal sealed class <ceb68210-b7b4-42bf-aea1-0c220e946ca4>EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[<ceb68210-b7b4-42bf-aea1-0c220e946ca4>Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
[CompilerGenerated]
internal sealed class <30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public <30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public <30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
[<ceb68210-b7b4-42bf-aea1-0c220e946ca4>Embedded]
[CompilerGenerated]
internal sealed class <235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContextAttribute : Attribute
{
public readonly byte Flag;
public <235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
[<ceb68210-b7b4-42bf-aea1-0c220e946ca4>Embedded]
[CompilerGenerated]
internal sealed class <a74e3992-e682-4f61-a4c3-7f60ae42738e>RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public <a74e3992-e682-4f61-a4c3-7f60ae42738e>RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace RpChatter
{
[Serializable]
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
public class DbLog
{
public string p { get; set; }
public string i { get; set; }
public string a { get; set; }
public string c { get; set; }
public string r { get; set; }
}
[Serializable]
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
public class DbPlayer
{
public string player { get; set; }
}
internal class Api
{
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
public static IEnumerator LogInsert(string json)
{
UnityWebRequest request = new UnityWebRequest("http://localhost:3333/db/log/insert", "POST");
try
{
byte[] bytes = Encoding.UTF8.GetBytes(json);
request.uploadHandler = (UploadHandler)new UploadHandlerRaw(bytes);
request.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();
request.SetRequestHeader("Content-Type", "application/json");
yield return request.SendWebRequest();
}
finally
{
((IDisposable)request)?.Dispose();
}
}
}
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
public static class PluginConfig
{
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(0)]
[HarmonyPatch(typeof(FejdStartup))]
private static class FejdStartupPatch
{
[HarmonyPatch("Awake")]
[HarmonyPostfix]
private static void AwakePostfix()
{
while (_fejdStartupBindConfigQueue.Count > 0)
{
_fejdStartupBindConfigQueue.Dequeue()?.Invoke(Config);
}
}
}
public static readonly ConfigSync ConfigSync = new ConfigSync("RpChatter")
{
DisplayName = "RpChatter",
CurrentVersion = "3.0.0",
MinimumRequiredVersion = "3.0.0"
};
private static readonly Queue<Action<ConfigFile>> _fejdStartupBindConfigQueue = new Queue<Action<ConfigFile>>();
public static ConfigFile Config { get; private set; }
public static ConfigEntry<bool> IsModEnabled { get; private set; }
public static ConfigEntry<float> ShoutDistance { get; private set; }
public static ConfigEntry<float> SayDistance { get; private set; }
public static ConfigEntry<float> WhisperDistance { get; private set; }
public static ConfigEntry<Vector2> ChatPanelPosition { get; private set; }
public static ConfigEntry<Vector2> ChatPanelSizeDelta { get; private set; }
public static ConfigEntry<Color> ChatPanelBackgroundColor { get; private set; }
public static ConfigEntry<int> HideChatPanelDelay { get; private set; }
public static ConfigEntry<float> HideChatPanelAlpha { get; private set; }
public static ConfigEntry<KeyboardShortcut> ScrollContentUpShortcut { get; private set; }
public static ConfigEntry<KeyboardShortcut> ScrollContentDownShortcut { get; private set; }
public static ConfigEntry<float> ScrollContentOffsetInterval { get; private set; }
public static ConfigEntry<bool> ShowMessageHudCenterMessages { get; private set; }
public static ConfigEntry<bool> ShowChatPanelMessageDividers { get; private set; }
public static ConfigEntry<float> ChatPanelContentSingleRowSpacing { get; private set; }
public static ConfigEntry<Type> ChatPanelDefaultMessageTypeToUse { get; private set; }
public static ConfigEntry<ChatMessageType> ChatPanelContentRowTogglesToEnable { get; private set; }
public static ConfigEntry<bool> ChatMessageShowTimestamp { get; private set; }
public static ConfigEntry<Color> ChatMessageTextDefaultColor { get; private set; }
public static ConfigEntry<Color> ChatMessageTextSayColor { get; private set; }
public static ConfigEntry<Color> ChatMessageTextShoutColor { get; private set; }
public static ConfigEntry<Color> ChatMessageTextWhisperColor { get; private set; }
public static ConfigEntry<Color> ChatMessageTextEmoteColor { get; private set; }
public static ConfigEntry<Color> ChatMessageTextGestureColor { get; private set; }
public static ConfigEntry<Color> ChatMessageTextGameColor { get; private set; }
public static ConfigEntry<Color> ChatMessageTextPingColor { get; private set; }
public static ConfigEntry<Color> ChatMessageTextMessageHudColor { get; private set; }
public static ConfigEntry<Color> ChatMessageUsernameColor { get; private set; }
public static ConfigEntry<Color> ChatMessageTimestampColor { get; private set; }
public static ConfigEntry<string> ChatMessageUsernamePrefix { get; private set; }
public static ConfigEntry<string> ChatMessageUsernamePostfix { get; private set; }
public static StringListConfigEntry SayTextFilterList { get; private set; }
public static StringListConfigEntry ShoutTextFilterList { get; private set; }
public static StringListConfigEntry WhisperTextFilterList { get; private set; }
public static StringListConfigEntry EmoteTextFilterList { get; private set; }
public static StringListConfigEntry GameTextFilterList { get; private set; }
public static StringListConfigEntry HudCenterTextFilterList { get; private set; }
public static StringListConfigEntry OtherTextFilterList { get; private set; }
public static ConfigEntry<bool> FilterInWorldShoutText { get; private set; }
public static ConfigEntry<string> ChatMessageFontAsset { get; private set; }
public static ConfigEntry<float> ChatMessageFontSize { get; private set; }
public static void BindConfig(ConfigFile config)
{
//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
//IL_0122: Unknown result type (might be due to invalid IL or missing references)
//IL_0184: Unknown result type (might be due to invalid IL or missing references)
//IL_023a: Unknown result type (might be due to invalid IL or missing references)
//IL_0269: Unknown result type (might be due to invalid IL or missing references)
//IL_0421: Unknown result type (might be due to invalid IL or missing references)
//IL_0483: Unknown result type (might be due to invalid IL or missing references)
//IL_04d1: Unknown result type (might be due to invalid IL or missing references)
//IL_0533: Unknown result type (might be due to invalid IL or missing references)
//IL_0595: Unknown result type (might be due to invalid IL or missing references)
//IL_05f7: Unknown result type (might be due to invalid IL or missing references)
//IL_0659: Unknown result type (might be due to invalid IL or missing references)
//IL_06a7: Unknown result type (might be due to invalid IL or missing references)
//IL_0709: Unknown result type (might be due to invalid IL or missing references)
//IL_076b: Unknown result type (might be due to invalid IL or missing references)
//IL_07c9: Unknown result type (might be due to invalid IL or missing references)
//IL_07ce: Unknown result type (might be due to invalid IL or missing references)
Config = config;
IsModEnabled = config.Bind<bool>("_Global", "isModEnabled", true, "Globally enable or disable this mod.");
IsModEnabled.OnSettingChanged<bool>(ChatPanelController.ToggleChatter);
ShoutDistance = config.BindInOrder("ChatDistance", "Shout", 150f, "The distance you can hear a shout. [Server Sync]");
SayDistance = config.BindInOrder("ChatDistance", "Say", 25f, "The distance you can hear normal talking. [Server Sync]");
WhisperDistance = config.BindInOrder("ChatDistance", "Whisper", 5f, "The distance you can hear a whisper. [Server Sync]");
ChatPanelPosition = config.BindInOrder<Vector2>("ChatPanel", "chatPanelPosition", new Vector2(-10f, 125f), "The Vector2 position of the ChatPanel.");
ChatPanelPosition.OnSettingChanged(delegate(Vector2 position)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
ChatPanelController.ChatPanel?.PanelRectTransform.SetPosition(position);
});
ChatPanelSizeDelta = config.BindInOrder<Vector2>("ChatPanel", "chatPanelSizeDelta", new Vector2(500f, 500f), "The size (width, height) of the ChatPanel.");
ChatPanelSizeDelta.OnSettingChanged(delegate(Vector2 sizeDelta)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
ChatPanelController.ChatPanel?.PanelRectTransform.SetSizeDelta(sizeDelta);
});
ChatPanelBackgroundColor = config.BindInOrder<Color>("ChatPanel", "chatPanelBackgroundColor", new Color(0f, 0f, 0f, 0.125f), "The background color for the ChatPanel.");
ChatPanelBackgroundColor.OnSettingChanged(delegate(Color color)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
ChatPanel chatPanel = ChatPanelController.ChatPanel;
if (chatPanel != null)
{
ImageExtensions.SetColor<Image>(chatPanel.PanelBackground, color);
}
});
HideChatPanelDelay = config.BindInOrder("ChatPanel.Behaviour", "hideChatPanelDelay", 5, "Delay (in seconds) before hiding the ChatPanel.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 180));
HideChatPanelAlpha = config.BindInOrder("ChatPanel.Behaviour", "hideChatPanelAlpha", 0f, "Color alpha (in %) for the ChatPanel when hidden.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f));
ScrollContentUpShortcut = config.BindInOrder<KeyboardShortcut>("ChatPanel.Scrolling", "scrollContentUpShortcut", new KeyboardShortcut((KeyCode)280, Array.Empty<KeyCode>()), "Keyboard shortcut to scroll the ChatPanel content up.");
ScrollContentDownShortcut = config.BindInOrder<KeyboardShortcut>("ChatPanel.Scrolling", "scrollContentDownShortcut", new KeyboardShortcut((KeyCode)281, Array.Empty<KeyCode>()), "Keyboard shortcut to scroll the ChatPanel content down.");
ScrollContentOffsetInterval = config.BindInOrder("ChatPanel.Scrolling", "scrollContentOffsetInterval", 200f, "Interval (in pixels) to scroll the ChatPanel content up/down.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-1000f, 1000f));
ShowMessageHudCenterMessages = config.BindInOrder("ChatPanel.Content", "showMessageHudCenterMessages", defaultValue: true, "Show messages from the MessageHud that display in the top-center (usually boss messages).");
ShowChatPanelMessageDividers = config.BindInOrder("ChatPanel.Content", "showChatPanelMessageDividers", defaultValue: true, "Show the horizontal dividers between groups of messages.");
ShowChatPanelMessageDividers.OnSettingChanged<bool>(ContentRowManager.ToggleMessageDividers);
ChatPanelContentSingleRowSpacing = config.BindInOrder("ChatPanel.Spacing", "chatPanelContentSingleRowSpacing", 10f, "Spacing (in pixels) to use between rows when using 'SingleRow' layout.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-100f, 100f));
ChatPanelContentSingleRowSpacing.OnSettingChanged<float>((Action)delegate
{
ChatPanelController.ChatPanel?.SetContentSpacing();
});
ChatPanelDefaultMessageTypeToUse = config.BindInOrder<Type>("ChatPanel.Defaults", "chatPanelDefaultMessageTypeToUse", (Type)1, "ChatPanel input default message type to use on game start. Ping value is ignored.");
ChatPanelContentRowTogglesToEnable = config.BindInOrder("ChatPanel.Defaults", "chatPanelContentRowTogglesToEnable", ChatMessageType.Game | ChatMessageType.HudCenter | ChatMessageType.Shout, "ChatPanel content row toggles to enable on game start.");
ChatMessageShowTimestamp = config.BindInOrder("ChatMessage.Layout", "chatMessageShowTimestamp", defaultValue: false, "Show a timestamp for each group of chat messages (except system/default).");
ChatMessageShowTimestamp.OnSettingChanged<bool>(ContentRowManager.ToggleShowTimestamp);
ChatMessageTextDefaultColor = config.BindInOrder<Color>("ChatMessage.Text.Colors", "chatMessageTextDefaultColor", new Color(0.596f, 0.592f, 0.286f, 1f), "Color for default/system chat messages.");
ChatMessageTextDefaultColor.OnSettingChanged(delegate(Color color)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
ContentRowManager.SetMessageTextColor(color, ChatMessageType.Text);
});
ChatMessageTextSayColor = config.BindInOrder<Color>("ChatMessage.Text.Colors", "chatMessageTextSayColor", new Color(0.596f, 0.592f, 0.286f, 1f), "Color for 'normal/say' chat messages.");
ChatMessageTextSayColor.OnSettingChanged(delegate(Color color)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
ContentRowManager.SetMessageTextColor(color, ChatMessageType.Say);
});
ChatMessageTextShoutColor = config.BindInOrder<Color>("ChatMessage.Text.Colors", "chatMessageTextShoutColor", Color.yellow, "Color for 'shouting' chat messages.");
ChatMessageTextShoutColor.OnSettingChanged(delegate(Color color)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
ContentRowManager.SetMessageTextColor(color, ChatMessageType.Shout);
});
ChatMessageTextWhisperColor = config.BindInOrder<Color>("ChatMessage.Text.Colors", "chatMessageTextWhisperColor", new Color(0.6f, 0.65f, 0.75f, 1f), "Color for 'whisper' chat messages.");
ChatMessageTextWhisperColor.OnSettingChanged(delegate(Color color)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
ContentRowManager.SetMessageTextColor(color, ChatMessageType.Whisper);
});
ChatMessageTextEmoteColor = config.BindInOrder<Color>("ChatMessage.Text.Colors", "chatMessageTextMeColor", new Color(0.596f, 0.592f, 0.286f, 1f), "Color for 'emote' chat messages like /me.");
ChatMessageTextEmoteColor.OnSettingChanged(delegate(Color color)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
ContentRowManager.SetMessageTextColor(color, ChatMessageType.Emote);
});
ChatMessageTextGestureColor = config.BindInOrder<Color>("ChatMessage.Text.Colors", "chatMessageTextGesColor", new Color(0.52f, 0.52f, 0.48f, 1f), "Color for 'emote' chat messages like /ges.");
ChatMessageTextGestureColor.OnSettingChanged(delegate(Color color)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
ContentRowManager.SetMessageTextColor(color, ChatMessageType.Gesture);
});
ChatMessageTextGameColor = config.BindInOrder<Color>("ChatMessage.Text.Colors", "chatMessageTextGameColor", new Color(0.882f, 0.678f, 0.129f, 1f), "Color for 'game' chat messages like /roll.");
ChatMessageTextGameColor.OnSettingChanged(delegate(Color color)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
ContentRowManager.SetMessageTextColor(color, ChatMessageType.Game);
});
ChatMessageTextPingColor = config.BindInOrder<Color>("ChatMessage.Text.Colors", "chatMessageTextPingColor", Color.cyan, "Color for 'ping' chat messages.");
ChatMessageTextPingColor.OnSettingChanged(delegate(Color color)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
ContentRowManager.SetMessageTextColor(color, ChatMessageType.Ping);
});
ChatMessageTextMessageHudColor = config.BindInOrder<Color>("ChatMessage.Text.Colors", "chatMessageTextMessageHudColor", new Color(0.6f, 0.6f, 0.6f, 1f), "Color for 'MessageHud' chat messages.");
ChatMessageTextMessageHudColor.OnSettingChanged(delegate(Color color)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
ContentRowManager.SetMessageTextColor(color, ChatMessageType.HudCenter);
});
ChatMessageUsernameColor = config.BindInOrder<Color>("ChatMessage.Text.Colors", "chatMessageUsernameColor", new Color(0.839f, 0.345f, 0.016f, 1f), "Color for the username shown in chat messages.");
ChatMessageUsernameColor.OnSettingChanged((Action<Color>)ContentRowManager.SetUsernameTextColor);
ChatMessageTimestampColor = config.BindInOrder<Color>("ChatMessage.Text.Colors", "chatMessageTimestampColor", Color32.op_Implicit(new Color32((byte)244, (byte)246, (byte)247, byte.MaxValue)), "Color for any timestamp shown in the chat messages.");
ChatMessageTimestampColor.OnSettingChanged((Action<Color>)ContentRowManager.SetTimestampTextColor);
if (ConfigSync != null)
{
ConfigSync.AddConfigEntry<float>(ShoutDistance);
ConfigSync.AddConfigEntry<float>(SayDistance);
ConfigSync.AddConfigEntry<float>(WhisperDistance);
}
BindFilters(config);
LateBindConfig(BindChatMessageFontConfig);
}
private static void BindFilters(ConfigFile config)
{
SayTextFilterList = config.BindInOrder("Filters", "sayTextFilterList", "Filter list for Say message texts.", "\t");
ShoutTextFilterList = config.BindInOrder("Filters", "shoutTextFilterList", "Filter list for Shout message texts.", "\t");
FilterInWorldShoutText = config.BindInOrder("Filters", "filterInWorldShoutText", defaultValue: false, "If true, will also filter in-world Shout message texts.");
WhisperTextFilterList = config.BindInOrder("Filters", "whisperTextFilterList", "Filter list for Whipser message texts.", "\t");
EmoteTextFilterList = config.BindInOrder("Filters", "emoteTextFilterList", "Filter list for Emote message texts.", "\t");
GameTextFilterList = config.BindInOrder("Filters", "gameTextFilterList", "Filter list for Game message texts.", "\t");
HudCenterTextFilterList = config.BindInOrder("Filters", "messageHudTextFilterList", "Filter list for MessageHud.Center message texts.", "\t");
OtherTextFilterList = config.BindInOrder("Filters", "otherHudTextFilterList", "Filter list for all other message texts.", "\t");
}
public static void BindChatMessageFontConfig(ConfigFile config)
{
string[] array = (from f in Resources.FindObjectsOfTypeAll<TMP_FontAsset>()
select ((Object)f).name into f
orderby f
select f).Distinct().ToArray();
ChatMessageFontAsset = config.BindInOrder("ChatMessage.Text.Font", "chatMessageTextFontAsset", "Valheim-AveriaSansLibre", "FontAsset (TMP) to use for ChatMessage text.", (AcceptableValueBase)(object)new AcceptableValueList<string>(array));
ChatMessageFontAsset.OnSettingChanged([<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(0)] (string fontName) =>
{
ChatPanelController.ChatPanel?.SetContentFontAsset(UIFonts.GetFontAssetByName(fontName));
});
ChatMessageFontSize = config.BindInOrder("ChatMessage.Text.Font", "chatMessageTextFontSize", 16f, "The font size to use for chat messages.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(6f, 64f));
ChatMessageFontSize.OnSettingChanged(delegate(float fontSize)
{
ChatPanelController.ChatPanel?.SetContentFontSize(fontSize);
});
}
public static void LateBindConfig(Action<ConfigFile> lateBindConfigAction)
{
_fejdStartupBindConfigQueue.Enqueue(lateBindConfigAction);
}
}
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
public sealed class StringListConfigEntry
{
private readonly List<string> _valuesCache = new List<string>();
private string _lastFocusedControl;
private string _editingValue;
private static readonly Lazy<GUIStyle> _richTextLabelStyle = new Lazy<GUIStyle>((Func<GUIStyle>)(() => new GUIStyle(GUI.skin.label)
{
richText = true
}));
private static readonly Lazy<GUIStyle> _labelStyle = new Lazy<GUIStyle>((Func<GUIStyle>)(() => new GUIStyle(GUI.skin.label)
{
padding = new RectOffset(5, 5, 5, 5)
}));
private static readonly Lazy<GUIStyle> _horizontalStyle = new Lazy<GUIStyle>((Func<GUIStyle>)(() => new GUIStyle
{
padding = new RectOffset(10, 10, 0, 0)
}));
private static readonly Lazy<GUIStyle> _buttonStyle = new Lazy<GUIStyle>((Func<GUIStyle>)(() => new GUIStyle(GUI.skin.button)
{
padding = new RectOffset(10, 10, 5, 5)
}));
private static readonly Lazy<GUIStyle> _textFieldStyle = new Lazy<GUIStyle>((Func<GUIStyle>)(() => new GUIStyle(GUI.skin.textField)
{
padding = new RectOffset(5, 5, 5, 5),
wordWrap = false
}));
public ConfigEntry<string> ConfigEntry { get; }
public string[] ValuesSeparator { get; }
public List<string> Values
{
get
{
string[] array = ConfigEntry.Value.Split(ValuesSeparator, StringSplitOptions.RemoveEmptyEntries);
List<string> list = new List<string>(array.Length);
list.AddRange(array);
return list;
}
}
public List<string> CachedValues { get; }
public event EventHandler<List<string>> ValuesChangedEvent;
public StringListConfigEntry(ConfigFile configFile, string section, string key, string description, string valuesSeparator)
{
ConfigEntry = configFile.BindInOrder(section, key, string.Empty, description, (Action<ConfigEntryBase>)Drawer, browsable: true, hideDefaultButton: true, hideSettingName: true, isAdvanced: false, readOnly: false);
ValuesSeparator = new string[1] { valuesSeparator };
List<string> values = Values;
List<string> list = new List<string>(values.Count);
list.AddRange(values);
CachedValues = list;
}
private void Drawer(ConfigEntryBase entry)
{
GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
GUILayout.BeginHorizontal(_horizontalStyle.Value, Array.Empty<GUILayoutOption>());
GUILayout.Label("<b>" + entry.Definition.Key + "</b>\n<i>" + entry.Description.Description + "</i>", _richTextLabelStyle.Value, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
GUILayout.EndHorizontal();
_valuesCache.Clear();
if (!string.IsNullOrEmpty(entry.BoxedValue.ToString()))
{
_valuesCache.AddRange(entry.BoxedValue.ToString().Split(ValuesSeparator, StringSplitOptions.None));
}
int num = -1;
bool flag = false;
if (!string.IsNullOrEmpty(entry.BoxedValue.ToString()))
{
for (int i = 0; i < _valuesCache.Count; i++)
{
GUILayout.BeginHorizontal(_horizontalStyle.Value, Array.Empty<GUILayoutOption>());
GUILayout.Space(5f);
GUILayout.Label($"#{i:D2}", _labelStyle.Value, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(false) });
GUILayout.Space(5f);
string name = $"{entry.Definition.Key}.{i}";
string value = _valuesCache[i];
if (ShowTextField(name, ref value) && _valuesCache[i] != value)
{
_valuesCache[i] = value;
flag = true;
}
GUILayout.Space(10f);
if (GUILayout.Button("Delete", _buttonStyle.Value, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(false) }))
{
num = i;
}
GUILayout.EndHorizontal();
}
}
GUILayout.BeginHorizontal(_horizontalStyle.Value, Array.Empty<GUILayoutOption>());
GUILayout.Space(10f);
if (GUILayout.Button("Add new entry", _buttonStyle.Value, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(false) }))
{
_valuesCache.Add("changemeplease");
flag = true;
}
GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();
GUILayout.EndVertical();
if (num >= 0 && num < _valuesCache.Count)
{
_valuesCache.RemoveAt(num);
flag = true;
}
if (flag)
{
entry.BoxedValue = string.Join(ValuesSeparator[0], _valuesCache);
CachedValues.Clear();
CachedValues.AddRange(Values);
this.ValuesChangedEvent?.Invoke(this, Values);
}
}
private bool ShowTextField(string name, ref string value)
{
//IL_009f: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00a8: Invalid comparison between Unknown and I4
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Invalid comparison between Unknown and I4
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Invalid comparison between Unknown and I4
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: Invalid comparison between Unknown and I4
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Invalid comparison between Unknown and I4
GUI.SetNextControlName(name);
if (GUI.GetNameOfFocusedControl() != name)
{
if (_lastFocusedControl == name)
{
value = _editingValue;
GUILayout.TextField(value, _textFieldStyle.Value, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
return true;
}
GUILayout.TextField(value, _textFieldStyle.Value, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
return false;
}
if (_lastFocusedControl != name)
{
_lastFocusedControl = name;
_editingValue = value;
}
bool result = false;
if (Event.current.isKey)
{
KeyCode keyCode = Event.current.keyCode;
if ((int)keyCode <= 13)
{
if ((int)keyCode == 9 || (int)keyCode == 13)
{
goto IL_00c3;
}
}
else if ((int)keyCode == 27 || (int)keyCode == 271)
{
goto IL_00c3;
}
}
goto IL_00d7;
IL_00c3:
value = _editingValue;
result = true;
Event.current.Use();
goto IL_00d7;
IL_00d7:
_editingValue = GUILayout.TextField(_editingValue, _textFieldStyle.Value, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
return result;
}
}
public static class StringListConfigEntryExtensions
{
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
public static StringListConfigEntry BindInOrder(this ConfigFile config, string section, string key, string description, string valuesSeparator)
{
return new StringListConfigEntry(config, section, key, description, valuesSeparator);
}
}
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
public sealed class ChatMessage
{
public ChatMessageType MessageType { get; set; } = ChatMessageType.Text;
public DateTime Timestamp { get; set; } = DateTime.MinValue;
public long SenderId { get; set; }
public Vector3 Position { get; set; } = Vector3.zero;
public Type TalkerType { get; set; } = (Type)1;
public string Username { get; set; } = string.Empty;
public string Text { get; set; } = string.Empty;
}
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
public static class ChatPanelController
{
public static ChatPanel ChatPanel { get; private set; }
public static GuiInputField VanillaInputField { get; set; }
public static void ToggleChatter(bool toggleOn)
{
ToggleChatter(Chat.m_instance, toggleOn);
}
public static void ToggleChatter(Chat chat, bool toggleOn)
{
TerminalCommands.ToggleCommands(toggleOn);
if (Object.op_Implicit((Object)(object)chat))
{
ToggleVanillaChat(chat, !toggleOn);
ToggleChatPanel(chat, toggleOn);
((Terminal)chat).m_input = (toggleOn ? ChatPanel.TextInput.InputField : VanillaInputField);
}
}
public static void ToggleVanillaChat(Chat chat, bool toggleOn)
{
((Component)((TMP_Text)((Terminal)chat).m_output).transform.parent).gameObject.SetActive(toggleOn);
((Component)((Terminal)chat).m_output).gameObject.SetActive(toggleOn);
}
public static void ToggleChatPanel(Chat chat, bool toggleOn)
{
//IL_003e: 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_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: 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_0111: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)ChatPanel?.Panel))
{
ChatPanel = new ChatPanel(((Component)Hud.m_instance).transform);
((Transform)ChatPanel.Panel.GetComponent<RectTransform>().SetAnchorMin(Vector2.right).SetAnchorMax(Vector2.right)
.SetPivot(Vector2.right)
.SetPosition(PluginConfig.ChatPanelPosition.Value)
.SetSizeDelta(PluginConfig.ChatPanelSizeDelta.Value)).SetAsFirstSibling();
ChatPanel.PanelDragger.OnEndDragEvent += OnChatterChatPanelEndDrag;
ChatPanel.PanelResizer.OnEndDragEvent += OnChatterChatPanelEndResize;
((UnityEvent<string>)(object)((TMP_InputField)ChatPanel.TextInput.InputField).onSubmit).AddListener((UnityAction<string>)OnChatterTextInputFieldSubmit);
ChatPanel.SetChatTextInputPrefix(PluginConfig.ChatPanelDefaultMessageTypeToUse.Value);
ChatPanel.SetupContentRowToggles(PluginConfig.ChatPanelContentRowTogglesToEnable.Value);
ChatPanel.SetContentSpacing();
ContentRowManager.RebuildContentRows();
}
ChatPanel.Panel.SetActive(toggleOn);
}
public static bool TryGetChatPanel(out ChatPanel chatPanel)
{
chatPanel = ChatPanel;
return Object.op_Implicit((Object)(object)chatPanel?.Panel);
}
private static void OnChatterChatPanelEndDrag(object sender, Vector3 position)
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
PluginConfig.ChatPanelPosition.Value = Vector2.op_Implicit(position);
}
private static void OnChatterChatPanelEndResize(object send, Vector2 sizeDelta)
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
PluginConfig.ChatPanelSizeDelta.Value = sizeDelta;
}
private static void OnChatterTextInputFieldSubmit(string input)
{
Chat.m_instance.SendInput();
}
}
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
public static class ContentRowManager
{
public static CircularQueue<ContentRow> MessageRows { get; } = new CircularQueue<ContentRow>(50, DestroyContentRow);
public static void CreateContentRow(ChatMessage message)
{
if (!Object.op_Implicit((Object)(object)ChatPanelController.ChatPanel?.Content))
{
return;
}
if (ShouldCreateContentRow(message))
{
ContentRow contentRow = new ContentRow(message, MessageLayoutType.SingleRow, ChatPanelController.ChatPanel.Content.transform);
MessageRows.EnqueueItem(contentRow);
SetupContentRow(contentRow);
bool flag = ChatPanelController.ChatPanel.IsMessageTypeToggleActive(message.MessageType);
GameObject obj = contentRow.Divider.Ref<GameObject>();
if (obj != null)
{
obj.SetActive(flag && PluginConfig.ShowChatPanelMessageDividers.Value);
}
contentRow.Row.SetActive(flag);
}
TextMeshProUGUI obj2 = MessageRows.LastItem.AddBodyLabel(message);
((TMP_Text)obj2).font = UIFonts.GetFontAssetByName(PluginConfig.ChatMessageFontAsset.Value);
((TMP_Text)obj2).fontSize = PluginConfig.ChatMessageFontSize.Value;
}
public static bool ShouldCreateContentRow(ChatMessage message)
{
return true;
}
public static void DestroyContentRow(ContentRow row)
{
if (Object.op_Implicit((Object)(object)row.Row))
{
Object.Destroy((Object)(object)row.Row);
}
if (Object.op_Implicit((Object)(object)row.Divider))
{
Object.Destroy((Object)(object)row.Divider);
}
}
public static void RebuildContentRows()
{
MessageRows.ClearItems();
if (!Object.op_Implicit((Object)(object)ChatPanelController.ChatPanel?.Panel))
{
return;
}
foreach (ChatMessage item in ChatMessageUtils.MessageHistory)
{
CreateContentRow(item);
}
}
public static void SetupContentRow(ContentRow row)
{
if (row.LayoutType == MessageLayoutType.SingleRow)
{
row.RowLayoutGroup.SetSpacing<VerticalLayoutGroup>(PluginConfig.ChatPanelContentSingleRowSpacing.Value);
}
}
public static void ToggleContentRows(bool toggleOn, ChatMessageType messageType)
{
foreach (ContentRow messageRow in MessageRows)
{
if (messageRow.Message.MessageType == messageType)
{
GameObject obj = messageRow.Row.Ref<GameObject>();
if (obj != null)
{
obj.SetActive(toggleOn);
}
GameObject obj2 = messageRow.Divider.Ref<GameObject>();
if (obj2 != null)
{
obj2.SetActive(toggleOn);
}
}
}
}
public static void SetContentRowSpacing(float spacing)
{
foreach (ContentRow messageRow in MessageRows)
{
messageRow?.RowLayoutGroup.Ref<VerticalLayoutGroup>()?.SetSpacing<VerticalLayoutGroup>(spacing);
}
}
public static void SetMessageTextColor(Color color, ChatMessageType messageType)
{
}
public static void SetUsernameTextColor(Color color)
{
RebuildContentRows();
}
public static void SetTimestampTextColor(Color color)
{
RebuildContentRows();
}
public static void ToggleShowTimestamp(bool toggleOn)
{
RebuildContentRows();
}
public static void ToggleMessageDividers(bool toggleOn)
{
foreach (ContentRow messageRow in MessageRows)
{
if (messageRow != null)
{
GameObject obj = messageRow.Divider.Ref<GameObject>();
if (obj != null)
{
obj.SetActive(toggleOn);
}
}
}
}
}
public enum CardSuit
{
Spades,
Hearts,
Diamonds,
Clubs
}
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
public readonly struct PlayingCard
{
public readonly CardSuit Suit;
public readonly int Rank;
public string RankString
{
get
{
switch (Rank)
{
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
{
int rank = Rank;
return rank.ToString();
}
case 11:
return "J";
case 12:
return "Q";
case 13:
return "K";
case 14:
return "A";
default:
return "?";
}
}
}
public string SuitSymbol => Suit switch
{
CardSuit.Spades => "♠",
CardSuit.Hearts => "♥",
CardSuit.Diamonds => "♦",
CardSuit.Clubs => "♣",
_ => "?",
};
public PlayingCard(CardSuit suit, int rank)
{
Suit = suit;
Rank = rank;
}
public override string ToString()
{
return RankString + SuitSymbol;
}
}
[Flags]
public enum ChatMessageType
{
None = 0,
Text = 1,
HudCenter = 2,
Say = 4,
Shout = 8,
Whisper = 0x10,
Gesture = 0x11,
Emote = 0x14,
Game = 0x15,
Ping = 0x20
}
public enum MessageLayoutType
{
SingleRow
}
public enum TarotSuit
{
Cups,
Coins,
Swords,
Wands
}
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
public readonly struct TarotCard
{
public readonly bool IsMajor;
public readonly int Rank;
public readonly TarotSuit Suit;
public readonly bool IsReversed;
public string MajorName => Rank switch
{
0 => "The Fool",
1 => "The Magician",
2 => "The High Priestess",
3 => "The Empress",
4 => "The Emperor",
5 => "The Hierophant",
6 => "The Lovers",
7 => "The Chariot",
8 => "Strength",
9 => "The Hermit",
10 => "Wheel of Fortune",
11 => "Justice",
12 => "The Hanged Man",
13 => "Death",
14 => "Temperance",
15 => "The Devil",
16 => "The Tower",
17 => "The Star",
18 => "The Moon",
19 => "The Sun",
20 => "Judgement",
21 => "The World",
_ => "?",
};
public string MinorRankString
{
get
{
switch (Rank)
{
case 1:
return "Ace";
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
{
int rank = Rank;
return rank.ToString();
}
case 11:
return "Page";
case 12:
return "Knight";
case 13:
return "Queen";
case 14:
return "King";
default:
return "?";
}
}
}
public string Name
{
get
{
if (!IsMajor)
{
return $"{MinorRankString} of {Suit} {SuitSymbolOf(Suit)}";
}
return MajorName;
}
}
public TarotCard(int majorRank, bool reversed)
{
IsMajor = true;
Rank = majorRank;
Suit = TarotSuit.Cups;
IsReversed = reversed;
}
public TarotCard(TarotSuit suit, int minorRank, bool reversed)
{
IsMajor = false;
Rank = minorRank;
Suit = suit;
IsReversed = reversed;
}
public static string SuitSymbolOf(TarotSuit s)
{
return s switch
{
TarotSuit.Cups => "\ud83c\udf77",
TarotSuit.Coins => "\ud83e\ude99",
TarotSuit.Swords => "⚔",
TarotSuit.Wands => "\ud83e\ude84",
_ => "?",
};
}
public override string ToString()
{
if (!IsReversed)
{
return Name;
}
return Name + "⁽ʳ⁾";
}
}
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
internal sealed class TarotDeck
{
private readonly object _lock = new object();
private readonly Stack<TarotCard> _drawPile = new Stack<TarotCard>(78);
public int Count
{
get
{
lock (_lock)
{
return _drawPile.Count;
}
}
}
public void Shuffle(int reversalPercent = 50)
{
List<TarotCard> list = new List<TarotCard>(78);
for (int i = 0; i <= 21; i++)
{
bool reversed = RollUnder(reversalPercent);
list.Add(new TarotCard(i, reversed));
}
foreach (TarotSuit value3 in Enum.GetValues(typeof(TarotSuit)))
{
for (int j = 1; j <= 14; j++)
{
bool reversed2 = RollUnder(reversalPercent);
list.Add(new TarotCard(value3, j, reversed2));
}
}
for (int num = list.Count - 1; num > 0; num--)
{
int num2 = GamesPatch.RandomRoll(0, num);
List<TarotCard> list2 = list;
int index = num;
List<TarotCard> list3 = list;
int index2 = num2;
TarotCard value = list[num2];
TarotCard value2 = list[num];
list2[index] = value;
list3[index2] = value2;
}
lock (_lock)
{
_drawPile.Clear();
foreach (TarotCard item in list)
{
_drawPile.Push(item);
}
}
}
public bool TryDraw(out TarotCard card)
{
lock (_lock)
{
if (_drawPile.Count == 0)
{
card = default(TarotCard);
return false;
}
card = _drawPile.Pop();
return true;
}
}
public int TryDrawMany(int count, List<TarotCard> drawn)
{
if (count <= 0)
{
return 0;
}
if (drawn == null)
{
drawn = new List<TarotCard>(count);
}
lock (_lock)
{
int num = Math.Min(count, _drawPile.Count);
for (int i = 0; i < num; i++)
{
drawn.Add(_drawPile.Pop());
}
return num;
}
}
private static bool RollUnder(int percent)
{
percent = Mathf.Clamp(percent, 0, 100);
return GamesPatch.RandomRoll(0, 99) < percent;
}
}
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
internal static class LocalTarot
{
private static TarotDeck _deck;
public static bool HasDeck => _deck != null;
public static int Remaining
{
get
{
if (!HasDeck)
{
return 0;
}
return _deck.Count;
}
}
public static void Reset(int reversalPercent)
{
_deck = new TarotDeck();
_deck.Shuffle(reversalPercent);
}
public static bool TryDraw(out TarotCard card)
{
card = default(TarotCard);
if (!HasDeck)
{
return false;
}
return _deck.TryDraw(out card);
}
public static int TryDrawMany(int count, List<TarotCard> drawn)
{
if (!HasDeck)
{
return 0;
}
return _deck.TryDrawMany(count, drawn);
}
}
internal static class RpMarkers
{
public const char EmoteChar = '\u200b';
public const char GameChar = '\u200c';
public const char GestureChar = '\u200d';
public static bool IsMarkerChar(char c)
{
if (c != '\u200b' && c != '\u200c')
{
return c == '\u200d';
}
return true;
}
public static bool NoBubbleChar(char c)
{
if (c != '\u200b' && c != '\u200c')
{
return c == '\u200d';
}
return true;
}
}
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
public static class TerminalCommands
{
[CompilerGenerated]
private static class <>O
{
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
public static ConsoleEvent <0>__RunShoutCommand;
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
public static ConsoleEvent <1>__RunWhisperCommand;
}
private static readonly List<ConsoleCommand> _commands = new List<ConsoleCommand>();
public static void ToggleCommands(bool toggleOn)
{
DeregisterCommands(_commands);
_commands.Clear();
if (toggleOn)
{
_commands.AddRange(RegisterCommands());
}
UpdateCommandLists();
}
private static ConsoleCommand[] RegisterCommands()
{
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Expected O, but got Unknown
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Expected O, but got Unknown
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Expected O, but got Unknown
//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_0063: Expected O, but got Unknown
ConsoleCommand[] array = new ConsoleCommand[2];
object obj = <>O.<0>__RunShoutCommand;
if (obj == null)
{
ConsoleEvent val = RunShoutCommand;
<>O.<0>__RunShoutCommand = val;
obj = (object)val;
}
array[0] = new ConsoleCommand("shout", "(Chatter) shout <message>", (ConsoleEvent)obj, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
object obj2 = <>O.<1>__RunWhisperCommand;
if (obj2 == null)
{
ConsoleEvent val2 = RunWhisperCommand;
<>O.<1>__RunWhisperCommand = val2;
obj2 = (object)val2;
}
array[1] = new ConsoleCommand("whisper", "(Chatter) whisper <message>", (ConsoleEvent)obj2, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
return (ConsoleCommand[])(object)array;
}
public static void RunShoutCommand(ConsoleEventArgs args)
{
if (args.FullLine.Length < 7)
{
ChatPanelController.ChatPanel?.SetChatTextInputPrefix((Type)2);
}
else if (Object.op_Implicit((Object)(object)Chat.m_instance))
{
Chat.m_instance.SendText((Type)2, args.FullLine.Substring(6));
}
}
public static void RunWhisperCommand(ConsoleEventArgs args)
{
if (args.FullLine.Length < 9)
{
ChatPanelController.ChatPanel?.SetChatTextInputPrefix((Type)0);
}
else if (Object.op_Implicit((Object)(object)Chat.m_instance))
{
Chat.m_instance.SendText((Type)0, args.FullLine.Substring(8));
}
}
private static void DeregisterCommands(List<ConsoleCommand> commands)
{
foreach (ConsoleCommand command in commands)
{
if (Terminal.commands[command.Command] == command)
{
Terminal.commands.Remove(command.Command);
}
}
}
private static void UpdateCommandLists()
{
Terminal[] array = Object.FindObjectsOfType<Terminal>(true);
for (int i = 0; i < array.Length; i++)
{
array[i].updateCommandList();
}
}
}
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
public sealed class ChatPanel
{
public GameObject Panel { get; private set; }
public RectTransform PanelRectTransform { get; private set; }
public Image PanelBackground { get; private set; }
public CanvasGroup PanelCanvasGroup { get; private set; }
public RectTransformDragger PanelDragger { get; private set; }
public GameObject ContentViewport { get; private set; }
public GameObject Content { get; private set; }
public VerticalLayoutGroup ContentLayoutGroup { get; private set; }
public ScrollRect ContentScrollRect { get; private set; }
public InputFieldCell TextInput { get; private set; }
public ToggleRow MessageTypeToggleRow { get; private set; }
public ResizeCell ResizerCell { get; private set; }
public RectTransformResizer PanelResizer { get; private set; }
public ChatPanel(Transform parentTransform)
{
Panel = CreateChildPanel(parentTransform);
PanelRectTransform = Panel.GetComponent<RectTransform>();
PanelBackground = Panel.GetComponent<Image>();
PanelCanvasGroup = Panel.GetComponent<CanvasGroup>();
PanelDragger = Panel.GetComponent<RectTransformDragger>();
ContentViewport = CreateChildViewport(Panel.transform);
Content = CreateChildContent(ContentViewport.transform);
ContentLayoutGroup = Content.GetComponent<VerticalLayoutGroup>();
ContentScrollRect = CreateChildScrollRect(ContentViewport, Content);
TextInput = new InputFieldCell(Panel.transform);
LayoutElement layoutElement = TextInput.Cell.AddComponent<LayoutElement>().SetFlexible<LayoutElement>((float?)1f, (float?)null);
float? height = 35f;
layoutElement.SetPreferred<LayoutElement>((float?)null, height);
MessageTypeToggleRow = new ToggleRow(Panel.transform);
MessageTypeToggleRow.Row.AddComponent<LayoutElement>().SetIgnoreLayout<LayoutElement>(ignoreLayout: true);
ResizerCell = new ResizeCell(MessageTypeToggleRow.Row.transform);
ResizerCell.Cell.AddComponent<LayoutElement>().SetIgnoreLayout<LayoutElement>(ignoreLayout: true);
PanelResizer = ResizerCell.Cell.AddComponent<RectTransformResizer>().SetTargetRectTransform(Panel.GetComponent<RectTransform>());
}
private GameObject CreateChildPanel(Transform parentTransform)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Expected O, but got Unknown
//IL_003e: 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_0066: 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_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_0118: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject("ChatPanel", new Type[1] { typeof(RectTransform) });
val.SetParent(parentTransform);
val.AddComponent<GraphicRaycaster>();
val.GetComponent<RectTransform>().SetAnchorMin(new Vector2(0.5f, 0.5f)).SetAnchorMax(new Vector2(0.5f, 0.5f))
.SetPivot(new Vector2(0.5f, 0.5f))
.SetPosition(Vector2.zero)
.SetSizeDelta(new Vector2(400f, 400f));
val.AddComponent<VerticalLayoutGroup>().SetChildControl<VerticalLayoutGroup>((bool?)true, (bool?)true).SetChildForceExpand<VerticalLayoutGroup>((bool?)false, (bool?)false)
.SetPadding<VerticalLayoutGroup>((int?)8, (int?)8, (int?)8, (int?)8)
.SetSpacing<VerticalLayoutGroup>(10f);
ImageExtensions.SetColor<Image>(val.AddComponent<Image>().SetType<Image>((Type)1).SetSprite<Image>(UISpriteBuilder.CreateSuperellipse(400, 400, 15f)), new Color(0f, 0f, 0f, 0.4f));
val.AddComponent<CanvasGroup>().SetAlpha(1f).SetBlocksRaycasts(blocksRaycasts: true);
val.AddComponent<RectTransformDragger>().SetTargetRectTransform(val.GetComponent<RectTransform>());
return val;
}
private GameObject CreateChildViewport(Transform parentTransform)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Expected O, but got Unknown
//IL_0026: 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_003d: 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_0065: Expected O, but got Unknown
GameObject val = new GameObject("Viewport", new Type[1] { typeof(RectTransform) });
GameObjectExtensions.SetParent(val, parentTransform);
ImageExtensions.SetColor<Image>(val.AddComponent<Image>().SetType<Image>((Type)3), Color.clear);
val.AddComponent<RectMask2D>();
val.AddComponent<LayoutElement>().SetFlexible<LayoutElement>((float?)1f, (float?)1f);
return val;
}
private GameObject CreateChildContent(Transform parentTransform)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Expected O, but got Unknown
//IL_0026: 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_0036: 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_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: 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_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00c9: Expected O, but got Unknown
GameObject val = new GameObject("Content", new Type[1] { typeof(RectTransform) });
GameObjectExtensions.SetParent(val, parentTransform);
val.GetComponent<RectTransform>().SetAnchorMin(Vector2.zero).SetAnchorMax(Vector2.right)
.SetPivot(Vector2.zero)
.SetPosition(Vector2.zero)
.SetSizeDelta(Vector2.zero);
val.AddComponent<VerticalLayoutGroup>().SetChildControl<VerticalLayoutGroup>((bool?)true, (bool?)true).SetChildForceExpand<VerticalLayoutGroup>((bool?)false, (bool?)false)
.SetPadding<VerticalLayoutGroup>((int?)8, (int?)8, (int?)null, (int?)null)
.SetSpacing<VerticalLayoutGroup>(10f);
val.AddComponent<ContentSizeFitter>().SetHorizontalFit((FitMode)0).SetVerticalFit((FitMode)2);
return val;
}
private ScrollRect CreateChildScrollRect(GameObject viewport, GameObject content)
{
ScrollRect obj = viewport.AddComponent<ScrollRect>();
obj.viewport = viewport.GetComponent<RectTransform>();
obj.content = content.GetComponent<RectTransform>();
obj.horizontal = false;
obj.vertical = true;
obj.movementType = (MovementType)1;
obj.scrollSensitivity = 20f;
return obj;
}
public void OffsetContentVerticalScrollPosition(float offset)
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
Transform transform = Content.transform;
float num = offset / ((RectTransform)((transform is RectTransform) ? transform : null)).sizeDelta.y;
ScrollRect contentScrollRect = ContentScrollRect;
contentScrollRect.verticalNormalizedPosition += num;
}
public void SetContentVerticalScrollPosition(float position)
{
ContentScrollRect.verticalNormalizedPosition = position;
}
public void ToggleGrabber(bool toggleOn)
{
MessageTypeToggleRow.Row.SetActive(toggleOn);
}
}
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
public sealed class ContentRow
{
public ChatMessage Message { get; private set; }
public MessageLayoutType LayoutType { get; private set; }
public GameObject Row { get; private set; }
public VerticalLayoutGroup RowLayoutGroup { get; private set; }
public GameObject Divider { get; private set; }
public GameObject Header { get; private set; }
public TextMeshProUGUI HeaderLeftLabel { get; private set; }
public TextMeshProUGUI HeaderRightLabel { get; private set; }
public ContentRow(ChatMessage message, MessageLayoutType layoutType, Transform parentTransform)
{
Message = message;
LayoutType = layoutType;
Row = CreateChildRow(parentTransform);
RowLayoutGroup = Row.GetComponent<VerticalLayoutGroup>();
}
public TextMeshProUGUI AddBodyLabel(ChatMessage message)
{
TextMeshProUGUI obj = CreateChildBodyLabel(Row.transform);
((TMP_Text)obj).text = ChatMessageUtils.GetContentRowBodyText(message);
return obj;
}
private GameObject CreateChildRow(Transform parentTransform)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Expected O, but got Unknown
//IL_0026: 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_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Expected O, but got Unknown
GameObject val = new GameObject("Message", new Type[1] { typeof(RectTransform) });
GameObjectExtensions.SetParent(val, parentTransform);
val.GetComponent<RectTransform>().SetSizeDelta(Vector2.zero);
val.AddComponent<VerticalLayoutGroup>().SetChildControl<VerticalLayoutGroup>((bool?)true, (bool?)true).SetChildForceExpand<VerticalLayoutGroup>((bool?)true, (bool?)false)
.SetSpacing<VerticalLayoutGroup>(2f);
return val;
}
private GameObject CreateDivider(Transform parentTransform)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Expected O, but got Unknown
//IL_0026: 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_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Expected O, but got Unknown
GameObject val = new GameObject("Divider", new Type[1] { typeof(RectTransform) });
GameObjectExtensions.SetParent(val, parentTransform);
ImageExtensions.SetColor<Image>(val.AddComponent<Image>().SetSprite<Image>(UISpriteBuilder.CreateRect(10, 10, Color32.op_Implicit(Color.white))).SetType<Image>((Type)3), new Color(1f, 1f, 1f, 0.0625f)).SetRaycastTarget<Image>(raycastTarget: true).SetMaskable<Image>(maskable: true);
LayoutElement layoutElement = val.AddComponent<LayoutElement>().SetFlexible<LayoutElement>((float?)1f, (float?)null);
float? height = 1f;
layoutElement.SetPreferred<LayoutElement>((float?)null, height);
return val;
}
[return: <30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(new byte[] { 0, 1, 1, 1 })]
private (GameObject header, TextMeshProUGUI leftCell, TextMeshProUGUI rightCell) CreateHeader(Transform parentTransform)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Expected O, but got Unknown
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
//IL_00c4: Expected O, but got Unknown
GameObject val = new GameObject("Header", new Type[1] { typeof(RectTransform) });
val.SetParent(parentTransform);
val.AddComponent<HorizontalLayoutGroup>().SetChildControl<HorizontalLayoutGroup>((bool?)true, (bool?)true).SetChildForceExpand<HorizontalLayoutGroup>((bool?)false, (bool?)false)
.SetPadding<HorizontalLayoutGroup>((int?)0, (int?)0, (int?)0, (int?)0);
TextMeshProUGUI val2 = UIBuilder.CreateLabel(val.transform);
((Object)val2).name = "HeaderLeftLabel";
((TMP_Text)val2).text = "LeftLabel";
((TMP_Text)val2).alignment = (TextAlignmentOptions)513;
GameObject val3 = new GameObject("Spacer", new Type[1] { typeof(RectTransform) });
GameObjectExtensions.SetParent(val3, val.transform);
val3.AddComponent<LayoutElement>().SetFlexible<LayoutElement>((float?)1f, (float?)null);
TextMeshProUGUI val4 = UIBuilder.CreateLabel(val.transform);
((Object)val4).name = "HeaderRightLabel";
((TMP_Text)val4).text = "RightLabel";
((TMP_Text)val4).alignment = (TextAlignmentOptions)516;
return (val, val2, val4);
}
private TextMeshProUGUI CreateChildBodyLabel(Transform parentTransform)
{
TextMeshProUGUI obj = UIBuilder.CreateLabel(parentTransform);
((Object)obj).name = "BodyLabel";
((TMP_Text)obj).alignment = (TextAlignmentOptions)513;
((TMP_Text)obj).textWrappingMode = (TextWrappingModes)1;
return obj;
}
}
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
public sealed class InputFieldCell
{
public GameObject Cell { get; private set; }
public Image Background { get; private set; }
public GuiInputField InputField { get; private set; }
public TextMeshProUGUI InputFieldPlaceholder { get; private set; }
public InputFieldCell(Transform parentTransform)
{
Cell = CreateChildCell(parentTransform);
Background = Cell.GetComponent<Image>();
InputField = CreateChildInputField(Cell.transform);
InputFieldPlaceholder = ((Component)((TMP_InputField)InputField).placeholder).GetComponent<TextMeshProUGUI>();
InputField.SetTargetGraphic<GuiInputField>((Graphic)(object)Background).SetTransition<GuiInputField>((Transition)1).SetNavigationMode<GuiInputField>((Mode)0);
}
private GameObject CreateChildCell(Transform parentTransform)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Expected O, but got Unknown
//IL_0026: 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_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Expected O, but got Unknown
GameObject val = new GameObject("Cell", new Type[1] { typeof(RectTransform) });
GameObjectExtensions.SetParent(val, parentTransform);
ImageExtensions.SetColor<Image>(val.AddComponent<Image>().SetType<Image>((Type)1).SetSprite<Image>(UISpriteBuilder.CreateSuperellipse(128, 128, 10f)), new Color(0.1f, 0.1f, 0.1f, 0.3f));
val.AddComponent<RectMask2D>();
return val;
}
private GuiInputField CreateChildInputField(Transform parentTransform)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Expected O, but got Unknown
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: 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_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: 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_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_010f: Unknown result type (might be due to invalid IL or missing references)
//IL_0119: Unknown result type (might be due to invalid IL or missing references)
//IL_0123: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: 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)
GameObject val = new GameObject("Text Area", new Type[1] { typeof(RectTransform) });
val.SetParent(parentTransform);
val.GetComponent<RectTransform>().SetAnchorMin(Vector2.zero).SetAnchorMax(Vector2.one)
.SetPivot(new Vector2(0.5f, 0.5f))
.SetSizeDelta(new Vector2(-16f, -8f))
.SetPosition(Vector2.zero);
TextMeshProUGUI val2 = UIBuilder.CreateLabel(val.transform);
val2.SetName<TextMeshProUGUI>("Text");
((TMP_Text)val2).rectTransform.SetAnchorMin(Vector2.zero).SetAnchorMax(Vector2.one).SetSizeDelta(Vector2.zero)
.SetPosition(Vector2.zero);
((TMP_Text)val2).textWrappingMode = (TextWrappingModes)0;
((TMP_Text)val2).overflowMode = (TextOverflowModes)2;
((TMP_Text)val2).richText = false;
((TMP_Text)val2).alignment = (TextAlignmentOptions)513;
((Graphic)val2).color = Color.white;
((TMP_Text)val2).text = string.Empty;
TextMeshProUGUI val3 = UIBuilder.CreateLabel(val.transform);
val3.SetName<TextMeshProUGUI>("Placeholder");
((TMP_Text)val3).rectTransform.SetAnchorMin(Vector2.zero).SetAnchorMax(Vector2.one).SetSizeDelta(Vector2.zero)
.SetPosition(Vector2.zero);
((TMP_Text)val3).textWrappingMode = (TextWrappingModes)0;
((TMP_Text)val3).overflowMode = (TextOverflowModes)2;
((TMP_Text)val3).richText = true;
((TMP_Text)val3).alignment = (TextAlignmentOptions)513;
((Graphic)val3).color = new Color(1f, 1f, 1f, 0.3f);
((TMP_Text)val3).text = "...";
GuiInputField obj = ((Component)parentTransform).gameObject.AddComponent<GuiInputField>();
((TMP_InputField)obj).textViewport = val.GetComponent<RectTransform>();
((TMP_InputField)obj).textComponent = (TMP_Text)(object)val2;
((TMP_InputField)obj).placeholder = (Graphic)(object)val3;
((TMP_InputField)obj).onFocusSelectAll = false;
obj.OnInputLayoutChanged();
((TMP_InputField)obj).MoveToStartOfLine(false, false);
return obj;
}
}
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
public sealed class ResizeCell
{
public GameObject Cell { get; private set; }
public Image Background { get; private set; }
public TMP_Text Label { get; private set; }
public ResizeCell(Transform parentTransform)
{
Cell = CreateChildCell(parentTransform);
Background = Cell.GetComponent<Image>();
Label = CreateChildLabel(Cell.transform);
}
private GameObject CreateChildCell(Transform parentTransform)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Expected O, but got Unknown
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: 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_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: Expected O, but got Unknown
GameObject val = new GameObject("Resizer", new Type[1] { typeof(RectTransform) });
GameObjectExtensions.SetParent(val, parentTransform);
val.GetComponent<RectTransform>().SetAnchorMin(new Vector2(0f, 0.5f)).SetAnchorMax(new Vector2(0f, 0.5f))
.SetPivot(new Vector2(0f, 0.5f))
.SetSizeDelta(new Vector2(42.5f, 42.5f))
.SetPosition(new Vector2(5f, 0f));
ImageExtensions.SetColor<Image>(val.AddComponent<Image>().SetType<Image>((Type)1).SetSprite<Image>(UIResources.GetSprite("button")), new Color(1f, 1f, 1f, 0.95f));
return val;
}
private TMP_Text CreateChildLabel(Transform parentTransform)
{
//IL_000c: 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_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
TextMeshProUGUI obj = UIBuilder.CreateLabel(parentTransform);
((Component)obj).GetComponent<RectTransform>().SetAnchorMin(Vector2.zero).SetAnchorMax(Vector2.one)
.SetPivot(new Vector2(0.5f, 0.5f))
.SetSizeDelta(Vector2.zero);
((TMP_Text)obj).alignment = (TextAlignmentOptions)514;
((TMP_Text)obj).fontSize = 24f;
((TMP_Text)obj).text = "<rotate=45>↔</rotate>";
return (TMP_Text)(object)obj;
}
}
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
public sealed class ToggleCell
{
public static readonly Color BackgroundColorOn = new Color(1f, 1f, 1f, 0.95f);
public static readonly Color BackgroundColorOff = new Color(0.5f, 0.5f, 0.5f, 0.95f);
public static readonly Color LabelColorOn = Color.white;
public static readonly Color LabelColorOff = Color.gray;
public GameObject Cell { get; private set; }
public Image Background { get; private set; }
public TextMeshProUGUI Label { get; private set; }
public Toggle Toggle { get; private set; }
public ToggleCell(Transform parentTransform)
{
Cell = CreateChildCell(parentTransform);
Background = Cell.GetComponent<Image>();
Label = CreateChildLabel(Cell.transform);
Toggle = Cell.AddComponent<Toggle>();
((UnityEvent<bool>)(object)Toggle.onValueChanged).AddListener((UnityAction<bool>)OnToggleValueChanged);
Toggle.SetNavigationMode<Toggle>((Mode)0).SetTargetGraphic<Toggle>((Graphic)(object)Background).SetIsOnWithoutNotify(false);
Cell.AddComponent<DummyIgnoreDrag>();
OnToggleValueChanged(isOn: false);
}
private GameObject CreateChildCell(Transform parentTransform)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Expected O, but got Unknown
//IL_0026: 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_0037: 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_005e: Expected O, but got Unknown
GameObject val = new GameObject("Toggle", new Type[1] { typeof(RectTransform) });
GameObjectExtensions.SetParent(val, parentTransform);
val.GetComponent<RectTransform>().SetSizeDelta(Vector2.zero);
ImageExtensions.SetColor<Image>(val.AddComponent<Image>().SetType<Image>((Type)1).SetSprite<Image>(UIResources.GetSprite("button")), BackgroundColorOn);
return val;
}
private TextMeshProUGUI CreateChildLabel(Transform parentTransform)
{
//IL_001b: 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_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: 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)
TextMeshProUGUI obj = UIBuilder.CreateLabel(parentTransform);
((TMP_Text)TextMeshProExtensions.SetColor<TextMeshProUGUI>(obj.SetAlignment<TextMeshProUGUI>((TextAlignmentOptions)514).SetFontSize<TextMeshProUGUI>(14f), LabelColorOn)).SetText("Toggle");
((TMP_Text)obj).rectTransform.SetAnchorMin(Vector2.zero).SetAnchorMax(Vector2.one).SetSizeDelta(Vector2.zero)
.SetPosition(Vector2.zero);
return obj;
}
public void SetToggleIsOn(bool isOn)
{
Toggle.isOn = isOn;
}
public bool GetToggleIsOn()
{
return Toggle.isOn;
}
private void OnToggleValueChanged(bool isOn)
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
((Graphic)Background).color = (isOn ? BackgroundColorOn : BackgroundColorOff);
((Graphic)Label).color = (isOn ? LabelColorOn : LabelColorOff);
}
}
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
public sealed class ToggleRow
{
public GameObject Row { get; private set; }
public Image Background { get; private set; }
public ToggleCell SayToggle { get; private set; }
public ToggleCell ShoutToggle { get; private set; }
public ToggleCell WhisperToggle { get; private set; }
public ToggleCell PingToggle { get; private set; }
public ToggleCell EmoteToggle { get; private set; }
public ToggleCell GameToggle { get; private set; }
public ToggleCell MessageHudToggle { get; private set; }
public ToggleCell TextToggle { get; private set; }
public ToggleRow(Transform parentTransform)
{
Row = CreateChildRow(parentTransform);
Background = Row.GetComponent<Image>();
SayToggle = CreateChildToggle(Row.transform, "Say");
ShoutToggle = CreateChildToggle(Row.transform, "Shout");
WhisperToggle = CreateChildToggle(Row.transform, "Whisper");
EmoteToggle = CreateChildToggle(Row.transform, "Emote");
PingToggle = CreateChildToggle(Row.transform, "Ping");
MessageHudToggle = CreateChildToggle(Row.transform, "Hud");
GameToggle = CreateChildToggle(Row.transform, "Game");
TextToggle = CreateChildToggle(Row.transform, "Text");
}
private GameObject CreateChildRow(Transform parentTransform)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Expected O, but got Unknown
//IL_0026: 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_0036: 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_005e: 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_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Expected O, but got Unknown
GameObject val = new GameObject("ToggleRow", new Type[1] { typeof(RectTransform) });
GameObjectExtensions.SetParent(val, parentTransform);
val.GetComponent<RectTransform>().SetAnchorMin(Vector2.zero).SetAnchorMax(Vector2.right)
.SetPivot(new Vector2(0.5f, 0f))
.SetPosition(new Vector2(0f, -55f))
.SetSizeDelta(new Vector2(0f, 45f));
ImageExtensions.SetColor<Image>(val.AddComponent<Image>().SetType<Image>((Type)1).SetSprite<Image>(UISpriteBuilder.CreateRoundedCornerSprite(256, 256, 16, (FilterMode)1)), new Color(0.5f, 0.5f, 0.5f, 0.25f));
val.AddComponent<HorizontalLayoutGroup>().SetChildControl<HorizontalLayoutGroup>((bool?)true, (bool?)true).SetChildForceExpand<HorizontalLayoutGroup>((bool?)false, (bool?)false)
.SetSpacing<HorizontalLayoutGroup>(5f)
.SetPadding<HorizontalLayoutGroup>((int?)5, (int?)5, (int?)4, (int?)4)
.SetChildAlignment<HorizontalLayoutGroup>((TextAnchor)5);
return val;
}
private ToggleCell CreateChildToggle(Transform parentTransform, string toggleText)
{
ToggleCell toggleCell = new ToggleCell(parentTransform);
((TMP_Text)toggleCell.Label).text = toggleText;
LayoutElement layoutElement = toggleCell.Cell.AddComponent<LayoutElement>().SetPreferred<LayoutElement>((float?)(((TMP_Text)toggleCell.Label).GetPreferredWidth() + 25f), (float?)null);
float? height = 0.9f;
layoutElement.SetFlexible<LayoutElement>((float?)null, height);
return toggleCell;
}
}
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
public sealed class RectTransformDragger : MonoBehaviour, IBeginDragHandler, IEventSystemHandler, IDragHandler, IEndDragHandler
{
private Vector2 _lastMousePosition;
[field: SerializeField]
public RectTransform TargetRectTransform { get; private set; }
public event EventHandler<Vector3> OnEndDragEvent;
public RectTransformDragger SetTargetRectTransform(RectTransform rectTransform)
{
TargetRectTransform = rectTransform;
return this;
}
public void OnBeginDrag(PointerEventData eventData)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
_lastMousePosition = eventData.position;
}
public void OnDrag(PointerEventData eventData)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//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_0024: 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_0034: 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_0045: Unknown result type (might be due to invalid IL or missing references)
Vector2 val = eventData.position - _lastMousePosition;
RectTransform targetRectTransform = TargetRectTransform;
((Transform)targetRectTransform).position = ((Transform)targetRectTransform).position + new Vector3(val.x, val.y, 0f);
_lastMousePosition = eventData.position;
}
public void OnEndDrag(PointerEventData eventData)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
this.OnEndDragEvent?.Invoke(this, Vector2.op_Implicit(TargetRectTransform.anchoredPosition));
}
}
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
public sealed class RectTransformResizer : MonoBehaviour, IBeginDragHandler, IEventSystemHandler, IDragHandler, IEndDragHandler
{
private Vector2 _lastMousePosition;
[field: SerializeField]
public RectTransform TargetRectTransform { get; private set; }
public event EventHandler<Vector2> OnEndDragEvent;
public RectTransformResizer SetTargetRectTransform(RectTransform rectTransform)
{
TargetRectTransform = rectTransform;
return this;
}
public void OnBeginDrag(PointerEventData eventData)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
_lastMousePosition = eventData.position;
}
public void OnDrag(PointerEventData eventData)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: 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_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: 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_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
Vector2 val = _lastMousePosition - eventData.position;
RectTransform targetRectTransform = TargetRectTransform;
targetRectTransform.anchoredPosition += new Vector2(0f, 0f - val.y);
RectTransform targetRectTransform2 = TargetRectTransform;
targetRectTransform2.sizeDelta += new Vector2(val.x, val.y);
_lastMousePosition = eventData.position;
}
public void OnEndDrag(PointerEventData eventData)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
this.OnEndDragEvent?.Invoke(this, TargetRectTransform.sizeDelta);
}
}
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
public static class ChatMessageUtils
{
public static readonly CircularQueue<ChatMessage> MessageHistory = new CircularQueue<ChatMessage>(50, delegate
{
});
public static bool IsChatMessageFiltered { get; set; }
public static bool IsChatMessageQueued { get; set; }
public static bool AddChatMessage(ChatMessage message)
{
if (ShouldShowText(message.MessageType, message.Text))
{
MessageHistory.EnqueueItem(message);
ContentRowManager.CreateContentRow(message);
return true;
}
return false;
}
public static ChatMessageType GetChatMessageType(Type talkerType)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Expected I4, but got Unknown
return (int)talkerType switch
{
1 => ChatMessageType.Say,
2 => ChatMessageType.Shout,
0 => ChatMessageType.Whisper,
3 => ChatMessageType.Ping,
_ => ChatMessageType.Text,
};
}
public static string GetContentRowBodyText(ChatMessage message)
{
return JoinIgnoringEmpty(PluginConfig.ChatMessageShowTimestamp.Value ? GetTimestampText(message.Timestamp) : string.Empty, GetUsernameText(message.Username), GetMessageText(message));
}
private static string JoinIgnoringEmpty(params string[] values)
{
return string.Join(" ", values.Where([<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(0)] (string value) => !string.IsNullOrEmpty(value)));
}
public static string GetUsernameText(string username)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
if (username.Length <= 0)
{
return string.Empty;
}
return "<color=#" + ColorUtility.ToHtmlStringRGBA(PluginConfig.ChatMessageUsernameColor.Value) + ">" + username + "</color>";
}
public static string GetTimestampText(DateTime timestamp)
{
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
return PluginConfig.ChatMessageShowTimestamp.Value ? $"<color=#{ColorUtility.ToHtmlStringRGBA(PluginConfig.ChatMessageTimestampColor.Value)}>{timestamp:t}</color>" : string.Empty;
}
public static string GetMessageText(ChatMessage message)
{
//IL_017b: Unknown result type (might be due to invalid IL or missing references)
//IL_0196: Unknown result type (might be due to invalid IL or missing references)
//IL_0124: Unknown result type (might be due to invalid IL or missing references)
//IL_013b: 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_00e4: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
//IL_0291: Unknown result type (might be due to invalid IL or missing references)
//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0231: Unknown result type (might be due to invalid IL or missing references)
//IL_024c: Unknown result type (might be due to invalid IL or missing references)
return message.MessageType switch
{
ChatMessageType.Ping => $"Ping! {message.Position}",
ChatMessageType.Game => "\ud83c\udfb2 <color=#" + ColorUtility.ToHtmlStringRGBA(GetMessageTextColor(message.MessageType)) + ">" + message.Text + "</color>",
ChatMessageType.Emote => "<color=#" + ColorUtility.ToHtmlStringRGBA(GetMessageTextColor(ChatMessageType.HudCenter)) + ">⁍</color> <i><color=#" + ColorUtility.ToHtmlStringRGBA(GetMessageTextColor(message.MessageType)) + ">" + message.Text + "</color></i>",
ChatMessageType.Gesture => "<color=#" + ColorUtility.ToHtmlStringRGBA(GetMessageTextColor(ChatMessageType.HudCenter)) + ">⁍</color> <i><color=#" + ColorUtility.ToHtmlStringRGBA(GetMessageTextColor(ChatMessageType.Whisper)) + ">" + message.Text + "</color></i>",
ChatMessageType.Whisper => "<color=#" + ColorUtility.ToHtmlStringRGBA(GetMessageTextColor(ChatMessageType.HudCenter)) + ">whispers,</color> <color=#" + ColorUtility.ToHtmlStringRGBA(GetMessageTextColor(message.MessageType)) + "><i>\"" + message.Text + "\"</i></color>",
ChatMessageType.Say => "<color=#" + ColorUtility.ToHtmlStringRGBA(GetMessageTextColor(ChatMessageType.HudCenter)) + ">says,</color> <color=#" + ColorUtility.ToHtmlStringRGBA(GetMessageTextColor(message.MessageType)) + ">\"" + message.Text + "\"</color>",
ChatMessageType.Shout => "<color=#" + ColorUtility.ToHtmlStringRGBA(GetMessageTextColor(ChatMessageType.HudCenter)) + ">yells,</color> <color=#" + ColorUtility.ToHtmlStringRGBA(GetMessageTextColor(message.MessageType)) + "><b>\"" + message.Text + "\"</b></color>",
ChatMessageType.HudCenter => "<color=#" + ColorUtility.ToHtmlStringRGBA(GetMessageTextColor(message.MessageType)) + ">" + message.Text + "</color>",
ChatMessageType.Text => "<color=#" + ColorUtility.ToHtmlStringRGBA(GetMessageTextColor(message.MessageType)) + ">" + message.Text + "</color>",
_ => message.Text,
};
}
public static Color GetMessageTextColor(ChatMessageType messageType)
{
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: 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_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_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: 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_00cd: 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_0098: 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_007e: Unknown result type (might be due to invalid IL or missing references)
return (Color)(messageType switch
{
ChatMessageType.Text => PluginConfig.ChatMessageTextDefaultColor.Value,
ChatMessageType.HudCenter => PluginConfig.ChatMessageTextMessageHudColor.Value,
ChatMessageType.Say => PluginConfig.ChatMessageTextSayColor.Value,
ChatMessageType.Shout => PluginConfig.ChatMessageTextShoutColor.Value,
ChatMessageType.Whisper => PluginConfig.ChatMessageTextWhisperColor.Value,
ChatMessageType.Ping => PluginConfig.ChatMessageTextPingColor.Value,
ChatMessageType.Emote => PluginConfig.ChatMessageTextEmoteColor.Value,
ChatMessageType.Gesture => PluginConfig.ChatMessageTextGestureColor.Value,
ChatMessageType.Game => PluginConfig.ChatMessageTextGameColor.Value,
_ => PluginConfig.ChatMessageTextDefaultColor.Value,
});
}
public static bool ShouldShowText(ChatMessageType messageType, string text)
{
return messageType switch
{
ChatMessageType.Say => ShouldShowText(text, PluginConfig.SayTextFilterList.CachedValues),
ChatMessageType.Shout => ShouldShowText(text, PluginConfig.ShoutTextFilterList.CachedValues),
ChatMessageType.Whisper => ShouldShowText(text, PluginConfig.WhisperTextFilterList.CachedValues),
ChatMessageType.Emote => ShouldShowText(text, PluginConfig.EmoteTextFilterList.CachedValues),
ChatMessageType.Gesture => ShouldShowText(text, PluginConfig.WhisperTextFilterList.CachedValues),
ChatMessageType.Game => ShouldShowText(text, PluginConfig.GameTextFilterList.CachedValues),
ChatMessageType.HudCenter => ShouldShowText(text, PluginConfig.HudCenterTextFilterList.CachedValues),
ChatMessageType.Text => ShouldShowText(text, PluginConfig.OtherTextFilterList.CachedValues),
_ => true,
};
}
public static bool ShouldShowText(string text, List<string> filters)
{
if (filters.Count == 0)
{
return true;
}
int i = 0;
for (int count = filters.Count; i < count; i++)
{
if (text.IndexOf(filters[i], 0, StringComparison.OrdinalIgnoreCase) >= 0)
{
return false;
}
}
return true;
}
}
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
public static class ChatPanelUtils
{
public static void ShowOrHideChatPanel(this ChatPanel chatPanel, bool isVisible)
{
if (isVisible != chatPanel.PanelCanvasGroup.blocksRaycasts)
{
if (isVisible)
{
chatPanel.PanelCanvasGroup.SetAlpha(1f).SetBlocksRaycasts(blocksRaycasts: true);
return;
}
chatPanel.PanelCanvasGroup.SetAlpha(Hud.IsUserHidden() ? 0f : PluginConfig.HideChatPanelAlpha.Value).SetBlocksRaycasts(blocksRaycasts: false);
chatPanel.SetContentVerticalScrollPosition(0f);
}
}
public static void EnableOrDisableChatPanel(this ChatPanel chatPanel, bool isEnabled)
{
chatPanel.TextInput.InputField.Ref<GuiInputField>()?.SetEnabled<GuiInputField>(isEnabled);
}
public static void SetContentSpacing(this ChatPanel chatPanel)
{
chatPanel.ContentLayoutGroup.SetSpacing<VerticalLayoutGroup>(PluginConfig.ChatPanelContentSingleRowSpacing.Value);
}
public static void SetContentFontAsset(this ChatPanel chatPanel, TMP_FontAsset fontAsset)
{
if (Object.op_Implicit((Object)(object)chatPanel?.Content) && Object.op_Implicit((Object)(object)fontAsset))
{
TMP_Text[] componentsInChildren = chatPanel.Content.GetComponentsInChildren<TMP_Text>(true);
for (int i = 0; i < componentsInChildren.Length; i++)
{
componentsInChildren[i].font = fontAsset;
}
}
}
public static void SetContentFontSize(this ChatPanel chatPanel, float fontSize)
{
if (Object.op_Implicit((Object)(object)chatPanel?.Content))
{
TMP_Text[] componentsInChildren = chatPanel.Content.GetComponentsInChildren<TMP_Text>(true);
for (int i = 0; i < componentsInChildren.Length; i++)
{
componentsInChildren[i].fontSize = fontSize;
}
}
}
public static void SetupContentRowToggles(this ChatPanel chatPanel, ChatMessageType togglesToEnable)
{
ToggleRow messageTypeToggleRow = chatPanel.MessageTypeToggleRow;
((UnityEvent<bool>)(object)messageTypeToggleRow.SayToggle.Toggle.onValueChanged).AddListener((UnityAction<bool>)delegate(bool isOn)
{
ContentRowManager.ToggleContentRows(isOn, ChatMessageType.Say);
});
((UnityEvent<bool>)(object)messageTypeToggleRow.ShoutToggle.Toggle.onValueChanged).AddListener((UnityAction<bool>)delegate(bool isOn)
{
ContentRowManager.ToggleContentRows(isOn, ChatMessageType.Shout);
});
((UnityEvent<bool>)(object)messageTypeToggleRow.PingToggle.Toggle.onValueChanged).AddListener((UnityAction<bool>)delegate(bool isOn)
{
ContentRowManager.ToggleContentRows(isOn, ChatMessageType.Ping);
});
((UnityEvent<bool>)(object)messageTypeToggleRow.WhisperToggle.Toggle.onValueChanged).AddListener((UnityAction<bool>)delegate(bool isOn)
{
ContentRowManager.ToggleContentRows(isOn, ChatMessageType.Whisper);
});
((UnityEvent<bool>)(object)messageTypeToggleRow.MessageHudToggle.Toggle.onValueChanged).AddListener((UnityAction<bool>)delegate(bool isOn)
{
ContentRowManager.ToggleContentRows(isOn, ChatMessageType.HudCenter);
});
((UnityEvent<bool>)(object)messageTypeToggleRow.EmoteToggle.Toggle.onValueChanged).AddListener((UnityAction<bool>)delegate(bool isOn)
{
ContentRowManager.ToggleContentRows(isOn, ChatMessageType.Emote);
});
((UnityEvent<bool>)(object)messageTypeToggleRow.GameToggle.Toggle.onValueChanged).AddListener((UnityAction<bool>)delegate(bool isOn)
{
ContentRowManager.ToggleContentRows(isOn, ChatMessageType.Game);
});
((UnityEvent<bool>)(object)messageTypeToggleRow.TextToggle.Toggle.onValueChanged).AddListener((UnityAction<bool>)delegate(bool isOn)
{
ContentRowManager.ToggleContentRows(isOn, ChatMessageType.Text);
});
messageTypeToggleRow.SayToggle.SetToggleIsOn(togglesToEnable.HasFlag(ChatMessageType.Say));
messageTypeToggleRow.ShoutToggle.SetToggleIsOn(togglesToEnable.HasFlag(ChatMessageType.Shout));
messageTypeToggleRow.PingToggle.SetToggleIsOn(togglesToEnable.HasFlag(ChatMessageType.Ping));
messageTypeToggleRow.WhisperToggle.SetToggleIsOn(togglesToEnable.HasFlag(ChatMessageType.Whisper));
messageTypeToggleRow.MessageHudToggle.SetToggleIsOn(togglesToEnable.HasFlag(ChatMessageType.HudCenter));
messageTypeToggleRow.GameToggle.SetToggleIsOn(togglesToEnable.HasFlag(ChatMessageType.Game));
messageTypeToggleRow.EmoteToggle.SetToggleIsOn(togglesToEnable.HasFlag(ChatMessageType.Emote));
messageTypeToggleRow.TextToggle.SetToggleIsOn(togglesToEnable.HasFlag(ChatMessageType.Text));
}
public static bool IsMessageTypeToggleActive(this ChatPanel chatPanel, ChatMessageType messageType)
{
ToggleRow messageTypeToggleRow = chatPanel.MessageTypeToggleRow;
return messageType switch
{
ChatMessageType.Text => messageTypeToggleRow.TextToggle.GetToggleIsOn(),
ChatMessageType.HudCenter => messageTypeToggleRow.MessageHudToggle.GetToggleIsOn(),
ChatMessageType.Say => messageTypeToggleRow.SayToggle.GetToggleIsOn(),
ChatMessageType.Shout => messageTypeToggleRow.ShoutToggle.GetToggleIsOn(),
ChatMessageType.Whisper => messageTypeToggleRow.WhisperToggle.GetToggleIsOn(),
ChatMessageType.Ping => messageTypeToggleRow.PingToggle.GetToggleIsOn(),
ChatMessageType.Game => messageTypeToggleRow.GameToggle.GetToggleIsOn(),
ChatMessageType.Gesture => messageTypeToggleRow.EmoteToggle.GetToggleIsOn(),
ChatMessageType.Emote => messageTypeToggleRow.EmoteToggle.GetToggleIsOn(),
_ => true,
};
}
}
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
public static class ChatTextInputUtils
{
public static string ChatTextInputPrefix { get; private set; } = "say ";
public static void SetChatTextInputPrefix(this ChatPanel chatPanel, Type talkerType)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Invalid comparison between Unknown and I4
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Invalid comparison between Unknown and I4
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: 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)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Invalid comparison between Unknown and I4
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: 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)
string chatTextInputPrefix = (((int)talkerType == 0) ? "w " : (((int)talkerType != 2) ? "say " : "s "));
ChatTextInputPrefix = chatTextInputPrefix;
chatTextInputPrefix = (((int)talkerType == 0) ? "/whisper" : (((int)talkerType != 2) ? "/say " : "/shout"));
string text = chatTextInputPrefix;
Color val = (((int)talkerType == 0) ? PluginConfig.ChatMessageTextWhisperColor.Value : (((int)talkerType != 2) ? PluginConfig.ChatMessageTextSayColor.Value : PluginConfig.ChatMessageTextShoutColor.Value));
Color color = val;
((Graphic)((TMP_InputField)chatPanel.TextInput.InputField).textComponent).color = color;
((TMP_Text)chatPanel.TextInput.InputFieldPlaceholder).text = text;
((Graphic)chatPanel.TextInput.InputFieldPlaceholder).color = color.SetAlpha(0.3f);
}
}
public static class WorldTextUtils
{
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
public static GameObject CreateWorldTextTemplate(Transform parentTransform)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Expected O, but got Unknown
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: 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_007c: 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_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Expected O, but got Unknown
GameObject val = new GameObject("WorldText", new Type[1] { typeof(RectTransform) });
GameObjectExtensions.SetParent(val, parentTransform);
val.GetComponent<RectTransform>().SetAnchorMin(new Vector2(0.5f, 0f)).SetAnchorMax(new Vector2(0.5f, 0f))
.SetPivot(new Vector2(0.5f, 0f))
.SetPosition(Vector2.zero)
.SetSizeDelta(new Vector2(400f, 100f));
TextMeshProUGUI obj = UIBuilder.CreateLabel(val.transform);
((Object)obj).name = "Text";
((TMP_Text)obj).rectTransform.SetAnchorMin(Vector2.zero).SetAnchorMax(Vector2.one).SetPivot(new Vector2(0.5f, 0.5f))
.SetPosition(Vector2.zero)
.SetSizeDelta(Vector2.zero);
((TMP_Text)obj).alignment = (TextAlignmentOptions)514;
((TMP_Text)obj).fontSize = 18f;
return val;
}
}
public static class CodeMatcherExtensions
{
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
public static CodeMatcher CopyOperand<[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(2)] T>(this CodeMatcher matcher, out T target)
{
target = (T)matcher.Operand;
return matcher;
}
}
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(1)]
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(0)]
public static class ConfigFileExtensions
{
[<235e2840-11ab-40c1-85e0-a1ba85921bf5>NullableContext(0)]
internal sealed class ConfigurationManagerAttributes
{
[<30ea76a9-0cb6-42f7-8a3b-4c05ef4a33a2>Nullable(1)]
public Action<ConfigEntryBase> CustomDrawer;
public bool? Browsable;
public bool? HideDefaultButton;
public bool? HideSettingName;
public bool? IsAdvanced;
public int? Order;
public bool? ReadOnly;
}
private static readonly Dictionary<string, int> _sectionToSettingOrder = new Dictionary<string, int>();
private static int GetSettingOrder(string section)
{
if (!_sectionToSettingOrder.TryGetValue(section, out var value))
{
value = 0;
}
_sectionToSetting