Add comment + simplify syntax

This commit is contained in:
Terry Hearst 2024-01-02 01:24:29 -05:00
parent af4ef66db5
commit f0275dccf3
2 changed files with 5 additions and 2 deletions

View file

@ -5,6 +5,9 @@ using UnityEngine;
namespace CustomCosmeticLoader.Patches namespace CustomCosmeticLoader.Patches
{ {
/*
* Hijack the marble of a ghost marble if it's in our custom player list, and apply the custom texture
*/
[HarmonyPatch(typeof(GhostRaceMarbleController), nameof(GhostRaceMarbleController.ApplyCosmetics))] [HarmonyPatch(typeof(GhostRaceMarbleController), nameof(GhostRaceMarbleController.ApplyCosmetics))]
internal class GhostRaceMarbleControllerApplyCosmeticsPatch internal class GhostRaceMarbleControllerApplyCosmeticsPatch
{ {

View file

@ -19,9 +19,9 @@ namespace CustomCosmeticLoader.Patches
return true; return true;
Cosmetic skin = Config.skinNameToHijack == "*" ? Cosmetic skin = Config.skinNameToHijack == "*" ?
(CosmeticManager.MySkin == null ? CosmeticManager.Skins[0] : CosmeticManager.MySkin) : (CosmeticManager.MySkin ?? CosmeticManager.Skins[0]) :
Shared.SkinToHijack; Shared.SkinToHijack;
Cosmetic hat = CosmeticManager.MyHat == null ? CosmeticManager.Hats[0] : CosmeticManager.MyHat; Cosmetic hat = CosmeticManager.MyHat ?? CosmeticManager.Hats[0];
__instance.SetCosmetic(skin, hat); __instance.SetCosmetic(skin, hat);
Shared.ApplyCustomTexture(__instance.cosmeticDisplay.gameObject); Shared.ApplyCustomTexture(__instance.cosmeticDisplay.gameObject);