Decompiled source of AceWarbanner v1.0.0

AceWarbanner.dll

Decompiled 2 months ago
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
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("AceWarbanner")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("AceWarbanner")]
[assembly: AssemblyTitle("AceWarbanner")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace AceWarbanner;

[BepInPlugin("com.RiskOfBrainrot.AceBanner", "AceBanner", "1.0.0")]
public class AceBannerPlugin : BaseUnityPlugin
{
	public static PluginInfo PInfo;

	public const string guid = "com.RiskOfBrainrot.AceBanner";

	public const string teamName = "RiskOfBrainrot";

	public const string modName = "AceBanner";

	public const string version = "1.0.0";

	private static AssetBundle _mainAssetBundle;

	public static AssetBundle mainAssetBundle
	{
		get
		{
			if ((Object)(object)_mainAssetBundle == (Object)null)
			{
				_mainAssetBundle = AssetBundle.LoadFromFile(GetAssetBundlePath("acebanner"));
			}
			return _mainAssetBundle;
		}
		set
		{
			_mainAssetBundle = value;
		}
	}

	private void Awake()
	{
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		PInfo = ((BaseUnityPlugin)this).Info;
		Texture val = mainAssetBundle.LoadAsset<Texture>("Assets/texWarbannerDiffuse.png");
		Material val2 = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/WardOnLevel/matWarbannerFlag 1.mat").WaitForCompletion();
		if ((Object)(object)val != (Object)null && (Object)(object)val2 != (Object)null)
		{
			val2.SetTexture("_MainTex", val);
		}
		Material val3 = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/WardOnLevel/matWarbannerFlag.mat").WaitForCompletion();
		if ((Object)(object)val != (Object)null && (Object)(object)val3 != (Object)null)
		{
			val3.SetTexture("_MainTex", val);
		}
		Debug.Log((object)"\r\n\r\n        ,----,                                                                                                             ,----,            \r\n      ,/   .`|                                   ,--.                                                          ,--,      ,/   .`|            \r\n    ,`   .'  :,-.----.      ,---,              ,--.'|  .--.--.           ,-.----.     ,---,  ,----..         ,--.'|    ,`   .'  : .--.--.    \r\n  ;    ;     /\\    /  \\    '  .' \\         ,--,:  : | /  /    '.         \\    /  \\ ,`--.' | /   /   \\     ,--,  | :  ;    ;     //  /    '.  \r\n.'___,/    ,' ;   :    \\  /  ;    '.    ,`--.'`|  ' :|  :  /`. /         ;   :    \\|   :  :|   :     : ,---.'|  : '.'___,/    ,'|  :  /`. /  \r\n|    :     |  |   | .\\ : :  :       \\   |   :  :  | |;  |  |--`          |   | .\\ ::   |  '.   |  ;. / |   | : _' ||    :     | ;  |  |--`   \r\n;    |.';  ;  .   : |: | :  |   /\\   \\  :   |   \\ | :|  :  ;_            .   : |: ||   :  |.   ; /--`  :   : |.'  |;    |.';  ; |  :  ;_     \r\n`----'  |  |  |   |  \\ : |  :  ' ;.   : |   : '  '; | \\  \\    `.         |   |  \\ :'   '  ;;   | ;  __ |   ' '  ; :`----'  |  |  \\  \\    `.  \r\n    '   :  ;  |   : .  / |  |  ;/  \\   \\'   ' ;.    ;  `----.   \\        |   : .  /|   |  ||   : |.' .''   |  .'. |    '   :  ;   `----.   \\ \r\n    |   |  '  ;   | |  \\ '  :  | \\  \\ ,'|   | | \\   |  __ \\  \\  |        ;   | |  \\'   :  ;.   | '_.' :|   | :  | '    |   |  '   __ \\  \\  | \r\n    '   :  |  |   | ;\\  \\|  |  '  '--'  '   : |  ; .' /  /`--'  /        |   | ;\\  \\   |  ''   ; : \\  |'   : |  : ;    '   :  |  /  /`--'  / \r\n    ;   |.'   :   ' | \\.'|  :  :        |   | '`--'  '--'.     /         :   ' | \\.'   :  |'   | '/  .'|   | '  ,/     ;   |.'  '--'.     /  \r\n    '---'     :   : :-'  |  | ,'        '   : |        `--'---'          :   : :-' ;   |.' |   :    /  ;   : ;--'      '---'      `--'---'   \r\n              |   |.'    `--''          ;   |.'                          |   |.'   '---'    \\   \\ .'   |   ,/                                \r\n              `---'                     '---'                            `---'               `---`     '---'                                 \r\n                                                                                                                                             \r\n");
	}

	public static string GetAssetBundlePath(string bundleName)
	{
		return Path.Combine(Path.GetDirectoryName(PInfo.Location), bundleName);
	}
}