Decompiled source of LethalLevelInfo v1.0.6

LethalLevelInfo.dll

Decompiled 2 weeks ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using LethalLevelLoader;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("LethalLevelInfo")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LethalLevelInfo")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("7bd0cca3-e614-45d1-bcd7-f830321b0841")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("BULLETBOT.LethalLevelInfo", "Lethal Level Info", "1.0.6")]
public class Plugin : BaseUnityPlugin
{
	private const string modGUID = "BULLETBOT.LethalLevelInfo";

	private const string modName = "Lethal Level Info";

	private const string modVer = "1.0.6";

	public static ManualLogSource logger;

	private readonly Harmony harmony = new Harmony("BULLETBOT.LethalLevelInfo");

	public static ConfigEntry<int> risklevelspaces;

	public static ConfigEntry<int> pricespaces;

	private void Awake()
	{
		logger = Logger.CreateLogSource("Lethal Level Info");
		harmony.PatchAll();
		risklevelspaces = ((BaseUnityPlugin)this).Config.Bind<int>("General", "Risk Level Spaces", 35, (ConfigDescription)null);
		pricespaces = ((BaseUnityPlugin)this).Config.Bind<int>("General", "Price Spaces", 15, (ConfigDescription)null);
		logger.LogInfo((object)"Lethal Level Info has been initialized!");
	}
}
namespace LethalLevelInfo.Patches;

[HarmonyPatch(typeof(TerminalManager))]
internal class TerminalManagerPatch
{
	[HarmonyPatch("GetExtendedLevelPreviewInfo")]
	[HarmonyPostfix]
	private static void GetExtendedLevelPreviewInfo_Patch(ExtendedLevel extendedLevel, ref string __result)
	{
		string riskLevel = extendedLevel.SelectableLevel.riskLevel;
		__result = __result + new string(' ', Plugin.risklevelspaces.Value - extendedLevel.NumberlessPlanetName.Length - __result.Length) + riskLevel + new string(' ', Plugin.pricespaces.Value - riskLevel.Length) + $"${extendedLevel.RoutePrice}";
	}
}