Decompiled source of AlwaysOpenStats v1.0.1

AlwaysOpenStats.dll

Decompiled 6 hours 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 UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("AlwaysOpenStats")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AlwaysOpenStats")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("f43d1793-f1b3-4221-a60e-f1185ffa9569")]
[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 AlwaysOpenStats;

[BepInPlugin("com.Cedar.AlwaysOpenStats", "AlwaysOpenStats", "1.0.0")]
public class AlwaysOpenStatsPlugin : BaseUnityPlugin
{
	public GameObject Stats;

	public bool statSwitch;

	private const string MyGUID = "com.Cedar.AlwaysOpenStats";

	private const string PluginName = "AlwaysOpenStats";

	private const string VersionString = "1.0.0";

	public static ManualLogSource Log = new ManualLogSource("AlwaysOpenStats");

	private static Scene currentScene;

	public void Awake()
	{
		((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: AlwaysOpenStats, VersionString: 1.0.0 is loaded.");
		Log = ((BaseUnityPlugin)this).Logger;
		SceneManager.sceneLoaded -= OnSceneLoaded;
		SceneManager.sceneLoaded += OnSceneLoaded;
	}

	public void OnSceneLoaded(Scene scene, LoadSceneMode mode)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		currentScene = scene;
		if (((Scene)(ref scene)).name == "b3e7f2f8052488a45b35549efb98d902")
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"menu = no stats");
			return;
		}
		Stats = GameObject.Find("Canvas/Level Stats Controller/Level Stats (1)");
		if ((Object)(object)Stats == (Object)null)
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"null stats");
		}
		else
		{
			statSwitch = false;
		}
	}

	public void Update()
	{
		if (((Scene)(ref currentScene)).name != "b3e7f2f8052488a45b35549efb98d902" && ((Scene)(ref currentScene)).name != "Bootstrap" && ((Scene)(ref currentScene)).name != "241a6a8caec7a13438a5ee786040de32" && !statSwitch)
		{
			Stats.SetActive(true);
			statSwitch = true;
		}
	}
}