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.IL2CPP;
using HarmonyLib;
using Il2CppSystem.Collections.Generic;
using Microsoft.CodeAnalysis;
using UnhollowerRuntimeLib;
using UnityEngine;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("Antro.CustomOutline")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Antro.CustomOutline")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]
[assembly: AssemblyProduct("Antro.CustomOutline")]
[assembly: AssemblyTitle("Antro.CustomOutline")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.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 Antro.CustomOutline
{
public enum OutlineMode
{
Normal,
Rainbow,
Pulse,
Police,
Golden,
Toxic,
Glitch,
Angelic,
Disco,
Fire,
Ice,
Void,
Heartbeat,
Chroma,
Danger,
LoadingBar
}
[BepInPlugin("Antro.CustomOutline", "Antro Custom Outline", "2.4.0")]
public class MainPlugin : BasePlugin
{
public override void Load()
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
ClassInjector.RegisterTypeInIl2Cpp<OutlineController>();
GameObject val = new GameObject("AntroOutline_Manager");
Object.DontDestroyOnLoad((Object)(object)val);
((Object)val).hideFlags = (HideFlags)61;
val.AddComponent<OutlineController>();
try
{
Harmony.CreateAndPatchAll(typeof(Patches), (string)null);
}
catch (Exception ex)
{
((BasePlugin)this).Log.LogError((object)("Harmony Error: " + ex.Message));
}
((BasePlugin)this).Log.LogInfo((object)"[Antro.CustomOutline 2.4.0] Loaded.");
}
}
public class OutlineController : MonoBehaviour
{
private bool _showMenu = false;
private Rect _windowRect = new Rect(50f, 50f, 350f, 680f);
private GUIStyle _headerStyle;
private bool _stylesInit = false;
public static bool IsEnabled = true;
public static OutlineMode CurrentMode = OutlineMode.Rainbow;
public static HashSet<ulong> TaggedPlayers = new HashSet<ulong>();
private float _hue = 0f;
private float _discoTimer = 0f;
private float _glitchTimer = 0f;
private float _listUpdateTimer = 0f;
private Color _currentDiscoColor = Color.white;
private Color _currentGlitchColor = Color.cyan;
private float _currentGlitchWidth = 10f;
private bool _reflectionInitialized = false;
private Type _nextGenSettingsType;
private FieldInfo _nextGenToggleField;
private FieldInfo _nextGenBoolField;
public OutlineController(IntPtr ptr)
: base(ptr)
{
}//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: 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)
private void Start()
{
InitNextGenReflection();
}
private void Update()
{
if (!_reflectionInitialized)
{
InitNextGenReflection();
}
if (Input.GetKeyDown((KeyCode)288))
{
_showMenu = !_showMenu;
if (_showMenu)
{
Cursor.visible = true;
Cursor.lockState = (CursorLockMode)0;
}
else if ((Object)(object)MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance != (Object)null)
{
Cursor.lockState = (CursorLockMode)1;
}
}
if (IsEnabled && (Object)(object)MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance != (Object)null)
{
_listUpdateTimer += Time.deltaTime;
if (_listUpdateTimer >= 1f)
{
AutoAddAllPlayers();
_listUpdateTimer = 0f;
}
ApplyEffects();
}
}
private void LateUpdate()
{
ForceDisableNextGenLoop();
}
private void InitNextGenReflection()
{
try
{
Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
foreach (Assembly assembly in assemblies)
{
Type type = assembly.GetType("NextGenMods.SettingsNextGen");
if (type != null)
{
_nextGenSettingsType = type;
_nextGenToggleField = type.GetField("RGBTagToggle", BindingFlags.Static | BindingFlags.Public);
_nextGenBoolField = type.GetField("RGBTagBool", BindingFlags.Static | BindingFlags.Public);
if (_nextGenSettingsType != null)
{
_reflectionInitialized = true;
}
break;
}
}
}
catch
{
}
}
private void ForceDisableNextGenLoop()
{
if (!_reflectionInitialized)
{
return;
}
try
{
if (_nextGenBoolField != null)
{
_nextGenBoolField.SetValue(null, false);
}
if (!(_nextGenToggleField != null))
{
return;
}
object? value = _nextGenToggleField.GetValue(null);
GameObject val = (GameObject)((value is GameObject) ? value : null);
if ((Object)(object)val != (Object)null)
{
Toggle component = val.GetComponent<Toggle>();
if ((Object)(object)component != (Object)null && component.isOn)
{
component.isOn = false;
}
}
}
catch
{
}
}
private void AutoAddAllPlayers()
{
ulong mySteamID = GetMySteamID();
Enumerator<ulong, MonoBehaviourPublicCSstReshTrheObplBojuUnique> enumerator = MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers.GetEnumerator();
while (enumerator.MoveNext())
{
KeyValuePair<ulong, MonoBehaviourPublicCSstReshTrheObplBojuUnique> current = enumerator.Current;
if (current.Key != mySteamID)
{
TaggedPlayers.Add(current.Key);
}
}
}
private void OnGUI()
{
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: 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_004f: Expected O, but got Unknown
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
if (_showMenu)
{
if (!_stylesInit)
{
_headerStyle = new GUIStyle(GUI.skin.label)
{
alignment = (TextAnchor)4,
fontStyle = (FontStyle)1,
fontSize = 14
};
_headerStyle.normal.textColor = Color.yellow;
_stylesInit = true;
}
GUI.backgroundColor = new Color(0.1f, 0.1f, 0.1f, 0.95f);
GUI.contentColor = Color.white;
_windowRect = GUI.Window(1337, _windowRect, WindowFunction.op_Implicit((Action<int>)DrawWindow), "Antro.CustomOutline Settings");
}
}
private void DrawWindow(int id)
{
//IL_0015: 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_003d: 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_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_013f: Unknown result type (might be due to invalid IL or missing references)
//IL_0381: Unknown result type (might be due to invalid IL or missing references)
//IL_03bb: Unknown result type (might be due to invalid IL or missing references)
GUI.DragWindow(new Rect(0f, 0f, 10000f, 20f));
GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
GUILayout.Space(5f);
GUI.backgroundColor = (IsEnabled ? Color.green : Color.red);
if (GUILayout.Button(IsEnabled ? "STATUS: ENABLED" : "STATUS: DISABLED", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
{
IsEnabled = !IsEnabled;
}
GUI.backgroundColor = new Color(0.1f, 0.1f, 0.1f);
GUILayout.Space(10f);
GUILayout.Label($"Targets: {TaggedPlayers.Count}", _headerStyle, Array.Empty<GUILayoutOption>());
GUILayout.Label($"Mode: {CurrentMode}", _headerStyle, Array.Empty<GUILayoutOption>());
GUILayout.Space(10f);
GUI.backgroundColor = Color.gray;
if (GUILayout.Button("Normal (Default Red)", Array.Empty<GUILayoutOption>()))
{
CurrentMode = OutlineMode.Normal;
}
GUI.backgroundColor = new Color(0.1f, 0.1f, 0.1f);
GUILayout.Space(5f);
GUILayout.Label("Classic:", _headerStyle, Array.Empty<GUILayoutOption>());
if (GUILayout.Button("Rainbow", Array.Empty<GUILayoutOption>()))
{
CurrentMode = OutlineMode.Rainbow;
}
if (GUILayout.Button("Pulse", Array.Empty<GUILayoutOption>()))
{
CurrentMode = OutlineMode.Pulse;
}
if (GUILayout.Button("Police", Array.Empty<GUILayoutOption>()))
{
CurrentMode = OutlineMode.Police;
}
if (GUILayout.Button("Golden", Array.Empty<GUILayoutOption>()))
{
CurrentMode = OutlineMode.Golden;
}
GUILayout.Space(5f);
GUILayout.Label("Exotic:", _headerStyle, Array.Empty<GUILayoutOption>());
if (GUILayout.Button("Toxic", Array.Empty<GUILayoutOption>()))
{
CurrentMode = OutlineMode.Toxic;
}
if (GUILayout.Button("Glitch", Array.Empty<GUILayoutOption>()))
{
CurrentMode = OutlineMode.Glitch;
}
if (GUILayout.Button("Angelic", Array.Empty<GUILayoutOption>()))
{
CurrentMode = OutlineMode.Angelic;
}
if (GUILayout.Button("Disco", Array.Empty<GUILayoutOption>()))
{
CurrentMode = OutlineMode.Disco;
}
GUILayout.Space(5f);
GUILayout.Label("Interactive:", _headerStyle, Array.Empty<GUILayoutOption>());
if (GUILayout.Button("Loading Bar", Array.Empty<GUILayoutOption>()))
{
CurrentMode = OutlineMode.LoadingBar;
}
if (GUILayout.Button("Fire / Lava", Array.Empty<GUILayoutOption>()))
{
CurrentMode = OutlineMode.Fire;
}
if (GUILayout.Button("Ice / Frozen", Array.Empty<GUILayoutOption>()))
{
CurrentMode = OutlineMode.Ice;
}
GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
if (GUILayout.Button("Void", Array.Empty<GUILayoutOption>()))
{
CurrentMode = OutlineMode.Void;
}
if (GUILayout.Button("Chroma", Array.Empty<GUILayoutOption>()))
{
CurrentMode = OutlineMode.Chroma;
}
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
if (GUILayout.Button("Heartbeat", Array.Empty<GUILayoutOption>()))
{
CurrentMode = OutlineMode.Heartbeat;
}
if (GUILayout.Button("Danger", Array.Empty<GUILayoutOption>()))
{
CurrentMode = OutlineMode.Danger;
}
GUILayout.EndHorizontal();
GUILayout.Space(15f);
GUI.backgroundColor = new Color(0.5f, 0.1f, 0.1f);
if (GUILayout.Button("Reset", Array.Empty<GUILayoutOption>()))
{
TaggedPlayers.Clear();
}
GUI.backgroundColor = new Color(0.1f, 0.1f, 0.1f);
GUILayout.EndVertical();
}
private void ApplyEffects()
{
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_0117: Unknown result type (might be due to invalid IL or missing references)
//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
//IL_0136: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_014f: Unknown result type (might be due to invalid IL or missing references)
//IL_0154: Unknown result type (might be due to invalid IL or missing references)
//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
//IL_0302: Unknown result type (might be due to invalid IL or missing references)
//IL_0316: Unknown result type (might be due to invalid IL or missing references)
//IL_031d: Unknown result type (might be due to invalid IL or missing references)
//IL_0322: Unknown result type (might be due to invalid IL or missing references)
//IL_0348: Unknown result type (might be due to invalid IL or missing references)
//IL_034d: Unknown result type (might be due to invalid IL or missing references)
//IL_035c: Unknown result type (might be due to invalid IL or missing references)
//IL_0361: Unknown result type (might be due to invalid IL or missing references)
//IL_0390: Unknown result type (might be due to invalid IL or missing references)
//IL_0395: Unknown result type (might be due to invalid IL or missing references)
//IL_03ba: Unknown result type (might be due to invalid IL or missing references)
//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
//IL_03c6: Unknown result type (might be due to invalid IL or missing references)
//IL_03cb: Unknown result type (might be due to invalid IL or missing references)
//IL_03e8: Unknown result type (might be due to invalid IL or missing references)
//IL_03ed: Unknown result type (might be due to invalid IL or missing references)
//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
//IL_03fc: Unknown result type (might be due to invalid IL or missing references)
//IL_04a2: Unknown result type (might be due to invalid IL or missing references)
//IL_04a7: Unknown result type (might be due to invalid IL or missing references)
//IL_0443: Unknown result type (might be due to invalid IL or missing references)
//IL_0448: Unknown result type (might be due to invalid IL or missing references)
//IL_044f: Unknown result type (might be due to invalid IL or missing references)
//IL_0454: Unknown result type (might be due to invalid IL or missing references)
//IL_0586: Unknown result type (might be due to invalid IL or missing references)
//IL_058b: Unknown result type (might be due to invalid IL or missing references)
//IL_0592: Unknown result type (might be due to invalid IL or missing references)
//IL_0597: Unknown result type (might be due to invalid IL or missing references)
//IL_05b1: Unknown result type (might be due to invalid IL or missing references)
//IL_020d: Unknown result type (might be due to invalid IL or missing references)
//IL_0212: Unknown result type (might be due to invalid IL or missing references)
//IL_0284: Unknown result type (might be due to invalid IL or missing references)
//IL_0289: Unknown result type (might be due to invalid IL or missing references)
//IL_027b: Unknown result type (might be due to invalid IL or missing references)
//IL_0280: Unknown result type (might be due to invalid IL or missing references)
//IL_0482: Unknown result type (might be due to invalid IL or missing references)
//IL_0487: Unknown result type (might be due to invalid IL or missing references)
//IL_0479: Unknown result type (might be due to invalid IL or missing references)
//IL_047e: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance == (Object)null)
{
return;
}
ulong mySteamID = GetMySteamID();
if (CurrentMode == OutlineMode.Disco)
{
_discoTimer += Time.deltaTime;
if (_discoTimer >= 0.1f)
{
_currentDiscoColor = new Color(Random.value, Random.value, Random.value);
_discoTimer = 0f;
}
}
if (CurrentMode == OutlineMode.Glitch)
{
_glitchTimer += Time.deltaTime;
if (_glitchTimer >= 0.05f)
{
_currentGlitchColor = ((Random.value > 0.5f) ? Color.cyan : Color.magenta);
_currentGlitchWidth = Random.Range(1f, 60f);
_glitchTimer = 0f;
}
}
Enumerator<ulong, MonoBehaviourPublicCSstReshTrheObplBojuUnique> enumerator = MonoBehaviourPublicDi2UIObacspDi2UIObUnique.Instance.activePlayers.Values.GetEnumerator();
while (enumerator.MoveNext())
{
MonoBehaviourPublicCSstReshTrheObplBojuUnique current = enumerator.Current;
if (current.steamProfile.m_SteamID == mySteamID || !TaggedPlayers.Contains(current.steamProfile.m_SteamID))
{
continue;
}
Color color = Color.red;
float width = 16f;
switch (CurrentMode)
{
case OutlineMode.Normal:
color = Color.red;
width = 16f;
break;
case OutlineMode.Rainbow:
_hue += Time.deltaTime * 0.05f;
if (_hue > 1f)
{
_hue = 0f;
}
color = Color.HSVToRGB(_hue, 1f, 1f);
break;
case OutlineMode.Pulse:
{
float num7 = Mathf.PingPong(Time.time * 0.5f, 1f);
((Color)(ref color))..ctor(0.6f + num7 * 0.4f, 0f, 0f);
width = 15f + num7 * 10f;
break;
}
case OutlineMode.Police:
color = (((int)(Time.time * 8f) % 2 != 0) ? Color.red : Color.blue);
width = 25f;
break;
case OutlineMode.Golden:
{
float num6 = Mathf.PingPong(Time.time * 0.8f, 1f);
color = Color.Lerp(new Color(0.7f, 0.5f, 0f), new Color(1f, 0.9f, 0.5f), num6);
width = 20f;
break;
}
case OutlineMode.Toxic:
{
float num5 = Mathf.PingPong(Time.time * 3f, 1f);
color = Color.Lerp(Color.green, new Color(0.5f, 1f, 0f), num5);
width = 16f + Mathf.Sin(Time.time * 15f) * 3f;
break;
}
case OutlineMode.Glitch:
color = _currentGlitchColor;
width = _currentGlitchWidth;
break;
case OutlineMode.Angelic:
{
color = Color.white;
float num4 = Mathf.PingPong(Time.time * 0.5f, 1f);
width = 20f + num4 * 15f;
break;
}
case OutlineMode.Disco:
color = _currentDiscoColor;
width = 20f;
break;
case OutlineMode.Fire:
{
float num3 = Mathf.PingPong(Time.time * 2f, 1f);
color = Color.Lerp(Color.red, Color.yellow, num3);
width = 18f;
break;
}
case OutlineMode.Ice:
color = Color.Lerp(new Color(0f, 1f, 1f), Color.white, 0.3f);
width = 16f;
break;
case OutlineMode.Void:
((Color)(ref color))..ctor(0.2f, 0f, 0.4f);
width = 20f;
break;
case OutlineMode.Chroma:
{
float num8 = Mathf.PingPong(Time.time * 0.5f, 1f);
color = Color.Lerp(Color.blue, Color.magenta, num8);
width = 16f;
break;
}
case OutlineMode.Danger:
color = (((int)(Time.time * 4f) % 2 != 0) ? Color.black : Color.yellow);
width = 25f;
break;
case OutlineMode.Heartbeat:
{
float num2 = Time.time % 2f;
color = Color.red;
width = ((!(num2 < 0.1f)) ? ((!(num2 < 0.2f)) ? ((!(num2 < 0.3f)) ? ((!(num2 < 0.4f)) ? 9f : Mathf.Lerp(34f, 9f, (num2 - 0.3f) / 0.1f)) : Mathf.Lerp(14f, 34f, (num2 - 0.2f) / 0.1f)) : Mathf.Lerp(34f, 14f, (num2 - 0.1f) / 0.1f)) : Mathf.Lerp(9f, 34f, num2 / 0.1f));
break;
}
case OutlineMode.LoadingBar:
{
float num = Mathf.Repeat(Time.time, 3f) / 3f;
color = Color.Lerp(Color.red, Color.green, num);
width = Mathf.Lerp(0f, 50f, num);
break;
}
}
SetOutline(current, color, width);
}
}
private void SetOutline(MonoBehaviourPublicCSstReshTrheObplBojuUnique player, Color color, float width)
{
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
MonoBehaviourPublicHa1MeObouCoSiouBoprUnique component = ((Component)player.shirt).GetComponent<MonoBehaviourPublicHa1MeObouCoSiouBoprUnique>();
MonoBehaviourPublicHa1MeObouCoSiouBoprUnique component2 = player.pants.GetComponent<MonoBehaviourPublicHa1MeObouCoSiouBoprUnique>();
if ((Object)(object)component != (Object)null)
{
component.Method_Public_Void_Color_0(color);
component.outlineWidth = width;
}
if ((Object)(object)component2 != (Object)null)
{
component2.Method_Public_Void_Color_0(color);
component2.outlineWidth = width;
}
}
private ulong GetMySteamID()
{
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance != (Object)null)
{
return MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance.field_Private_CSteamID_0.m_SteamID;
}
return 0uL;
}
}
public static class Patches
{
[HarmonyPatch(typeof(GameMode), "GameOver")]
[HarmonyPostfix]
public static void OnGameOver()
{
OutlineController.TaggedPlayers.Clear();
}
}
}