2023-08-26 17:59:50 -04:00
|
|
|
|
using HarmonyLib;
|
|
|
|
|
using System;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace CustomCosmeticLoader.Patches
|
|
|
|
|
{
|
2023-09-02 23:19:35 -04:00
|
|
|
|
[HarmonyPatch(typeof(MarbleHolder), nameof(MarbleHolder.SetMarble))]
|
2023-08-26 17:59:50 -04:00
|
|
|
|
internal class MarbleHolderSetMarblePatch
|
|
|
|
|
{
|
|
|
|
|
static void Postfix(MarbleHolder __instance, Cosmetic marbleObject)
|
|
|
|
|
{
|
2023-08-27 02:44:35 -04:00
|
|
|
|
if (!Config.enabled)
|
|
|
|
|
return;
|
|
|
|
|
|
2023-09-03 02:06:53 -04:00
|
|
|
|
if (marbleObject.Id != Config.skinNameToHijack && Config.skinNameToHijack != "*")
|
2023-08-27 02:44:35 -04:00
|
|
|
|
return;
|
2023-09-03 00:21:15 -04:00
|
|
|
|
|
|
|
|
|
if (!Config.inCosmeticMenu && __instance == CosmeticPanel.cosmHolder)
|
|
|
|
|
return;
|
2023-08-26 17:59:50 -04:00
|
|
|
|
|
2023-09-03 02:06:53 -04:00
|
|
|
|
Shared.ApplyCustomTexture(__instance.currentMarble);
|
2023-08-26 17:59:50 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|