using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using TMPro;
using UnboundLib;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.1", FrameworkDisplayName = ".NET Framework 4.7.1")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace FancyCardBar;
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.rsmind.rounds.fancycardbar", "Fancy Card Bar", "1.1.0")]
[BepInProcess("Rounds.exe")]
public class FancyCardBar : BaseUnityPlugin
{
private const string ModId = "com.rsmind.rounds.fancycardbar";
private const string ModName = "Fancy Card Bar";
public const string Version = "1.1.0";
public const string ModInitials = "FCB";
public static bool Debug;
internal static AssetBundle assets;
[field: CompilerGenerated]
[field: DebuggerBrowsable(/*Could not decode attribute arguments.*/)]
public static FancyCardBar instance
{
[CompilerGenerated]
get;
[CompilerGenerated]
private set;
}
private void Awake()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Expected O, but got Unknown
Unbound.RegisterClientSideMod("com.rsmind.rounds.fancycardbar");
Harmony val = new Harmony("com.rsmind.rounds.fancycardbar");
val.PatchAll();
}
private void Start()
{
instance = this;
}
}
internal class FancyIcon : MonoBehaviour
{
public GameObject fancyIcon;
}
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
internal class CardBarPatch : Object
{
private static void Postfix(CardBar __instance)
{
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
GameObject gameObject = ((Component)((Component)__instance).transform.GetChild(((Component)__instance).transform.childCount - 1)).gameObject;
FancyIcon component = ((Component)(CardInfo)ExtensionMethods.GetFieldValue((object)gameObject.GetComponent<CardBarButton>(), "card")).GetComponent<FancyIcon>();
if (component != null)
{
GameObject val = Object.Instantiate<GameObject>(component.fancyIcon, gameObject.transform);
val.transform.localScale = Vector3.one * (gameObject.GetComponent<RectTransform>().sizeDelta.x / 128f);
((Behaviour)gameObject.GetComponentInChildren<TextMeshProUGUI>()).enabled = false;
}
}
}
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
internal class CardBarUtilsPatch : Object
{
private static void Postfix(CardBar __instance)
{
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
GameObject gameObject = ((Component)((Component)__instance).transform.GetChild(((Component)__instance).transform.childCount - 1)).gameObject;
FancyIcon component = ((Component)(CardInfo)ExtensionMethods.GetFieldValue((object)gameObject.GetComponent<CardBarButton>(), "card")).GetComponent<FancyIcon>();
if (component != null)
{
GameObject val = Object.Instantiate<GameObject>(component.fancyIcon, gameObject.transform);
val.transform.localScale = Vector3.one * (gameObject.GetComponent<RectTransform>().sizeDelta.x / 128f);
((Behaviour)gameObject.GetComponentInChildren<TextMeshProUGUI>()).enabled = false;
}
}
}