diff --git a/Config.cs b/Config.cs index b1f4bcc..b89d691 100644 --- a/Config.cs +++ b/Config.cs @@ -16,10 +16,12 @@ namespace CustomCosmeticLoader public const string PROPERTY_ENABLED = "enabled"; public const string PROPERTY_CURRENT_SKIN = "currentSkin"; public const string PROPERTY_SKIN_TO_HIJACK = "skinToHijack"; + public const string PROPERTY_IN_COSMETIC_MENU = "inCosmeticMenu"; public static bool enabled = true; public static string currentSkin; public static string skinToHijack = "Swirl_M"; // Mirage, simple skin with nice properties + public static bool inCosmeticMenu = false; public static Dictionary skins = new Dictionary(); @@ -71,6 +73,9 @@ namespace CustomCosmeticLoader if (data[PROPERTY_SKIN_TO_HIJACK] != null) skinToHijack = data[PROPERTY_SKIN_TO_HIJACK].Value; + + if (data[PROPERTY_IN_COSMETIC_MENU] != null) + inCosmeticMenu = data[PROPERTY_IN_COSMETIC_MENU].AsBool; } public static void SaveConfig() @@ -79,7 +84,8 @@ namespace CustomCosmeticLoader { { PROPERTY_ENABLED, enabled ? "true" : "false" }, { PROPERTY_CURRENT_SKIN, currentSkin }, - { PROPERTY_SKIN_TO_HIJACK, skinToHijack } + { PROPERTY_SKIN_TO_HIJACK, skinToHijack }, + { PROPERTY_IN_COSMETIC_MENU, inCosmeticMenu ? "true" : "false" }, }; File.WriteAllText(GetConfigPath(), node.ToString()); diff --git a/Patches/MarbleHolderPatches.cs b/Patches/MarbleHolderPatches.cs index 54f8554..40954ab 100644 --- a/Patches/MarbleHolderPatches.cs +++ b/Patches/MarbleHolderPatches.cs @@ -14,6 +14,9 @@ namespace CustomCosmeticLoader.Patches if (marbleObject.Id != Config.skinToHijack && Config.skinToHijack != "*") return; + + if (!Config.inCosmeticMenu && __instance == CosmeticPanel.cosmHolder) + return; MeshRenderer[] componentsInChildren = __instance.currentMarble.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++)