using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using Empress_ShopLoaderAPI;
using HarmonyLib;
using UnityEngine;
using UnityEngine.SceneManagement;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("MVP_JapaneseStreet_Shop")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MVP_JapaneseStreet_Shop")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("330cf532-bec1-4d80-aa4e-03ca4a9aa6c7")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("dev.thatdrw.mvp.japanesestreetshopmod", "MVP JapaneseStreet ShopMod", "1.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class MVP_JapaneseStreet_ShopMod : BaseUnityPlugin
{
public void Awake()
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Expected O, but got Unknown
((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin loaded, preparing initialization.");
Harmony val = new Harmony("dev.thatdrw.mvp.japanesestreetshopmod");
val.PatchAll();
SceneManager.sceneLoaded += OnSceneLoaded;
HookShopAPI();
}
public void HookShopAPI()
{
string text = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "mvp_japanesestreetshopmod_bundle");
AssetBundle val = AssetBundle.LoadFromFile(text);
if (!((Object)(object)val == (Object)null))
{
GameObject val2 = val.LoadAsset<GameObject>("Shop Generic N - JapaneseStreet Shop");
if ((Object)(object)val2 != (Object)null)
{
ShopAPI.RegisterShop(val2, "DaRealMVP/JapaneseStreet");
}
}
}
public void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Expected O, but got Unknown
((BaseUnityPlugin)this).Logger.LogInfo((object)("Scene loaded: " + ((Scene)(ref scene)).name));
if ((Object)(object)GameObject.Find("MVPJapaneseStreetShopModHandler") == (Object)null)
{
GameObject val = new GameObject("MVPJapaneseStreetShopModHandler");
val.AddComponent<MVP_JapaneseStreet_ShopModHandler>();
Object.DontDestroyOnLoad((Object)(object)val);
}
}
public void Start()
{
}
public void Update()
{
}
}
public class MVP_JapaneseStreet_ShopModHandler : MonoBehaviour
{
public bool levelInitialized;
public object levelGeneratorInstance;
public Type levelGeneratorType;
public void Update()
{
LogKeyInputs();
if (!levelInitialized && TryGetLevelGeneratorInstance(out levelGeneratorInstance, out levelGeneratorType))
{
FieldInfo field = levelGeneratorType.GetField("Generated", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
if (field != null && (bool)field.GetValue(levelGeneratorInstance))
{
levelInitialized = true;
Debug.Log((object)"Level is initialized and LG.Generated == true");
}
}
}
public void LogKeyInputs()
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: 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)
foreach (KeyCode value in Enum.GetValues(typeof(KeyCode)))
{
if (!Input.GetKeyDown(value))
{
}
}
}
public bool TryGetLevelGeneratorInstance(out object instance, out Type type)
{
type = AppDomain.CurrentDomain.GetAssemblies().SelectMany((Assembly a) => a.GetTypes()).FirstOrDefault((Type t) => t.Name == "LevelGenerator");
if (type != null)
{
FieldInfo field = type.GetField("Instance", BindingFlags.Static | BindingFlags.Public);
if (field != null)
{
instance = field.GetValue(null);
return instance != null;
}
}
instance = null;
return false;
}
public void OnClickVendingMachineA()
{
Debug.Log((object)"VendingMachineA's button was pressed!");
}
public void OnClickVendingMachineB()
{
Debug.Log((object)"VendingMachineB's button was pressed!");
}
}