using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using Microsoft.CodeAnalysis;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ReadMePEAK.ReadMePEAK")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.2.2.0")]
[assembly: AssemblyInformationalVersion("0.2.2")]
[assembly: AssemblyProduct("ReadMePEAK.ReadMePEAK")]
[assembly: AssemblyTitle("ReadMePEAK")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.2.2.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[CompilerGenerated]
[Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace BepInEx
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
[Conditional("CodeGeneration")]
[Embedded]
internal sealed class BepInAutoPluginAttribute : Attribute
{
public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
{
}
}
}
namespace BepInEx.Preloader.Core.Patching
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
[Conditional("CodeGeneration")]
[Embedded]
internal sealed class PatcherAutoPluginAttribute : Attribute
{
public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
{
}
}
}
namespace Microsoft.CodeAnalysis
{
[Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace ReadMePEAK
{
[BepInPlugin("ReadMePEAK.ReadMePEAK", "ReadMePEAK", "0.2.2")]
public class Plugin : BaseUnityPlugin
{
private sealed class ModEntry
{
internal PluginInfo Plugin { get; }
internal string Name { get; }
internal string Guid { get; }
internal string Version { get; }
internal ModEntry(PluginInfo plugin)
{
Plugin = plugin;
Name = plugin.Metadata.Name;
Guid = plugin.Metadata.GUID;
Version = plugin.Metadata.Version.ToString();
}
}
private readonly List<ModEntry> _mods = new List<ModEntry>();
private readonly List<ModEntry> _filteredMods = new List<ModEntry>();
private ConfigEntry<KeyboardShortcut> _toggleKey;
private string _search = string.Empty;
private ModEntry? _selectedMod;
private string _readmeText = string.Empty;
private string _readmeStatus = "Choose a mod to view its README.";
private Vector2 _modListScroll;
private Vector2 _readmeScroll;
private bool _isOpen;
private bool _isExpanded;
private GUIStyle? _titleStyle;
private GUIStyle? _bodyStyle;
private GUIStyle? _mutedStyle;
private GUIStyle? _eyebrowStyle;
private GUIStyle? _windowStyle;
private GUIStyle? _cardStyle;
private GUIStyle? _searchStyle;
private GUIStyle? _buttonStyle;
private GUIStyle? _selectedButtonStyle;
private readonly List<Texture2D> _styleTextures = new List<Texture2D>();
public const string Id = "ReadMePEAK.ReadMePEAK";
internal static ManualLogSource Log { get; private set; }
private string ReadmeDirectory => Path.Combine(Paths.ConfigPath, "ReadMePEAK");
public static string Name => "ReadMePEAK";
public static string Version => "0.2.2";
private void Awake()
{
//IL_0026: 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_0052: 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)
Log = ((BaseUnityPlugin)this).Logger;
_toggleKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("General", "ToggleKey", new KeyboardShortcut((KeyCode)288, Array.Empty<KeyCode>()), "Key used to open or close the in-game mod README browser.");
if (((object)_toggleKey.Value/*cast due to .constrained prefix*/).Equals((object)new KeyboardShortcut((KeyCode)289, Array.Empty<KeyCode>())))
{
_toggleKey.Value = new KeyboardShortcut((KeyCode)288, Array.Empty<KeyCode>());
((BaseUnityPlugin)this).Config.Save();
}
Directory.CreateDirectory(ReadmeDirectory);
Log.LogInfo((object)"ReadMePEAK is ready. Press F7 to browse loaded mods.");
}
private void Update()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
KeyboardShortcut value = _toggleKey.Value;
if (((KeyboardShortcut)(ref value)).IsDown())
{
_isOpen = !_isOpen;
if (_isOpen)
{
ReloadMods();
}
}
}
private void ReloadMods()
{
_mods.Clear();
foreach (PluginInfo item in Chainloader.PluginInfos.Values.Where((PluginInfo plugin) => !string.Equals(plugin.Metadata.GUID, "ReadMePEAK.ReadMePEAK", StringComparison.OrdinalIgnoreCase)).OrderBy<PluginInfo, string>((PluginInfo plugin) => plugin.Metadata.Name, StringComparer.OrdinalIgnoreCase))
{
_mods.Add(new ModEntry(item));
}
FilterMods();
if (_selectedMod != null && _mods.Contains(_selectedMod))
{
SelectMod(_selectedMod);
}
else if (_filteredMods.Count > 0)
{
SelectMod(_filteredMods[0]);
}
else
{
ClearSelection("No other BepInEx mods are loaded.");
}
}
private void FilterMods()
{
string query = _search.Trim();
_filteredMods.Clear();
_filteredMods.AddRange(_mods.Where((ModEntry mod) => query.Length == 0 || mod.Name.IndexOf(query, StringComparison.OrdinalIgnoreCase) >= 0 || mod.Guid.IndexOf(query, StringComparison.OrdinalIgnoreCase) >= 0));
if (_selectedMod != null && !_filteredMods.Contains(_selectedMod))
{
if (_filteredMods.Count > 0)
{
SelectMod(_filteredMods[0]);
}
else
{
ClearSelection("No mods match your search.");
}
}
else if (_selectedMod == null && _filteredMods.Count > 0)
{
SelectMod(_filteredMods[0]);
}
else if (_filteredMods.Count == 0)
{
ClearSelection((_mods.Count == 0) ? "No other BepInEx mods are loaded." : "No mods match your search.");
}
}
private void SelectMod(ModEntry mod)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
_selectedMod = mod;
_readmeScroll = Vector2.zero;
string text = FindBundledReadme(mod.Plugin);
if (text == null)
{
text = FindUserReadme(mod);
}
if (text == null)
{
_readmeText = string.Empty;
_readmeStatus = "This mod has no README file installed.\n\nIf its README is only on Thunderstore, copy it into this folder as either " + mod.Guid + ".md or " + mod.Guid + ".txt:\n" + ReadmeDirectory + "\n\nThen press Refresh.";
return;
}
try
{
_readmeText = File.ReadAllText(text);
_readmeStatus = "README: " + Path.GetFileName(text);
}
catch (Exception ex)
{
_readmeText = string.Empty;
_readmeStatus = "Could not read this README: " + ex.Message;
Log.LogWarning((object)("Could not read README for " + mod.Name + " at '" + text + "': " + ex.Message));
}
}
private string? FindBundledReadme(PluginInfo plugin)
{
string directoryName = Path.GetDirectoryName(plugin.Location);
if (string.IsNullOrEmpty(directoryName) || !Directory.Exists(directoryName))
{
return null;
}
try
{
IEnumerable<string> source = Directory.EnumerateFiles(directoryName, "*");
if (Path.GetFileName(directoryName).Equals("plugins", StringComparison.OrdinalIgnoreCase))
{
string safeName = string.Concat(plugin.Metadata.Name.Select((char character) => (!Path.GetInvalidFileNameChars().Contains(character)) ? character : '_'));
source = source.Where((string path) => Path.GetFileName(path).Equals(plugin.Metadata.GUID + ".md", StringComparison.OrdinalIgnoreCase) || Path.GetFileName(path).Equals(plugin.Metadata.GUID + ".txt", StringComparison.OrdinalIgnoreCase) || Path.GetFileName(path).Equals(safeName + ".md", StringComparison.OrdinalIgnoreCase) || Path.GetFileName(path).Equals(safeName + ".txt", StringComparison.OrdinalIgnoreCase));
}
else
{
source = source.Where((string path) => Path.GetFileName(path).StartsWith("README", StringComparison.OrdinalIgnoreCase) && IsReadmeFile(path));
}
return (from path in source.Where(IsReadmeFile)
orderby (!Path.GetFileName(path).Equals("README.md", StringComparison.OrdinalIgnoreCase)) ? 1 : 0
select path).FirstOrDefault();
}
catch (Exception ex)
{
Log.LogDebug((object)("Could not search for a bundled README beside " + plugin.Metadata.Name + ": " + ex.Message));
return null;
}
}
private string? FindUserReadme(ModEntry mod)
{
string[] array = new string[2] { ".md", ".txt" };
foreach (string text in array)
{
string text2 = Path.Combine(ReadmeDirectory, mod.Guid + text);
if (File.Exists(text2))
{
return text2;
}
string text3 = string.Concat(mod.Name.Select((char character) => (!Path.GetInvalidFileNameChars().Contains(character)) ? character : '_'));
string text4 = Path.Combine(ReadmeDirectory, text3 + text);
if (File.Exists(text4))
{
return text4;
}
}
return null;
}
private static bool IsReadmeFile(string path)
{
string fileName = Path.GetFileName(path);
if (!fileName.Equals("README.md", StringComparison.OrdinalIgnoreCase) && !fileName.Equals("README.txt", StringComparison.OrdinalIgnoreCase) && !fileName.Equals("README.rst", StringComparison.OrdinalIgnoreCase) && !fileName.EndsWith(".md", StringComparison.OrdinalIgnoreCase))
{
return fileName.EndsWith(".txt", StringComparison.OrdinalIgnoreCase);
}
return true;
}
private void ClearSelection(string message)
{
_selectedMod = null;
_readmeText = string.Empty;
_readmeStatus = message;
}
private void OnGUI()
{
//IL_0094: 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_00b1: Expected O, but got Unknown
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
if (_isOpen)
{
EnsureStyles();
float num = (_isExpanded ? ((float)Screen.width - 40f) : Mathf.Min(940f, (float)Screen.width - 48f));
float num2 = (_isExpanded ? ((float)Screen.height - 40f) : Mathf.Min(620f, (float)Screen.height - 48f));
Rect val = default(Rect);
((Rect)(ref val))..ctor(((float)Screen.width - num) / 2f, ((float)Screen.height - num2) / 2f, num, num2);
GUI.ModalWindow(((Object)this).GetInstanceID(), val, new WindowFunction(DrawWindow), "ReadMePEAK / MOD LIBRARY", _windowStyle);
}
}
private void DrawWindow(int windowId)
{
//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
//IL_020c: Unknown result type (might be due to invalid IL or missing references)
//IL_0211: Unknown result type (might be due to invalid IL or missing references)
//IL_0416: Unknown result type (might be due to invalid IL or missing references)
//IL_0386: Unknown result type (might be due to invalid IL or missing references)
//IL_039a: Unknown result type (might be due to invalid IL or missing references)
//IL_039f: Unknown result type (might be due to invalid IL or missing references)
GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
GUILayout.BeginVertical(_cardStyle, Array.Empty<GUILayoutOption>());
GUILayout.Label("FIELD GUIDE / MOD LIBRARY", _eyebrowStyle, Array.Empty<GUILayoutOption>());
GUILayout.Label("Pick a mod. Find the notes. Get back to the climb.", _mutedStyle, Array.Empty<GUILayoutOption>());
GUILayout.EndVertical();
GUILayout.Space(8f);
GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
GUILayout.Label("FIND", _eyebrowStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(55f) });
string text = GUILayout.TextField(_search, _searchStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
if (text != _search)
{
_search = text;
FilterMods();
}
if (GUILayout.Button("↻ Refresh", _buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
{
GUILayout.Width(105f),
GUILayout.Height(34f)
}))
{
ReloadMods();
}
if (GUILayout.Button(_isExpanded ? "Restore size" : "Make bigger", _buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
{
GUILayout.Width(115f),
GUILayout.Height(34f)
}))
{
_isExpanded = !_isExpanded;
}
if (GUILayout.Button("Close", _buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
{
GUILayout.Width(75f),
GUILayout.Height(34f)
}))
{
_isOpen = false;
}
GUILayout.EndHorizontal();
GUILayout.Space(8f);
GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
GUILayout.BeginVertical(_cardStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
{
GUILayout.Width(_isExpanded ? 330f : 270f),
GUILayout.ExpandHeight(true)
});
GUILayout.Label($"YOUR MODS / {_filteredMods.Count}", _eyebrowStyle, Array.Empty<GUILayoutOption>());
_modListScroll = GUILayout.BeginScrollView(_modListScroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandHeight(true) });
if (_filteredMods.Count == 0)
{
GUILayout.Label((_mods.Count == 0) ? "No other BepInEx mods are loaded." : "No mods match your search.", _mutedStyle, Array.Empty<GUILayoutOption>());
}
else
{
foreach (ModEntry filteredMod in _filteredMods)
{
bool flag = filteredMod == _selectedMod;
if (GUILayout.Button(filteredMod.Name, flag ? _selectedButtonStyle : _buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
{
GUILayout.ExpandWidth(true),
GUILayout.MinHeight(38f)
}))
{
SelectMod(filteredMod);
}
}
}
GUILayout.EndScrollView();
GUILayout.EndVertical();
GUILayout.Space(8f);
GUILayout.BeginVertical(_cardStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
{
GUILayout.ExpandWidth(true),
GUILayout.ExpandHeight(true)
});
if (_selectedMod != null)
{
GUILayout.Label(_selectedMod.Name, _titleStyle, Array.Empty<GUILayoutOption>());
GUILayout.Label("PLUGIN ID / " + _selectedMod.Guid + " / v" + _selectedMod.Version, _eyebrowStyle, Array.Empty<GUILayoutOption>());
}
GUILayout.Space(5f);
GUILayout.Label(_readmeStatus, _mutedStyle, Array.Empty<GUILayoutOption>());
if (!string.IsNullOrEmpty(_readmeText))
{
_readmeScroll = GUILayout.BeginScrollView(_readmeScroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandHeight(true) });
GUILayout.Label(_readmeText, _bodyStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
GUILayout.EndScrollView();
}
GUILayout.EndVertical();
GUILayout.EndHorizontal();
GUILayout.Space(5f);
GUILayout.Label("F7 / TOGGLE README folder: " + ReadmeDirectory, _eyebrowStyle, Array.Empty<GUILayoutOption>());
GUILayout.EndVertical();
GUI.DragWindow(new Rect(0f, 0f, 10000f, 24f));
}
private void EnsureStyles()
{
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//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_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: 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_0074: 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_0090: 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_00ad: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0131: Unknown result type (might be due to invalid IL or missing references)
//IL_013b: Expected O, but got Unknown
//IL_0147: Unknown result type (might be due to invalid IL or missing references)
//IL_0160: Unknown result type (might be due to invalid IL or missing references)
//IL_016a: Expected O, but got Unknown
//IL_0177: Unknown result type (might be due to invalid IL or missing references)
//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
//IL_01bc: Expected O, but got Unknown
//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
//IL_0202: Expected O, but got Unknown
//IL_0227: Unknown result type (might be due to invalid IL or missing references)
//IL_023e: Unknown result type (might be due to invalid IL or missing references)
//IL_0248: Expected O, but got Unknown
//IL_0253: Unknown result type (might be due to invalid IL or missing references)
//IL_0258: Unknown result type (might be due to invalid IL or missing references)
//IL_0260: Unknown result type (might be due to invalid IL or missing references)
//IL_0267: Unknown result type (might be due to invalid IL or missing references)
//IL_026e: Unknown result type (might be due to invalid IL or missing references)
//IL_0273: Unknown result type (might be due to invalid IL or missing references)
//IL_027d: Expected O, but got Unknown
//IL_027d: Unknown result type (might be due to invalid IL or missing references)
//IL_0283: Unknown result type (might be due to invalid IL or missing references)
//IL_028e: Expected O, but got Unknown
//IL_0299: Unknown result type (might be due to invalid IL or missing references)
//IL_029e: Unknown result type (might be due to invalid IL or missing references)
//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
//IL_02c3: Expected O, but got Unknown
//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
//IL_02d4: Expected O, but got Unknown
//IL_02df: Unknown result type (might be due to invalid IL or missing references)
//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
//IL_02f9: Unknown result type (might be due to invalid IL or missing references)
//IL_0304: Expected O, but got Unknown
//IL_030f: Unknown result type (might be due to invalid IL or missing references)
//IL_0314: Unknown result type (might be due to invalid IL or missing references)
//IL_031c: Unknown result type (might be due to invalid IL or missing references)
//IL_0323: Unknown result type (might be due to invalid IL or missing references)
//IL_032a: Unknown result type (might be due to invalid IL or missing references)
//IL_0341: Unknown result type (might be due to invalid IL or missing references)
//IL_0346: Unknown result type (might be due to invalid IL or missing references)
//IL_0355: Expected O, but got Unknown
if (_titleStyle == null)
{
Color textColor = Color32.op_Implicit(new Color32((byte)231, (byte)240, (byte)243, byte.MaxValue));
Color textColor2 = Color32.op_Implicit(new Color32((byte)157, (byte)178, (byte)187, byte.MaxValue));
Texture2D background = MakeTexture(Color32.op_Implicit(new Color32((byte)17, (byte)27, (byte)36, byte.MaxValue)));
Texture2D background2 = MakeTexture(Color32.op_Implicit(new Color32((byte)27, (byte)42, (byte)53, byte.MaxValue)));
Texture2D background3 = MakeTexture(Color32.op_Implicit(new Color32((byte)37, (byte)57, (byte)68, byte.MaxValue)));
Texture2D background4 = MakeTexture(Color32.op_Implicit(new Color32((byte)49, (byte)76, (byte)86, byte.MaxValue)));
Texture2D background5 = MakeTexture(Color32.op_Implicit(new Color32((byte)34, (byte)110, (byte)111, byte.MaxValue)));
Texture2D background6 = MakeTexture(Color32.op_Implicit(new Color32((byte)12, (byte)20, (byte)27, byte.MaxValue)));
_windowStyle = MakeStyle(GUI.skin.window, background, textColor);
_windowStyle.fontSize = 15;
_windowStyle.fontStyle = (FontStyle)1;
_windowStyle.padding = new RectOffset(12, 12, 32, 12);
_cardStyle = MakeStyle(GUI.skin.box, background2, textColor);
_cardStyle.padding = new RectOffset(12, 12, 10, 10);
_buttonStyle = MakeStyle(GUI.skin.button, background3, textColor);
_buttonStyle.hover.background = background4;
_buttonStyle.active.background = background5;
_buttonStyle.padding = new RectOffset(10, 10, 7, 7);
_buttonStyle.alignment = (TextAnchor)3;
_buttonStyle.wordWrap = true;
_selectedButtonStyle = MakeStyle(GUI.skin.button, background5, textColor);
_selectedButtonStyle.padding = new RectOffset(10, 10, 7, 7);
_selectedButtonStyle.alignment = (TextAnchor)3;
_selectedButtonStyle.wordWrap = true;
_searchStyle = MakeStyle(GUI.skin.textField, background6, textColor);
_searchStyle.padding = new RectOffset(10, 10, 7, 7);
GUIStyle val = new GUIStyle(GUI.skin.label)
{
fontSize = 25,
fontStyle = (FontStyle)1,
wordWrap = true,
margin = new RectOffset(2, 8, 8, 6)
};
val.normal.textColor = textColor;
_titleStyle = val;
GUIStyle val2 = new GUIStyle(GUI.skin.label)
{
fontSize = 16,
wordWrap = true,
richText = false,
padding = new RectOffset(4, 8, 8, 8)
};
val2.normal.textColor = textColor;
_bodyStyle = val2;
GUIStyle val3 = new GUIStyle(GUI.skin.label)
{
fontSize = 13,
wordWrap = true
};
val3.normal.textColor = textColor2;
_mutedStyle = val3;
GUIStyle val4 = new GUIStyle(GUI.skin.label)
{
fontSize = 11,
fontStyle = (FontStyle)1,
wordWrap = true
};
val4.normal.textColor = Color32.op_Implicit(new Color32((byte)105, (byte)208, (byte)195, byte.MaxValue));
_eyebrowStyle = val4;
}
}
private Texture2D MakeTexture(Color color)
{
//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)
//IL_0010: Expected O, but got Unknown
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
Texture2D val = new Texture2D(1, 1)
{
hideFlags = (HideFlags)61
};
val.SetPixel(0, 0, color);
val.Apply();
_styleTextures.Add(val);
return val;
}
private static GUIStyle MakeStyle(GUIStyle source, Texture2D background, Color textColor)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_006d: 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_0085: 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_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00b5: 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)
GUIStyle val = new GUIStyle(source);
val.normal.background = background;
val.hover.background = background;
val.active.background = background;
val.focused.background = background;
val.onNormal.background = background;
val.onHover.background = background;
val.onActive.background = background;
val.onFocused.background = background;
val.normal.textColor = textColor;
val.hover.textColor = textColor;
val.active.textColor = textColor;
val.focused.textColor = textColor;
val.onNormal.textColor = textColor;
val.onHover.textColor = textColor;
val.onActive.textColor = textColor;
val.onFocused.textColor = textColor;
return val;
}
private void OnDestroy()
{
foreach (Texture2D styleTexture in _styleTextures)
{
Object.Destroy((Object)(object)styleTexture);
}
_styleTextures.Clear();
}
}
}
namespace System.Diagnostics.CodeAnalysis
{
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class ConstantExpectedAttribute : Attribute
{
public object? Min { get; set; }
public object? Max { get; set; }
}
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class ExperimentalAttribute : Attribute
{
public string DiagnosticId { get; }
public string? UrlFormat { get; set; }
public ExperimentalAttribute(string diagnosticId)
{
DiagnosticId = diagnosticId;
}
}
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
[ExcludeFromCodeCoverage]
internal sealed class MemberNotNullAttribute : Attribute
{
public string[] Members { get; }
public MemberNotNullAttribute(string member)
{
Members = new string[1] { member };
}
public MemberNotNullAttribute(params string[] members)
{
Members = members;
}
}
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
[ExcludeFromCodeCoverage]
internal sealed class MemberNotNullWhenAttribute : Attribute
{
public bool ReturnValue { get; }
public string[] Members { get; }
public MemberNotNullWhenAttribute(bool returnValue, string member)
{
ReturnValue = returnValue;
Members = new string[1] { member };
}
public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
{
ReturnValue = returnValue;
Members = members;
}
}
[AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class SetsRequiredMembersAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class StringSyntaxAttribute : Attribute
{
public const string CompositeFormat = "CompositeFormat";
public const string DateOnlyFormat = "DateOnlyFormat";
public const string DateTimeFormat = "DateTimeFormat";
public const string EnumFormat = "EnumFormat";
public const string GuidFormat = "GuidFormat";
public const string Json = "Json";
public const string NumericFormat = "NumericFormat";
public const string Regex = "Regex";
public const string TimeOnlyFormat = "TimeOnlyFormat";
public const string TimeSpanFormat = "TimeSpanFormat";
public const string Uri = "Uri";
public const string Xml = "Xml";
public string Syntax { get; }
public object?[] Arguments { get; }
public StringSyntaxAttribute(string syntax)
{
Syntax = syntax;
Arguments = new object[0];
}
public StringSyntaxAttribute(string syntax, params object?[] arguments)
{
Syntax = syntax;
Arguments = arguments;
}
}
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class UnscopedRefAttribute : Attribute
{
}
}
namespace System.Runtime.Versioning
{
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class RequiresPreviewFeaturesAttribute : Attribute
{
public string? Message { get; }
public string? Url { get; set; }
public RequiresPreviewFeaturesAttribute()
{
}
public RequiresPreviewFeaturesAttribute(string? message)
{
Message = message;
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class CallerArgumentExpressionAttribute : Attribute
{
public string ParameterName { get; }
public CallerArgumentExpressionAttribute(string parameterName)
{
ParameterName = parameterName;
}
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class CollectionBuilderAttribute : Attribute
{
public Type BuilderType { get; }
public string MethodName { get; }
public CollectionBuilderAttribute(Type builderType, string methodName)
{
BuilderType = builderType;
MethodName = methodName;
}
}
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class CompilerFeatureRequiredAttribute : Attribute
{
public const string RefStructs = "RefStructs";
public const string RequiredMembers = "RequiredMembers";
public string FeatureName { get; }
public bool IsOptional { get; set; }
public CompilerFeatureRequiredAttribute(string featureName)
{
FeatureName = featureName;
}
}
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class InterpolatedStringHandlerArgumentAttribute : Attribute
{
public string[] Arguments { get; }
public InterpolatedStringHandlerArgumentAttribute(string argument)
{
Arguments = new string[1] { argument };
}
public InterpolatedStringHandlerArgumentAttribute(params string[] arguments)
{
Arguments = arguments;
}
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class InterpolatedStringHandlerAttribute : Attribute
{
}
[EditorBrowsable(EditorBrowsableState.Never)]
[ExcludeFromCodeCoverage]
internal static class IsExternalInit
{
}
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class ModuleInitializerAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class OverloadResolutionPriorityAttribute : Attribute
{
public int Priority { get; }
public OverloadResolutionPriorityAttribute(int priority)
{
Priority = priority;
}
}
[AttributeUsage(AttributeTargets.Parameter, Inherited = true, AllowMultiple = false)]
[ExcludeFromCodeCoverage]
internal sealed class ParamCollectionAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class RequiredMemberAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[ExcludeFromCodeCoverage]
internal sealed class RequiresLocationAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Event | AttributeTargets.Interface, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class SkipLocalsInitAttribute : Attribute
{
}
}