using HarmonyLib; using System; namespace CustomCosmeticLoader.Patches { [HarmonyPatch(typeof(MainMenuPanel), nameof(MainMenuPanel.SetupImages), new Type[] { typeof(bool) })] internal class MainMenuPanelSetupImagesPatch { static void Postfix(MainMenuPanel __instance) { if (!Config.enabled) return; if (!Config.inMainMenu) return; if (Config.skinNameToHijack == "*") return; if (Shared.SkinToHijack == null) return; if (__instance.cosmeticDisplay) { __instance.cosmeticDisplay.Clear(); GameObjectAllocator.Deinitialize(__instance.cosmeticDisplay.gameObject); __instance.cosmeticDisplay.Setup(Shared.SkinToHijack, CosmeticType.Skin, true, true); Shared.ApplyCustomTexture(__instance.cosmeticDisplay.CachedCosmeticGameObject); } } } }