Decompiled source of GreenWarBonds v1.0.0

GreenWarBonds.dll

Decompiled 2 months ago
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using RoR2;
using UnityEngine;
using UnityEngine.AddressableAssets;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("GreenWarBonds")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("GreenWarBonds")]
[assembly: AssemblyTitle("GreenWarBonds")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace GreenWarBonds;

[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("Omniv.GreenWarBonds", "GreenWarBonds", "1.0.0")]
public class GreenWarBonds : BaseUnityPlugin
{
	public const string PluginGUID = "Omniv.GreenWarBonds";

	public const string PluginAuthor = "Omniv";

	public const string PluginName = "GreenWarBonds";

	public const string PluginVersion = "1.0.0";

	private static ItemDef warBondsDef;

	public static AssetBundle greenWarBondsBundle;

	public const string bundleName = "warBondsBundle";

	public static PluginInfo PInfo { get; private set; }

	public static string AssetBundlePath => Path.Combine(Path.GetDirectoryName(PInfo.Location), "warBondsBundle");

	public void Awake()
	{
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		Log.Init(((BaseUnityPlugin)this).Logger);
		PInfo = ((BaseUnityPlugin)this).Info;
		greenWarBondsBundle = AssetBundle.LoadFromFile(AssetBundlePath);
		warBondsDef = Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/DLC2/Items/GoldOnStageStart/GoldOnStageStart.asset").WaitForCompletion();
		warBondsDef._itemTierDef = Addressables.LoadAssetAsync<ItemTierDef>((object)"RoR2/Base/Common/Tier2Def.asset").WaitForCompletion();
		warBondsDef.pickupIconSprite = greenWarBondsBundle.LoadAsset<Sprite>("Assets/texTreasuryDividendsIconButGreen.png");
		if ((Object)(object)greenWarBondsBundle == (Object)null)
		{
			Debug.Log((object)"THIS BITCH EMPTY");
		}
	}
}
internal static class Log
{
	private static ManualLogSource _logSource;

	internal static void Init(ManualLogSource logSource)
	{
		_logSource = logSource;
	}

	internal static void Debug(object data)
	{
		_logSource.LogDebug(data);
	}

	internal static void Error(object data)
	{
		_logSource.LogError(data);
	}

	internal static void Fatal(object data)
	{
		_logSource.LogFatal(data);
	}

	internal static void Info(object data)
	{
		_logSource.LogInfo(data);
	}

	internal static void Message(object data)
	{
		_logSource.LogMessage(data);
	}

	internal static void Warning(object data)
	{
		_logSource.LogWarning(data);
	}
}