using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using ExitGames.Client.Photon;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Photon.Pun;
using Photon.Realtime;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace CustomColors
{
[HarmonyPatch(typeof(SemiFunc))]
internal static class ColorPatch
{
[HarmonyPostfix]
[HarmonyPatch("PlayerGetColorMain")]
private static void AfterPlayerGetColorMain(PlayerAvatar _player, ref Color __result)
{
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
if (Plugin.Enabled.Value)
{
Color? val = ColorSync.Lookup(_player);
if (val.HasValue)
{
__result = val.Value;
}
}
}
}
internal class ColorPicker : MonoBehaviour
{
private bool _open;
private int _row;
private float[] _rgb = new float[3] { 0.31f, 0.76f, 0.97f };
private bool _loaded;
private static readonly string[] Names = new string[3] { "Red", "Green", "Blue" };
private void Update()
{
//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_009c: Unknown result type (might be due to invalid IL or missing references)
if (!Plugin.Enabled.Value)
{
return;
}
if (!_loaded)
{
Color? val = ColorSync.Parse(Plugin.MyColor.Value);
if (val.HasValue)
{
_rgb[0] = val.Value.r;
_rgb[1] = val.Value.g;
_rgb[2] = val.Value.b;
}
_loaded = true;
Publish();
}
if (!SemiFunc.RunIsShop() && !SemiFunc.RunIsLobby() && !SemiFunc.RunIsLobbyMenu())
{
_open = false;
return;
}
if (Input.GetKeyDown(Plugin.ToggleKey.Value))
{
_open = !_open;
if (!_open)
{
Publish();
}
}
if (_open)
{
if (Input.GetKeyDown((KeyCode)274))
{
_row = (_row + 1) % 3;
}
if (Input.GetKeyDown((KeyCode)273))
{
_row = (_row + 2) % 3;
}
float num = (Input.GetKey((KeyCode)304) ? 0.02f : 0.08f);
if (Input.GetKeyDown((KeyCode)275))
{
Nudge(num);
}
if (Input.GetKeyDown((KeyCode)276))
{
Nudge(0f - num);
}
}
}
private void Nudge(float delta)
{
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
_rgb[_row] = Mathf.Clamp01(Mathf.Round((_rgb[_row] + delta) * 100f) / 100f);
Plugin.MyColor.Value = "#" + ColorUtility.ToHtmlStringRGB(Current());
}
private Color Current()
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
return new Color(_rgb[0], _rgb[1], _rgb[2]);
}
private void Publish()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
ColorSync.Publish(Current());
}
private void OnGUI()
{
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: 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_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_016a: Unknown result type (might be due to invalid IL or missing references)
if (_open)
{
Rect val = default(Rect);
((Rect)(ref val))..ctor(24f, 24f, 320f, 190f);
GUI.color = new Color(0f, 0f, 0f, 0.82f);
GUI.Box(val, GUIContent.none);
GUI.color = Color.white;
GUILayout.BeginArea(new Rect(((Rect)(ref val)).x + 14f, ((Rect)(ref val)).y + 12f, ((Rect)(ref val)).width - 28f, ((Rect)(ref val)).height - 24f));
GUILayout.Label("Your colour", Rich(), Array.Empty());
GUI.color = Current();
GUILayout.Box(GUIContent.none, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(18f) });
GUI.color = Color.white;
GUILayout.Space(4f);
for (int i = 0; i < 3; i++)
{
string arg = ((_row == i) ? "> " : " ");
int num = Mathf.RoundToInt(_rgb[i] * 100f);
GUILayout.Label($"{arg}{Names[i],-6} {num,3}%", Rich(), Array.Empty());
}
GUILayout.Space(6f);
GUILayout.Label("" + Plugin.MyColor.Value + " · Up/Down select · Left/Right adjust\n" + $"Shift for fine · {Plugin.ToggleKey.Value} closes and applies", Rich(), Array.Empty());
GUILayout.EndArea();
}
}
private static GUIStyle Rich()
{
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: 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_001e: Expected O, but got Unknown
return new GUIStyle(GUI.skin.label)
{
richText = true,
wordWrap = true
};
}
}
internal static class ColorSync
{
private const string Key = "bcol";
internal static void Publish(Color colour)
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Expected O, but got Unknown
//IL_0032: Expected O, but got Unknown
if (PhotonNetwork.IsConnected && PhotonNetwork.LocalPlayer != null)
{
string text = "#" + ColorUtility.ToHtmlStringRGB(colour);
Hashtable val = new Hashtable();
((Dictionary