mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
Hide roles tab if no roles in mod
This commit is contained in:
1 parent
eef098317e
commit
d4a675f2a9
1 file changed
+4
-1
@@ -1,11 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Il2CppInterop.Runtime.Attributes;
|
||||
using MiraAPI.GameModes;
|
||||
using MiraAPI.GameOptions;
|
||||
using MiraAPI.Modifiers;
|
||||
using MiraAPI.PluginLoading;
|
||||
using MiraAPI.Presets;
|
||||
using MiraAPI.Roles;
|
||||
using MiraAPI.Utilities.Assets;
|
||||
using Reactor.Utilities.Attributes;
|
||||
using Reactor.Utilities.Extensions;
|
||||
@@ -413,7 +415,8 @@ public class MenuState(IntPtr cppPtr) : MonoBehaviour(cppPtr)
|
||||
var hasOptions =
|
||||
CurrentMod.InternalOptionGroups.Exists(g =>
|
||||
g.OptionableType == null && g.ParentMenu == MenuCategory.Game);
|
||||
var hasRoles = CurrentMod.InternalRoles.Count > 0;
|
||||
var customRoles = CurrentMod.InternalRoles.Values.OfType<ICustomRole>();
|
||||
var hasRoles = customRoles.Any(x => x.VisibleInSettings.Invoke());
|
||||
var hasModifiers = CurrentMod.InternalOptionGroups.Exists(g =>
|
||||
g.OptionableType?.IsAssignableTo(typeof(BaseModifier)) == true
|
||||
|| g.ParentMenu == MenuCategory.Modifiers);
|
||||
|
||||
Reference in new issue
Block a user