Decompiled source of LevelNumberUI v1.0.0

REPO Level Number.dll

Decompiled a day ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using TMPro;
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("REPO Level Number")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("REPO Level Number")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("c7ba60f1-eeaf-4c76-9c08-97cfec43b265")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace REPO_Level_Number;

[BepInPlugin("ironbean.LevelNumberHUD", "Level Number HUD", "1.0.0")]
public class LevelNumberHUD : BaseUnityPlugin
{
	[HarmonyPatch(typeof(GoalUI))]
	internal class GoalPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void CustomPatch(ref TextMeshProUGUI ___Text)
		{
			if (!SemiFunc.RunIsShop())
			{
				int num = StatsManager.instance.runStats["level"] + 1;
				((TMP_Text)___Text).text = "<line-height=75%>" + ((TMP_Text)___Text).text + "\n<color=#ff9600><size=28>Level " + num + "</size></color></b>";
				((TMP_Text)___Text).alignment = (TextAlignmentOptions)260;
			}
		}
	}

	[HarmonyPatch(typeof(EnergyUI))]
	internal class EnergyPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void CustomPatch(ref TextMeshProUGUI ___Text)
		{
			if (SemiFunc.RunIsShop())
			{
				int num = StatsManager.instance.runStats["level"] + 1;
				((TMP_Text)___Text).text = "<line-height=75%>" + ((TMP_Text)___Text).text + "\n<color=#ff9600><size=28>Level " + num + "</size></color></b>";
			}
		}
	}

	private const string modGUID = "ironbean.LevelNumberHUD";

	private const string modName = "Level Number HUD";

	private const string modVersion = "1.0.0";

	private readonly Harmony harmony = new Harmony("ironbean.LevelNumberHUD");

	internal static LevelNumberHUD Instance;

	internal static ManualLogSource mls;

	internal bool inShop = false;

	private void Awake()
	{
		if ((Object)(object)Instance == (Object)null)
		{
			Instance = this;
		}
		mls = Logger.CreateLogSource("ironbean.LevelNumberHUD");
		mls.LogInfo((object)"Level Number HUD");
		harmony.PatchAll(typeof(LevelNumberHUD));
		harmony.PatchAll(typeof(GoalPatch));
		harmony.PatchAll(typeof(EnergyPatch));
	}
}