using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using RemoveLevelBadge.Patches;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("RemoveLevelBadge")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RemoveLevelBadge")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("9a54c138-13be-4664-851d-92c9ee1cc204")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace RemoveLevelBadge
{
[BepInPlugin("ironbean.RemoveLevelBadge", "Remove Level Badge", "1.0.0")]
public class RemoveBadgeBase : BaseUnityPlugin
{
private const string modGUID = "ironbean.RemoveLevelBadge";
private const string modName = "Remove Level Badge";
private const string modVersion = "1.0.0";
private readonly Harmony harmony = new Harmony("ironbean.RemoveLevelBadge");
private static RemoveBadgeBase Instance;
internal ManualLogSource mls;
private void Awake()
{
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
mls = Logger.CreateLogSource("ironbean.RemoveLevelBadge");
mls.LogInfo((object)"Badge Remover!");
harmony.PatchAll(typeof(RemoveBadgeBase));
harmony.PatchAll(typeof(PlayerLevelPatch));
}
}
}
namespace RemoveLevelBadge.Patches
{
[HarmonyPatch(typeof(PlayerControllerB))]
internal class PlayerLevelPatch
{
[HarmonyPatch("Update")]
[HarmonyPostfix]
private static void CreatePatch(ref MeshFilter ___playerBadgeMesh, ref MeshRenderer ___playerBetaBadgeMesh)
{
___playerBadgeMesh.mesh = null;
((Renderer)___playerBetaBadgeMesh).enabled = false;
}
}
}