From 5fd57633ff96c60227f3ea1f7a3ad3b4db367dc1 Mon Sep 17 00:00:00 2001 From: WanderingPixel <126269533+WanderingPix@users.noreply.github.com> Date: Thu, 11 Sep 2025 11:01:35 +0100 Subject: [PATCH] Update RoleSettingMenuPatches.cs --- .../Patches/Options/RoleSettingMenuPatches.cs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/MiraAPI/Patches/Options/RoleSettingMenuPatches.cs b/MiraAPI/Patches/Options/RoleSettingMenuPatches.cs index d99d2e5..d6eb035 100644 --- a/MiraAPI/Patches/Options/RoleSettingMenuPatches.cs +++ b/MiraAPI/Patches/Options/RoleSettingMenuPatches.cs @@ -532,6 +532,18 @@ public static class RoleSettingMenuPatches roleOptionSetting.titleText.color = customRole.OptionsMenuColor.FindAlternateColor(); roleOptionSetting.titleText.horizontalAlignment = HorizontalAlignmentOptions.Left; + if (customRole.Configuration.Icon != null) + { + var roleIcon = new GameObject("RoleIcon"); + roleIcon.transform.parent = roleOptionSetting.transform; + roleIcon.transform.localScale = new(.25f, .25f, 1); + roleIcon.layer = LayerMask.NameToLayer("UI"); + roleIcon.transform.localPosition = new Vector3(-1.3f, -0.3f, -2f); + var rend = roleIcon.AddComponent(); + rend.sprite = customRole.Configuration.Icon.LoadAsset(); + rend.maskInteraction = SpriteMaskInteraction.VisibleInsideMask; + } + if (GameSettingMenuPatches.SelectedMod is null || GameSettingMenuPatches.SelectedMod.InternalOptionGroups .Exists(x => x.GroupVisible() && x.OptionableType == role.GetType() && x.Options.Any(y => y.Visible()))) @@ -551,18 +563,6 @@ public static class RoleSettingMenuPatches passiveButton.interactableHoveredColor = Color.white; passiveButton.OnClick.AddListener((UnityAction)(() => { ChangeTab(role, __instance); })); - - if (customRole.Configuration.Icon != null) - { - var roleIcon = new GameObject("RoleIcon"); - roleIcon.transform.parent = roleOptionSetting.transform; - roleIcon.transform.localScale = new(.25f, .25f, 1); - roleIcon.layer = LayerMask.NameToLayer("UI"); - roleIcon.transform.localPosition = new Vector3(-1.3f, -0.3f, -2f); - var rend = roleIcon.AddComponent(); - rend.sprite = customRole.Configuration.Icon.LoadAsset(); - rend.maskInteraction = SpriteMaskInteraction.VisibleInsideMask; - } } if (customRole.Configuration is { MaxRoleCount: 0 })