Decompiled source of GangeroniMods v1.1.3

TheGangeroniMods.dll

Decompiled a month ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using LethalLib.Modules;
using LethalTerminalExtender.Patches;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("TheGangeroniMods")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+a1fe3a4056ecdaec65cabfd4831de84560c00dae")]
[assembly: AssemblyProduct("TheGangeroniMods")]
[assembly: AssemblyTitle("TheGangeroniMods")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace GangeroniMods;

[BepInPlugin("com.BigSaltyBeans.Blahaj", "Blahaj The Shark", "1.1.3")]
public class Blahaj : BaseUnityPlugin
{
	private const string GUID = "com.BigSaltyBeans.Blahaj";

	private const string NAME = "Blahaj The Shark";

	private const string VERSION = "1.1.3";

	public static Blahaj instance;

	private void Awake()
	{
		instance = this;
		string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "blahajassetbundle");
		AssetBundle val = AssetBundle.LoadFromFile(text);
		Item val2 = val.LoadAsset<Item>("Assets/Blahaj/BlahajItem.asset");
		NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab);
		Utilities.FixMixerGroups(val2.spawnPrefab);
		Items.RegisterScrap(val2, 1, (LevelTypes)(-1));
		Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "com.BigSaltyBeans.Blahaj");
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Loaded Blahaj");
	}
}
[BepInPlugin("com.BigSaltyBeans.modloadingchecker", "Mod Loading Checker", "1.0.0")]
public class LoadChecking : BaseUnityPlugin
{
	private void Awake()
	{
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Mod Checker Passed All Checks");
	}
}
[BepInPlugin("com.BigSaltyBeans.togglelights", "Toggle Ship Lights", "1.0.2")]
public class ToggleShipLights : BaseUnityPlugin
{
	public static ShipLights shipInteriorLights;

	public static bool lightsOn = true;

	private void Awake()
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Expected O, but got Unknown
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		((BaseUnityPlugin)this).Logger.LogInfo((object)"ToggleShipLights loaded.");
		Harmony val = new Harmony("com.BigSaltyBeans.togglelights");
		val.PatchAll();
		TerminalExtenderUtils.addQuickCommand("lights", "Toggle Ship Lights", true, (Action<Terminal, TerminalNode>)delegate(Terminal term, TerminalNode node)
		{
			TerminalNode val2 = ScriptableObject.CreateInstance<TerminalNode>();
			val2.displayText = "Lights Toggled!\n";
			val2.clearPreviousText = true;
			val2.maxCharactersToType = 15;
			ToggleLights();
			term.LoadNewNode(val2);
		});
	}

	private void Start()
	{
		FindShipLights();
	}

	private void FindShipLights()
	{
		GameObject val = GameObject.Find("ShipElectricLights");
		if ((Object)(object)val != (Object)null)
		{
			shipInteriorLights = val.GetComponent<ShipLights>();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"ShipElectricLights found.");
		}
	}

	public static void ToggleLights()
	{
		if ((Object)(object)shipInteriorLights == (Object)null)
		{
			GameObject obj = GameObject.Find("ShipElectricLights");
			shipInteriorLights = ((obj != null) ? obj.GetComponent<ShipLights>() : null);
			if ((Object)(object)shipInteriorLights == (Object)null)
			{
				Debug.LogWarning((object)"Ship lights not found.");
				return;
			}
		}
		shipInteriorLights.ToggleShipLights();
		lightsOn = !lightsOn;
		Debug.Log((object)("[ToggleShipLights] Lights toggled " + (lightsOn ? "ON" : "OFF")));
	}
}