Decompiled source of BorderlessRocks v1.0.0

Mods/Borderless_Rocks.dll

Decompiled 2 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using Borderless_Rocks;
using MelonLoader;
using Microsoft.CodeAnalysis;
using RumbleModUI;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: MelonInfo(typeof(Core), "Borderless Rocks", "1.0.0", "Orangenal", null)]
[assembly: MelonGame("Buckethead Entertainment", "RUMBLE")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("Borderless_Rocks")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Borderless_Rocks")]
[assembly: AssemblyTitle("Borderless_Rocks")]
[assembly: NeutralResourcesLanguage("en-US")]
[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 Borderless_Rocks
{
	public class Core : MelonMod
	{
		private bool borderless;

		private Mod BorderlessRocks = new Mod();

		public override void OnInitializeMelon()
		{
			((MelonBase)this).LoggerInstance.Msg("Initialized.");
		}

		public override void OnUpdate()
		{
			if (Input.GetKeyDown((KeyCode)292))
			{
				borderless = !borderless;
				BorderlessRocks.Settings[1].Value = borderless;
				BorderlessRocks.Settings[1].SavedValue = borderless;
			}
		}

		public void MakeBorderless(bool enable)
		{
			int systemWidth = Display.main.systemWidth;
			int systemHeight = Display.main.systemHeight;
			Screen.SetResolution(systemWidth, systemHeight, enable);
		}

		public override void OnLateInitializeMelon()
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Expected O, but got Unknown
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Expected O, but got Unknown
			BorderlessRocks.ModName = "BorderlessRocks";
			BorderlessRocks.ModVersion = "1.0.0";
			BorderlessRocks.SetFolder("BorderlessRocks");
			BorderlessRocks.AddDescription("Description", "", "No more lagging when switching windows!", new Tags
			{
				IsSummary = true
			});
			BorderlessRocks.AddToList("Enabled", true, 0, "Sets the game to windowed borderless", new Tags());
			BorderlessRocks.Settings[1].SavedValueChanged += OnSave;
			BorderlessRocks.GetFromFile();
			OnSave();
			UI.instance.UI_Initialized += OnUIInit;
		}

		private void OnSave(object sender = null, EventArgs e = null)
		{
			if (e != null)
			{
				borderless = ((ValueChange<bool>)(object)e).Value;
			}
			else
			{
				borderless = (bool)BorderlessRocks.Settings[1].SavedValue;
			}
			MakeBorderless(borderless);
		}

		private void OnUIInit()
		{
			UI.instance.AddMod(BorderlessRocks);
		}
	}
	public static class BuildInfo
	{
		public const string Version = "1.0.0";
	}
}