2023-09-03 02:06:53 -04:00
|
|
|
|
using HarmonyLib;
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace CustomCosmeticLoader.Patches
|
|
|
|
|
{
|
2023-09-08 00:24:00 -04:00
|
|
|
|
/*
|
|
|
|
|
* Show your custom marble skin on the "My Marble" display on the main menu (if configured).
|
|
|
|
|
*/
|
2023-09-03 02:06:53 -04:00
|
|
|
|
[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 (__instance.cosmeticDisplay)
|
|
|
|
|
{
|
|
|
|
|
__instance.cosmeticDisplay.Clear();
|
|
|
|
|
GameObjectAllocator.Deinitialize(__instance.cosmeticDisplay.gameObject);
|
|
|
|
|
__instance.cosmeticDisplay.Setup(Shared.SkinToHijack, CosmeticType.Skin, true, true);
|
|
|
|
|
Shared.ApplyCustomTexture(__instance.cosmeticDisplay.CachedCosmeticGameObject);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|