Decompiled source of Overload v1.1.7

Overload.dll

Decompiled a week ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using CellMenu;
using Gear;
using HarmonyLib;
using Il2CppSystem;
using LevelGeneration;
using Microsoft.CodeAnalysis;
using Overload.CustomGearBehavior;
using Overload.CustomLevelBehavior;
using Overload.GUIMods;
using Overload.Utils;
using TMPro;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("Overload")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Overload")]
[assembly: AssemblyTitle("Overload")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace Overload
{
	[HarmonyPatch(typeof(PUI_Watermark), "UpdateWatermark")]
	internal static class Patch_CustomOverloadWatermark
	{
		public static void Postfix(PUI_Watermark __instance)
		{
			string text = "4.6.1+gitf831086-dirty-main".Remove("x.x.x".Length);
			((TMP_Text)__instance.m_watermarkText).SetText("<color=red>MODDED</color> <color=orange>" + text + "</color>\n" + string.Empty + "<color=#7C0805>OVERLOAD</color><color=orange> 1.1.0</color>", true);
		}
	}
	[BepInPlugin("Overload", "Overload", "1.1.5")]
	public class Plugin : BasePlugin
	{
		public override void Load()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			ManualLogSource log = ((BasePlugin)this).Log;
			bool flag = default(bool);
			BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(32, 0, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Overload Has loaded successfully");
			}
			log.LogInfo(val);
			GUIPatches.Setup();
			LevelGenPatches.Setup();
			ToolPatches.Setup();
		}

		private static void RegisterTypes()
		{
			CustomLevelManager.Setup();
		}
	}
}
namespace Overload.Utils
{
	internal static class Log
	{
		private static readonly ManualLogSource _logger;

		static Log()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Expected O, but got Unknown
			_logger = new ManualLogSource("RLC.Overload");
			Logger.Sources.Add((ILogSource)(object)_logger);
		}

		private static string Format(object msg)
		{
			return msg.ToString();
		}

		public static void Info(object data)
		{
			_logger.LogMessage((object)Format(data));
		}

		public static void Verbose(object data)
		{
			_logger.LogDebug((object)Format(data));
		}

		public static void Debug(object data)
		{
			_logger.LogDebug((object)Format(data));
		}

