Decompiled source of RadFixes v1.0.1

RadFixes.dll

Decompiled 2 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
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("RadFixes")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RadFixes")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("56796b16-fa96-4077-8440-cc4ba31a62f5")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.1.0")]
namespace RadFixes;

internal class Patches
{
	[HarmonyPatch(typeof(ShipItemFishingRod))]
	private class ShipItemFisingRodPatches
	{
		[HarmonyPostfix]
		[HarmonyPatch("OnLoad")]
		public static void OnLoadSetReverseSpinner(ref float ___spinnerSpeed)
		{
			___spinnerSpeed = -40f;
		}

		[HarmonyPostfix]
		[HarmonyPatch("OnBuy")]
		public static void OnBuySetReverseSpinner(ref float ___spinnerSpeed)
		{
			___spinnerSpeed = -40f;
		}
	}

	[HarmonyPatch(typeof(StartMenu))]
	private class StartMenuPatches
	{
		[HarmonyPostfix]
		[HarmonyPatch("Awake")]
		public static void DestroyDeco(GameObject ___settingsUI)
		{
			Transform val = ((IEnumerable<Transform>)___settingsUI.GetComponentsInChildren<Transform>()).FirstOrDefault((Func<Transform, bool>)((Transform k) => ((Object)k).name == "deco (1)"));
			Object.Destroy((Object)(object)((Component)val).gameObject);
		}

		[HarmonyPrefix]
		[HarmonyPatch("GameToSettings")]
		public static void PauseSound()
		{
			AudioListener.pause = true;
		}

		[HarmonyPrefix]
		[HarmonyPatch("SettingsToGame")]
		public static void UnPauseSound()
		{
			AudioListener.pause = false;
		}
	}

	[HarmonyPatch(typeof(BackupSavesListUI))]
	private class BackupSavesListUIPatches
	{
		[HarmonyPostfix]
		[HarmonyPatch("Awake")]
		public static void SetShowingListFor(ref int ___showingListFor)
		{
			___showingListFor = -1;
		}
	}

	[HarmonyPatch(typeof(MouseButtonPointer))]
	private class MouseButtonPointerPatches
	{
		[HarmonyPrefix]
		[HarmonyPatch("LateUpdate")]
		public static bool DisableMouseInputLostFocus()
		{
			if (!Application.isFocused)
			{
				return false;
			}
			return true;
		}
	}
}
[BepInPlugin("com.raddude82.radfixes", "RadFixes", "1.0.1")]
public class Plugin : BaseUnityPlugin
{
	public const string PLUGIN_GUID = "com.raddude82.radfixes";

	public const string PLUGIN_NAME = "RadFixes";

	public const string PLUGIN_VERSION = "1.0.1";

	internal static Plugin instance;

	internal static ManualLogSource logger;

	private void Awake()
	{
		instance = this;
		logger = ((BaseUnityPlugin)this).Logger;
		Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "com.raddude82.radfixes");
	}
}