using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using HarmonyLib;
using Il2CppSLZ.Bonelab;
using Il2CppSLZ.UI;
using MelonLoader;
using MelonLoader.Preferences;
using Microsoft.CodeAnalysis;
using QuickAvatarMenu;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("Adds buttons to go forwards and backwards a configurable amount pages in the avatar menu.")]
[assembly: AssemblyDescription("Adds buttons to go forwards and backwards a configurable amount pages in the avatar menu.")]
[assembly: AssemblyCompany(null)]
[assembly: AssemblyProduct("QuickAvatarMenu")]
[assembly: AssemblyCopyright("Developed by Checkerboard")]
[assembly: AssemblyTrademark(null)]
[assembly: AssemblyFileVersion("1.0.1")]
[assembly: MelonInfo(typeof(Main), "QuickAvatarMenu", "1.0.1", "Checkerboard", null)]
[assembly: MelonColor(255, 255, 255, 255)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyVersion("1.0.1.0")]
[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 QuickAvatarMenu
{
public class Main : MelonMod
{
[HarmonyPatch]
private static class AvatarPagePatch
{
[HarmonyPatch(typeof(AvatarsPanelView), "Awake")]
[HarmonyPostfix]
private static void AwakePatch(AvatarsPanelView __instance)
{
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_011e: Unknown result type (might be due to invalid IL or missing references)
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: Unknown result type (might be due to invalid IL or missing references)
//IL_014b: Unknown result type (might be due to invalid IL or missing references)
GameObject val = Object.Instantiate<GameObject>(__instance.forwardButton);
GameObject val2 = Object.Instantiate<GameObject>(__instance.backButton);
Button component = val.GetComponent<Button>();
Button component2 = val2.GetComponent<Button>();
val.transform.SetParent(__instance.forwardButton.transform.parent);
val2.transform.SetParent(__instance.backButton.transform.parent);
val.transform.position = __instance.forwardButton.transform.position;
val.transform.localScale = __instance.forwardButton.transform.localScale;
val.transform.localRotation = __instance.forwardButton.transform.localRotation;
Vector3 localPosition = val.transform.localPosition;
localPosition.x += 82f;
val.transform.localPosition = localPosition;
val2.transform.position = __instance.backButton.transform.position;
val2.transform.localScale = __instance.backButton.transform.localScale;
val2.transform.localRotation = __instance.backButton.transform.localRotation;
Vector3 localPosition2 = val2.transform.localPosition;
localPosition2.x -= 82f;
val2.transform.localPosition = localPosition2;
for (int i = 0; (float)i < Preferences.Amount.Value - 1f; i++)
{
((UnityEvent)component.onClick).AddListener(UnityAction.op_Implicit((Action)__instance.NextPage));
}
for (int j = 0; (float)j < Preferences.Amount.Value - 1f; j++)
{
((UnityEvent)component2.onClick).AddListener(UnityAction.op_Implicit((Action)__instance.PrevPage));
}
val.transform.parent = __instance.forwardButton.transform;
val2.transform.parent = __instance.backButton.transform;
}
}
[HarmonyPatch]
private static class LevelPagePatch
{
[HarmonyPatch(typeof(LevelsPanelView), "Awake")]
[HarmonyPostfix]
private static void AwakePatch(LevelsPanelView __instance)
{
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_011e: Unknown result type (might be due to invalid IL or missing references)
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: Unknown result type (might be due to invalid IL or missing references)
//IL_014b: Unknown result type (might be due to invalid IL or missing references)
GameObject val = Object.Instantiate<GameObject>(__instance.forwardButton);
GameObject val2 = Object.Instantiate<GameObject>(__instance.backButton);
Button component = val.GetComponent<Button>();
Button component2 = val2.GetComponent<Button>();
val.transform.SetParent(__instance.forwardButton.transform.parent);
val2.transform.SetParent(__instance.backButton.transform.parent);
val.transform.position = __instance.forwardButton.transform.position;
val.transform.localScale = __instance.forwardButton.transform.localScale;
val.transform.localRotation = __instance.forwardButton.transform.localRotation;
Vector3 localPosition = val.transform.localPosition;
localPosition.x += 82f;
val.transform.localPosition = localPosition;
val2.transform.position = __instance.backButton.transform.position;
val2.transform.localScale = __instance.backButton.transform.localScale;
val2.transform.localRotation = __instance.backButton.transform.localRotation;
Vector3 localPosition2 = val2.transform.localPosition;
localPosition2.x -= 82f;
val2.transform.localPosition = localPosition2;
for (int i = 0; (float)i < Preferences.Amount.Value - 1f; i++)
{
((UnityEvent)component.onClick).AddListener(UnityAction.op_Implicit((Action)__instance.NextPage));
}
for (int j = 0; (float)j < Preferences.Amount.Value - 1f; j++)
{
((UnityEvent)component2.onClick).AddListener(UnityAction.op_Implicit((Action)__instance.PrevPage));
}
val.transform.parent = __instance.forwardButton.transform;
val2.transform.parent = __instance.backButton.transform;
}
}
internal const string Name = "QuickAvatarMenu";
internal const string Description = "Adds buttons to go forwards and backwards a configurable amount pages in the avatar menu.";
internal const string Author = "Checkerboard";
internal const string Company = null;
internal const string Version = "1.0.1";
internal const string DownloadLink = null;
public override void OnInitializeMelon()
{
Preferences.Setup();
}
}
internal class Preferences
{
public static readonly MelonPreferences_Category ModCategory = MelonPreferences.CreateCategory("Quick Avatar Menu");
public static MelonPreferences_Entry<float> Amount;
public static void Setup()
{
Amount = ModCategory.CreateEntry<float>("Amount", 10f, "Amount of pages to skip when using the buttons.", (string)null, false, false, (ValueValidator)null, (string)null);
ModCategory.SaveToFile(false);
}
}
}