using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using Jotunn;
using Jotunn.Managers;
using Jotunn.Utils;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("JotunnModExample")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("JotunnModExample")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("e3243d22-4307-4008-ba36-9f326008cde5")]
[assembly: AssemblyFileVersion("0.0.1.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.1.0")]
namespace LinenCapeColors;
[BepInPlugin("org.bepinex.plugins.bid.LinenCapeColors", "LinenCapeColors", "0.3.2")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
internal class LinenCapeColors : BaseUnityPlugin
{
public const string PluginGUID = "org.bepinex.plugins.bid.LinenCapeColors";
public const string PluginName = "LinenCapeColors";
public const string PluginVersion = "0.3.2";
private readonly Harmony harmony = new Harmony("org.bepinex.plugins.bid.LinenCapeColors");
private void Awake()
{
PrefabManager.OnVanillaPrefabsAvailable += AddClonedItems;
harmony.PatchAll();
}
private void OnDestroy()
{
harmony.UnpatchSelf();
}
private void CreateConfigValues()
{
((BaseUnityPlugin)this).Config.SaveOnConfigSet = true;
SynchronizationManager.OnConfigurationSynchronized += delegate(object obj, ConfigurationSynchronizationEventArgs attr)
{
if (attr.InitialSynchronization)
{
Logger.LogMessage((object)"Initial Config sync event received");
}
else
{
Logger.LogMessage((object)"Config sync event received");
}
};
}
private void AddItemsWithConfigs()
{
}
private void AddClonedItems()
{
PrefabManager.OnVanillaPrefabsAvailable -= AddClonedItems;
AssetBundle val = AssetUtils.LoadAssetBundleFromResources("linencapes");
GameObject prefab = PrefabManager.Instance.GetPrefab("CapeLinen");
Texture val2 = val.LoadAsset<Texture>("CapeLinen_styles");
((Renderer)((Component)prefab.transform.GetChild(0)).GetComponentInChildren<MeshRenderer>()).material.SetTexture("_StyleTex", val2);
((Renderer)((Component)prefab.transform.GetChild(1)).GetComponentInChildren<SkinnedMeshRenderer>()).material.SetTexture("_StyleTex", val2);
ItemData itemData = prefab.GetComponent<ItemDrop>().m_itemData;
Sprite[] icons = (Sprite[])(object)new Sprite[13]
{
val.LoadAsset<Sprite>("cape_red"),
val.LoadAsset<Sprite>("cape_blue"),
val.LoadAsset<Sprite>("cape_green"),
val.LoadAsset<Sprite>("cape_yellow"),
val.LoadAsset<Sprite>("cape_white"),
val.LoadAsset<Sprite>("cape_black"),
val.LoadAsset<Sprite>("cape_orange"),
val.LoadAsset<Sprite>("cape_purple"),
val.LoadAsset<Sprite>("cape_yp"),
val.LoadAsset<Sprite>("cape_wr"),
val.LoadAsset<Sprite>("cape_wb"),
val.LoadAsset<Sprite>("cape_wbr"),
val.LoadAsset<Sprite>("cape_ycross")
};
itemData.m_shared.m_icons = icons;
itemData.m_shared.m_variants = itemData.m_shared.m_icons.Length;
val.Unload(false);
}
private void AddRecipes()
{
}
public static void debug(string text, Vector3 pos)
{
}
}