Don't hijack marble in cosmetic menu by default

This commit is contained in:
Terry Hearst 2023-09-03 00:21:15 -04:00
parent 4514dc5f90
commit 294c0ba205
2 changed files with 10 additions and 1 deletions

View file

@ -16,10 +16,12 @@ namespace CustomCosmeticLoader
public const string PROPERTY_ENABLED = "enabled"; public const string PROPERTY_ENABLED = "enabled";
public const string PROPERTY_CURRENT_SKIN = "currentSkin"; public const string PROPERTY_CURRENT_SKIN = "currentSkin";
public const string PROPERTY_SKIN_TO_HIJACK = "skinToHijack"; public const string PROPERTY_SKIN_TO_HIJACK = "skinToHijack";
public const string PROPERTY_IN_COSMETIC_MENU = "inCosmeticMenu";
public static bool enabled = true; public static bool enabled = true;
public static string currentSkin; public static string currentSkin;
public static string skinToHijack = "Swirl_M"; // Mirage, simple skin with nice properties public static string skinToHijack = "Swirl_M"; // Mirage, simple skin with nice properties
public static bool inCosmeticMenu = false;
public static Dictionary<string, Texture2D> skins = new Dictionary<string, Texture2D>(); public static Dictionary<string, Texture2D> skins = new Dictionary<string, Texture2D>();
@ -71,6 +73,9 @@ namespace CustomCosmeticLoader
if (data[PROPERTY_SKIN_TO_HIJACK] != null) if (data[PROPERTY_SKIN_TO_HIJACK] != null)
skinToHijack = data[PROPERTY_SKIN_TO_HIJACK].Value; 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() public static void SaveConfig()
@ -79,7 +84,8 @@ namespace CustomCosmeticLoader
{ {
{ PROPERTY_ENABLED, enabled ? "true" : "false" }, { PROPERTY_ENABLED, enabled ? "true" : "false" },
{ PROPERTY_CURRENT_SKIN, currentSkin }, { 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()); File.WriteAllText(GetConfigPath(), node.ToString());

View file

@ -14,6 +14,9 @@ namespace CustomCosmeticLoader.Patches
if (marbleObject.Id != Config.skinToHijack && Config.skinToHijack != "*") if (marbleObject.Id != Config.skinToHijack && Config.skinToHijack != "*")
return; return;
if (!Config.inCosmeticMenu && __instance == CosmeticPanel.cosmHolder)
return;
MeshRenderer[] componentsInChildren = __instance.currentMarble.GetComponentsInChildren<MeshRenderer>(); MeshRenderer[] componentsInChildren = __instance.currentMarble.GetComponentsInChildren<MeshRenderer>();
for (int i = 0; i < componentsInChildren.Length; i++) for (int i = 0; i < componentsInChildren.Length; i++)