diff --git a/MiraAPI/Patches/Menu/HatsTabPatches.cs b/MiraAPI/Patches/Menu/HatsTabPatches.cs index 8d36e9c..d241a74 100644 --- a/MiraAPI/Patches/Menu/HatsTabPatches.cs +++ b/MiraAPI/Patches/Menu/HatsTabPatches.cs @@ -125,9 +125,17 @@ public static class HatsTabPatches { var colorChip = Object.Instantiate(__instance.ColorTabPrefab, __instance.scroller.Inner); colorChip.gameObject.name = hat.ProductId; - colorChip.Button.OnClick.AddListener((Action)(() => __instance.ClickEquip())); - colorChip.Button.OnMouseOver.AddListener((Action)(() => __instance.SelectHat(hat))); - colorChip.Button.OnMouseOut.AddListener((Action)(() => __instance.SelectHat(HatManager.Instance.GetHatById(DataManager.Player.Customization.Hat)))); + if (ActiveInputManager.currentControlType == ActiveInputManager.InputType.Keyboard) + { + colorChip.Button.OnClick.AddListener((Action)__instance.ClickEquip); + colorChip.Button.OnMouseOver.AddListener((Action)(() => __instance.SelectHat(hat))); + colorChip.Button.OnMouseOut.AddListener((Action)(() => __instance.SelectHat(HatManager.Instance.GetHatById(DataManager.Player.Customization.Hat)))); + } + else + { + colorChip.Button.OnClick.AddListener((Action)(() => __instance.SelectHat(hat))); + } + colorChip.Inner.SetHat(hat, __instance.HasLocalPlayer() ? PlayerControl.LocalPlayer.Data.DefaultOutfit.ColorId : DataManager.Player.Customization.Color); colorChip.Button.ClickMask = __instance.scroller.Hitbox; colorChip.SelectionHighlight.gameObject.SetActive(false); diff --git a/MiraAPI/Patches/Menu/NameplatesTabPatches.cs b/MiraAPI/Patches/Menu/NameplatesTabPatches.cs index 11657a0..c40ca67 100644 --- a/MiraAPI/Patches/Menu/NameplatesTabPatches.cs +++ b/MiraAPI/Patches/Menu/NameplatesTabPatches.cs @@ -99,9 +99,20 @@ public static class NameplatesTabPatches { var colorChip = Object.Instantiate(__instance.ColorTabPrefab, __instance.scroller.Inner); colorChip.gameObject.name = namePlate.ProductId; - colorChip.Button.OnClick.AddListener((Action)(() => __instance.ClickEquip())); - colorChip.Button.OnMouseOver.AddListener((Action)(() => __instance.SelectNameplate(namePlate))); - colorChip.Button.OnMouseOut.AddListener((Action)(() => __instance.SelectNameplate(HatManager.Instance.GetNamePlateById(DataManager.Player.Customization.NamePlate)))); + + if (ActiveInputManager.currentControlType == ActiveInputManager.InputType.Keyboard) + { + colorChip.Button.OnClick.AddListener((Action)__instance.ClickEquip); + colorChip.Button.OnMouseOver.AddListener((Action)(() => __instance.SelectNameplate(namePlate))); + colorChip.Button.OnMouseOut.AddListener( + (Action)(() => __instance.SelectNameplate( + HatManager.Instance.GetNamePlateById(DataManager.Player.Customization.NamePlate)))); + } + else + { + colorChip.Button.OnClick.AddListener((Action)(() => __instance.SelectNameplate(namePlate))); + } + colorChip.Button.ClickMask = __instance.scroller.Hitbox; colorChip.ProductId = namePlate.ProdId; diff --git a/MiraAPI/Patches/Menu/SkinsTabPatches.cs b/MiraAPI/Patches/Menu/SkinsTabPatches.cs index 9378d8b..a9fc586 100644 --- a/MiraAPI/Patches/Menu/SkinsTabPatches.cs +++ b/MiraAPI/Patches/Menu/SkinsTabPatches.cs @@ -102,9 +102,18 @@ public static class SkinsTabPatches { var colorChip = Object.Instantiate(__instance.ColorTabPrefab, __instance.scroller.Inner); colorChip.gameObject.name = skin.ProductId; - colorChip.Button.OnClick.AddListener((Action)(() => __instance.ClickEquip())); - colorChip.Button.OnMouseOver.AddListener((Action)(() => __instance.SelectSkin(skin))); - colorChip.Button.OnMouseOut.AddListener((Action)(() => __instance.SelectSkin(HatManager.Instance.GetSkinById(DataManager.Player.Customization.Skin)))); + if (ActiveInputManager.currentControlType == ActiveInputManager.InputType.Keyboard) + { + colorChip.Button.OnClick.AddListener((Action)__instance.ClickEquip); + colorChip.Button.OnMouseOver.AddListener((Action)(() => __instance.SelectSkin(skin))); + colorChip.Button.OnMouseOut.AddListener( + (Action)(() => + __instance.SelectSkin(HatManager.Instance.GetSkinById(DataManager.Player.Customization.Skin)))); + } + else + { + colorChip.Button.OnClick.AddListener((Action)(() => __instance.SelectSkin(skin))); + } colorChip.Button.ClickMask = __instance.scroller.Hitbox; colorChip.ProductId = skin.ProductId; colorChip.SelectionHighlight.gameObject.SetActive(false); diff --git a/MiraAPI/Patches/Menu/VisorsTabPatches.cs b/MiraAPI/Patches/Menu/VisorsTabPatches.cs index 92d5b8e..4c7fd61 100644 --- a/MiraAPI/Patches/Menu/VisorsTabPatches.cs +++ b/MiraAPI/Patches/Menu/VisorsTabPatches.cs @@ -98,9 +98,20 @@ public static class VisorsTabPatches { var colorChip = Object.Instantiate(__instance.ColorTabPrefab, __instance.scroller.Inner); colorChip.gameObject.name = visor.ProductId; - colorChip.Button.OnClick.AddListener((Action)(() => __instance.ClickEquip())); - colorChip.Button.OnMouseOver.AddListener((Action)(() => __instance.SelectVisor(visor))); - colorChip.Button.OnMouseOut.AddListener((Action)(() => __instance.SelectVisor(HatManager.Instance.GetVisorById(DataManager.Player.Customization.Visor)))); + + if (ActiveInputManager.currentControlType == ActiveInputManager.InputType.Keyboard) + { + colorChip.Button.OnClick.AddListener((Action)__instance.ClickEquip); + colorChip.Button.OnMouseOver.AddListener((Action)(() => __instance.SelectVisor(visor))); + colorChip.Button.OnMouseOut.AddListener( + (Action)(() => + __instance.SelectVisor(HatManager.Instance.GetVisorById(DataManager.Player.Customization.Visor)))); + } + else + { + colorChip.Button.OnClick.AddListener((Action)(() => __instance.SelectVisor(visor))); + } + colorChip.Button.ClickMask = __instance.scroller.Hitbox; colorChip.ProductId = visor.ProductId; colorChip.SelectionHighlight.gameObject.SetActive(false);