From 554a83f99428e0ead66d5879b952b5d5bb349f99 Mon Sep 17 00:00:00 2001 From: Terry Hearst Date: Fri, 8 Sep 2023 00:24:00 -0400 Subject: [PATCH] Document the patches --- Patches/MainMenuPanelPatches.cs | 3 +++ Patches/MarbleControllerPatches.cs | 4 ++++ Patches/MarbleHolderPatches.cs | 8 ++++++++ 3 files changed, 15 insertions(+) diff --git a/Patches/MainMenuPanelPatches.cs b/Patches/MainMenuPanelPatches.cs index bbc943d..40d07d4 100644 --- a/Patches/MainMenuPanelPatches.cs +++ b/Patches/MainMenuPanelPatches.cs @@ -3,6 +3,9 @@ using System; namespace CustomCosmeticLoader.Patches { + /* + * Show your custom marble skin on the "My Marble" display on the main menu (if configured). + */ [HarmonyPatch(typeof(MainMenuPanel), nameof(MainMenuPanel.SetupImages), new Type[] { typeof(bool) })] internal class MainMenuPanelSetupImagesPatch { diff --git a/Patches/MarbleControllerPatches.cs b/Patches/MarbleControllerPatches.cs index 1949e35..1182051 100644 --- a/Patches/MarbleControllerPatches.cs +++ b/Patches/MarbleControllerPatches.cs @@ -4,6 +4,10 @@ using UnityEngine; namespace CustomCosmeticLoader.Patches { + /* + * Hijack the cosmetic of the marble in single player. This doesn't apply the custom texture, just swaps out the + * marble with the designated marble to hijack. + */ [HarmonyPatch(typeof(MarbleController), nameof(MarbleController.ApplyMyCosmetics))] internal class MarbleControllerApplyMyCosmeticsPatch { diff --git a/Patches/MarbleHolderPatches.cs b/Patches/MarbleHolderPatches.cs index 81e47f0..616b986 100644 --- a/Patches/MarbleHolderPatches.cs +++ b/Patches/MarbleHolderPatches.cs @@ -18,6 +18,10 @@ namespace CustomCosmeticLoader.Patches } } + /* + * Applies the custom skin texture to the marble in both singleplayer and multiplayer, if the cosmetic chosen is the + * one we're hijacking. In multiplayer, do some extra checks to only apply the custom texture to our marble + */ [HarmonyPatch(typeof(MarbleHolder), nameof(MarbleHolder.SetMarble))] internal class MarbleHolderSetMarblePatch { @@ -51,6 +55,10 @@ namespace CustomCosmeticLoader.Patches } } + /* + * In multiplayer, hijack the current marble and set it to be the marble we're hijacking. Later, the actual texture + * will be replaced by the patch above + */ [HarmonyPatch(typeof(MarbleHolder), nameof(MarbleHolder.CheckSet))] internal class MarbleHolderCheckSetPatch {