using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using Extensions;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("TestingGWFmods")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TestingGWFmods")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("932ec7a6-3d7f-4cb4-9e82-fa7d319bcfdc")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace GWYF_FirstMod;
[BepInPlugin("victor.gwyf.cosmeticunlocker", "Victor's Cosmetic Unlocker", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
private bool unlockedAlready = false;
private void Awake()
{
((BaseUnityPlugin)this).Logger.LogInfo((object)"Victor's Cosmetic Unlocker loaded. Press F9 in-game to unlock cosmetics.");
}
private void Update()
{
if (Keyboard.current != null && ((ButtonControl)Keyboard.current.f9Key).wasPressedThisFrame)
{
TryUnlockCosmetics();
}
}
private void TryUnlockCosmetics()
{
if (unlockedAlready)
{
((BaseUnityPlugin)this).Logger.LogInfo((object)"Already attempted unlock this session.");
return;
}
if ((Object)(object)MonoSingleton<CosmeticsUnlockManager>.Instance == (Object)null)
{
((BaseUnityPlugin)this).Logger.LogWarning((object)"CosmeticsUnlockManager.Instance is null. Start/load into a game first, then press F9 again.");
return;
}
CosmeticData[] array = Resources.LoadAll<CosmeticData>("Cosmetics");
((BaseUnityPlugin)this).Logger.LogInfo((object)$"Found {array.Length} cosmetics.");
int num = 0;
int num2 = 0;
CosmeticData[] array2 = array;
foreach (CosmeticData val in array2)
{
if (MonoSingleton<CosmeticsUnlockManager>.Instance.IsCosmeticUnlocked(val.cosmeticId))
{
num2++;
}
else if (MonoSingleton<CosmeticsUnlockManager>.Instance.UnlockCosmetic(val.cosmeticId))
{
num++;
((BaseUnityPlugin)this).Logger.LogInfo((object)$"Unlocked: {val.cosmeticName} ({val.cosmeticId})");
}
}
unlockedAlready = true;
((BaseUnityPlugin)this).Logger.LogInfo((object)$"Done. Newly unlocked: {num}. Already unlocked: {num2}.");
}
}