26 lines
729 B
C#
26 lines
729 B
C#
|
using HarmonyLib;
|
|||
|
using System;
|
|||
|
|
|||
|
namespace CustomCosmeticLoader.Patches
|
|||
|
{
|
|||
|
/*
|
|||
|
* Override the marble cosmetic to be the hijacked marble if configured to appear in cosmetic menu.
|
|||
|
*/
|
|||
|
[HarmonyPatch(typeof(CosmeticPanel), nameof(CosmeticPanel.SelectCosmetic), new Type[] { typeof(Cosmetic), typeof(CosmeticType), typeof(bool) })]
|
|||
|
internal class CosmeticPanelSelectCosmeticPatch
|
|||
|
{
|
|||
|
static void Postfix(CosmeticType ctype)
|
|||
|
{
|
|||
|
if (!Config.enabled)
|
|||
|
return;
|
|||
|
|
|||
|
if (ctype == CosmeticType.Skin && Config.inCosmeticMenu && Config.skinNameToHijack != "*")
|
|||
|
{
|
|||
|
MarbleHolder holder = CosmeticPanel.cosmHolder;
|
|||
|
holder.SetMarble(Shared.SkinToHijack);
|
|||
|
Shared.ApplyCustomTexture(holder.currentMarble);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|