Decompiled source of Icons v1.0.7

dteeicons.dll

Decompiled 17 hours ago
using System;
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 Microsoft.CodeAnalysis;
using RoR2;
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(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ExamplePlugin")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ExamplePlugin")]
[assembly: AssemblyTitle("ExamplePlugin")]
[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 ExamplePlugin
{
	[BepInPlugin("DTEE.Icons", "Icons", "1.0.7")]
	public class ExamplePlugin : BaseUnityPlugin
	{
		private const string PluginGUID = "DTEE.Icons";

		private const string PluginAuthor = "DTEE";

		private const string PluginName = "Icons";

		private const string PluginVersion = "1.0.7";

		private static AssetBundle assetBundle;

		public void Awake()
		{
			Log.Init(((BaseUnityPlugin)this).Logger);
			assetBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "dteeicons.bundle"));
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(BodyCatalogInit));
		}

		private void BodyCatalogInit()
		{
			GameObject val = BodyCatalog.FindBodyPrefab("CommandoBody");
			if ((Object)(object)val != (Object)null)
			{
				val.GetComponent<CharacterBody>().portraitIcon = (Texture)(object)assetBundle.LoadAsset<Texture2D>("Assets/New Folder/Commando.png");
			}
			GameObject val2 = BodyCatalog.FindBodyPrefab("HuntressBody");
			if ((Object)(object)val2 != (Object)null)
			{
				val2.GetComponent<CharacterBody>().portraitIcon = (Texture)(object)assetBundle.LoadAsset<Texture2D>("Assets/New Folder/Huntress.png");
			}
			GameObject val3 = BodyCatalog.FindBodyPrefab("Bandit2Body");
			if ((Object)(object)val3 != (Object)null)
			{
				val3.GetComponent<CharacterBody>().portraitIcon = (Texture)(object)assetBundle.LoadAsset<Texture2D>("Assets/New Folder/Bandit2.png");
			}
			GameObject val4 = BodyCatalog.FindBodyPrefab("ToolbotBody");
			if ((Object)(object)val4 != (Object)null)
			{
				val4.GetComponent<CharacterBody>().portraitIcon = (Texture)(object)assetBundle.LoadAsset<Texture2D>("Assets/New Folder/Toolbot.png");
			}
			GameObject val5 = BodyCatalog.FindBodyPrefab("EngiBody");
			if ((Object)(object)val5 != (Object)null)
			{
				val5.GetComponent<CharacterBody>().portraitIcon = (Texture)(object)assetBundle.LoadAsset<Texture2D>("Assets/New Folder/Engi.png");
			}
			GameObject val6 = BodyCatalog.FindBodyPrefab("MageBody");
			if ((Object)(object)val6 != (Object)null)
			{
				val6.GetComponent<CharacterBody>().portraitIcon = (Texture)(object)assetBundle.LoadAsset<Texture2D>("Assets/New Folder/Mage.png");
			}
			GameObject val7 = BodyCatalog.FindBodyPrefab("MercBody");
			if ((Object)(object)val7 != (Object)null)
			{
				val7.GetComponent<CharacterBody>().portraitIcon = (Texture)(object)assetBundle.LoadAsset<Texture2D>("Assets/New Folder/Merc.png");
			}
			GameObject val8 = BodyCatalog.FindBodyPrefab("TreebotBody");
			if ((Object)(object)val8 != (Object)null)
			{
				val8.GetComponent<CharacterBody>().portraitIcon = (Texture)(object)assetBundle.LoadAsset<Texture2D>("Assets/New Folder/Treebot.png");
			}
			GameObject val9 = BodyCatalog.FindBodyPrefab("LoaderBody");
			if ((Object)(object)val9 != (Object)null)
			{
				val9.GetComponent<CharacterBody>().portraitIcon = (Texture)(object)assetBundle.LoadAsset<Texture2D>("Assets/New Folder/Loader.png");
			}
			GameObject val10 = BodyCatalog.FindBodyPrefab("CrocoBody");
			if ((Object)(object)val10 != (Object)null)
			{
				val10.GetComponent<CharacterBody>().portraitIcon = (Texture)(object)assetBundle.LoadAsset<Texture2D>("Assets/New Folder/Croco.png");
			}
			GameObject val11 = BodyCatalog.FindBodyPrefab("CaptainBody");
			if ((Object)(object)val11 != (Object)null)
			{
				val11.GetComponent<CharacterBody>().portraitIcon = (Texture)(object)assetBundle.LoadAsset<Texture2D>("Assets/New Folder/Captain.png");
			}
			GameObject val12 = BodyCatalog.FindBodyPrefab("HereticBody");
			if ((Object)(object)val12 != (Object)null)
			{
				val12.GetComponent<CharacterBody>().portraitIcon = (Texture)(object)assetBundle.LoadAsset<Texture2D>("Assets/New Folder/Heretic.png");
			}
			GameObject val13 = BodyCatalog.FindBodyPrefab("RailgunnerBody");
			if ((Object)(object)val13 != (Object)null)
			{
				val13.GetComponent<CharacterBody>().portraitIcon = (Texture)(object)assetBundle.LoadAsset<Texture2D>("Assets/New Folder/Railgunner.png");
			}
			GameObject val14 = BodyCatalog.FindBodyPrefab("VoidSurvivorBody");
			if ((Object)(object)val14 != (Object)null)
			{
				val14.GetComponent<CharacterBody>().portraitIcon = (Texture)(object)assetBundle.LoadAsset<Texture2D>("Assets/New Folder/VoidSurvivor.png");
			}
			GameObject val15 = BodyCatalog.FindBodyPrefab("SeekerBody");
			if ((Object)(object)val15 != (Object)null)
			{
				val15.GetComponent<CharacterBody>().portraitIcon = (Texture)(object)assetBundle.LoadAsset<Texture2D>("Assets/New Folder/Seeker.png");
			}
			GameObject val16 = BodyCatalog.FindBodyPrefab("ChefBody");
			if ((Object)(object)val16 != (Object)null)
			{
				val16.GetComponent<CharacterBody>().portraitIcon = (Texture)(object)assetBundle.LoadAsset<Texture2D>("Assets/New Folder/Chef.png");
			}
			GameObject val17 = BodyCatalog.FindBodyPrefab("FalseSonBody");
			if ((Object)(object)val17 != (Object)null)
			{
				val17.GetComponent<CharacterBody>().portraitIcon = (Texture)(object)assetBundle.LoadAsset<Texture2D>("Assets/New Folder/FalseSon.png");
			}
			GameObject val18 = BodyCatalog.FindBodyPrefab("DroneTechBody");
			if ((Object)(object)val18 != (Object)null)
			{
				val18.GetComponent<CharacterBody>().portraitIcon = (Texture)(object)assetBundle.LoadAsset<Texture2D>("Assets/New Folder/DroneTech.png");
			}
			GameObject val19 = BodyCatalog.FindBodyPrefab("DrifterBody");
			if ((Object)(object)val19 != (Object)null)
			{
				val19.GetComponent<CharacterBody>().portraitIcon = (Texture)(object)assetBundle.LoadAsset<Texture2D>("Assets/New Folder/Drifter.png");
			}
			GameObject val20 = BodyCatalog.FindBodyPrefab("HANDOverclockedBody");
			if ((Object)(object)val20 != (Object)null)
			{
				val20.GetComponent<CharacterBody>().portraitIcon = (Texture)(object)assetBundle.LoadAsset<Texture2D>("Assets/New Folder/HANDOverclocked.png");
			}
			GameObject val21 = BodyCatalog.FindBodyPrefab("SniperClassicBody");
			if ((Object)(object)val21 != (Object)null)
			{
				val21.GetComponent<CharacterBody>().portraitIcon = (Texture)(object)assetBundle.LoadAsset<Texture2D>("Assets/New Folder/SniperClassic.png");
			}
			GameObject val22 = BodyCatalog.FindBodyPrefab("EnforcerBody");
			if ((Object)(object)val22 != (Object)null)
			{
				val22.GetComponent<CharacterBody>().portraitIcon = (Texture)(object)assetBundle.LoadAsset<Texture2D>("Assets/New Folder/Enforcer.png");
			}
		}
	}
	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);
		}
	}
}