Patch_Menuu_EraseCharacter.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using GadgetCore.API;
  2. using HarmonyLib;
  3. namespace IronmanChest.Patches
  4. {
  5. [HarmonyPatch(typeof(Menuu))]
  6. [HarmonyPatch(nameof(Menuu.EraseCharacter))]
  7. [HarmonyGadget("IronmanChest")]
  8. public static class Patch_Menuu_EraseCharacter
  9. {
  10. [HarmonyPrefix]
  11. [HarmonyPriority(Priority.Low)]
  12. public static void Prefix(Menuu __instance, int a)
  13. {
  14. if (Menuu.curProfession == 1)
  15. {
  16. PreviewLabs.PlayerPrefs.SetInt(a + "ironmanstorageLevel", 0);
  17. for (int i = 0; i < Core.settingAmountPages * Core.settingAmountSlots; i++)
  18. {
  19. PreviewLabs.PlayerPrefs.SetInt(a + "ironmanstorage" + i + "id", 0);
  20. PreviewLabs.PlayerPrefs.SetInt(a + "ironmanstorage" + i + "q", 0);
  21. PreviewLabs.PlayerPrefs.SetInt(a + "ironmanstorage" + i + "exp", 0);
  22. PreviewLabs.PlayerPrefs.SetInt(a + "ironmanstorage" + i + "tier", 0);
  23. PreviewLabs.PlayerPrefs.SetInt(a + "ironmanstorage" + i + "corrupted", 0);
  24. PreviewLabs.PlayerPrefs.SetInt(a + "ironmanstorage" + i + "a0", 0);
  25. PreviewLabs.PlayerPrefs.SetInt(a + "ironmanstorage" + i + "a1", 0);
  26. PreviewLabs.PlayerPrefs.SetInt(a + "ironmanstorage" + i + "a2", 0);
  27. PreviewLabs.PlayerPrefs.SetInt(a + "ironmanstorage" + i + "aL0", 0);
  28. PreviewLabs.PlayerPrefs.SetInt(a + "ironmanstorage" + i + "aL1", 0);
  29. PreviewLabs.PlayerPrefs.SetInt(a + "ironmanstorage" + i + "aL2", 0);
  30. }
  31. }
  32. }
  33. }
  34. }