		public static void Error(object data)
		{
			_logger.LogError((object)Format(data));
		}
	}
}
namespace Overload.GUIMods
{
	public class GUIPatches
	{
		public static void Setup()
		{
			Harmony.CreateAndPatchAll(typeof(Patch_CM_PageRundown_New_ResetElements), (string)null);
			Harmony.CreateAndPatchAll(typeof(Patch_CM_PageRundown_New_Update), (string)null);
			Harmony.CreateAndPatchAll(typeof(Patch_BoosterImplantSlotHolder_Setup), (string)null);
			Harmony.CreateAndPatchAll(typeof(Patch_CM_ExpeditionIcon_New_SetArtifactHeat), (string)null);
			Harmony.CreateAndPatchAll(typeof(Patch_PUI_LocalPlayerStatus_Setup), (string)null);
			Harmony.CreateAndPatchAll(typeof(Patch_PUI_Watermark_UpdateWatermark), (string)null);
			Harmony.CreateAndPatchAll(typeof(Patch_CM_RundownTierMarker_Setup), (string)null);
			Log.Info("GUIPatches Setup");
		}
	}
	[HarmonyPatch(typeof(CM_PageRundown_New), "ResetElements")]
	internal class Patch_CM_PageRundown_New_ResetElements
	{
		public static void Postfix(CM_PageRundown_New __instance)
		{
			((Component)__instance.m_textRundownHeader).gameObject.SetActive(true);
			((Component)((Component)__instance).transform.GetChild(2).GetChild(3).GetChild(1)
				.GetChild(0)).gameObject.SetActive(false);
		}
	}
	[HarmonyPatch(typeof(CM_PageRundown_New), "Update")]
	internal class Patch_CM_PageRundown_New_Update
	{
		public static void Postfix(CM_PageRundown_New __instance)
		{
			((RectTransformComp)__instance.m_discordButton).SetVisible(false);
			((RectTransformComp)__instance.m_matchmakeAllButton).SetVisible(false);
			((RectTransformComp)__instance.m_aboutTheRundownButton).SetVisible(false);
			((Component)((Component)__instance).transform.GetChild(2).GetChild(3).GetChild(8)).gameObject.SetActive(false);
			((Component)((Component)__instance).transform.GetChild(2).GetChild(3).GetChild(9)).gameObject.SetActive(false);
		}
	}
	[HarmonyPatch(typeof(CM_RundownTierMarker), "Setup")]
	internal class Patch_CM_RundownTierMarker_Setup
	{
		public static void Postfix(CM_RundownTierMarker __instance)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			((Transform)((Component)__instance).GetComponent<RectTransform>()).localPosition = new Vector3(220f, 34.4f, 0f);
			((Component)((Component)__instance).transform.GetChild(0).GetChild(0)).gameObject.SetActive(false);
		}
	}
	[HarmonyPatch(typeof(CM_BoosterImplantSlotHolder), "Setup")]
	internal class Patch_BoosterImplantSlotHolder_Setup
	{
		public static void Prefix(CM_BoosterImplantSlotHolder __instance)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: 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)
			RectTransform component = ((Component)__instance).GetComponent<RectTransform>();
			if ((Object)(object)component != (Object)null)
			{
				component.anchoredPosition = new Vector2(1f, 2000f);
				component.sizeDelta = new Vector2(1f, 2000f);
				((Transform)component).localScale = new Vector3(1f, 1f, 1f);
			}
		}
	}
	[HarmonyPatch(typeof(CM_ExpeditionIcon_New), "SetArtifactHeat")]
	internal class Patch_CM_ExpeditionIcon_New_SetArtifactHeat
	{
		public static void Postfix(CM_ExpeditionIcon_New __instance)
		{
			((TMP_Text)__instance.m_artifactHeatText).SetText("", true);
		}
	}
	[HarmonyPatch(typeof(PUI_LocalPlayerStatus), "Start")]
	internal class Patch_PUI_LocalPlayerStatus_Setup
	{
		public static void Postfix(PUI_LocalPlayerStatus __instance)
		{
			((Component)((Component)__instance).transform.GetChild(6)).gameObject.SetActive(false);
		}
	}
	[HarmonyPatch(typeof(PUI_Watermark), "UpdateWatermark")]
	internal class Patch_PUI_Watermark_UpdateWatermark
	{
		public static void Postfix(PUI_Watermark __instance)
		{
			string text = "<color=#7C0805>OVERLOAD</color><color=orange> V1.1.7</color>";
			string text2 = "4.6.2+gitf831086-dirty-main".Remove("x.x.x".Length);
			((TMP_Text)__instance.m_watermarkText).SetText("<color=red>MODDED</color> <color=orange>" + text2 + "</color>\n" + string.Empty + text, true);
		}
	}
}
namespace Overload.CustomLevelBehavior
{
	public class CustomLevelManager
	{
		public static D2_Fallout D2;

		public static void Setup()
		{
			D2 = new D2_Fallout();
			LG_Factory.OnFactoryBuildStart += Action.op_Implicit((Action)SetupCustomLevel);
		}

		public static void SetupCustomLevel()
		{
			_ = RundownManager.ActiveExpedition.LevelLayoutData;
		}
	}
	public class D2_Fallout
	{
		public static void Setup()
		{
		}
	}
	public class LevelGenPatches
	{
		public static void Setup()
		{
			Harmony.CreateAndPatchAll(typeof(Patch_LG_Factory_Setup), (string)null);
			Log.Info("LevelGenPatches Setup");
		}
	}
	[HarmonyPatch(typeof(LG_Factory), "Setup")]
	internal class Patch_LG_Factory_Setup
	{
		public static uint m_activeLevelLayoutID = RundownManager.ActiveExpedition.LevelLayoutData;

		public static void Postfix()
		{
		}

		public static void Prefix()
		{
		}
	}
}
namespace Overload.CustomGearBehavior
{
	public class ToolPatches
	{
		public static void Setup()
		{
			Harmony.CreateAndPatchAll(typeof(Patch_EnemyScanner_Setup), (string)null);
		}
	}
	[HarmonyPatch(typeof(EnemyScanner), "Setup")]
	internal class Patch_EnemyScanner_Setup
	{
		public static void Postfix(EnemyScanner __instance)
		{
			__instance.m_maxObjs = 30;
			__instance.m_maxScanWorldRadius = 160f;
		}
	}
}