using CounterStrikeSharp.API.Core; namespace CS2_SimpleAdminApi; /// /// Provides contextual information about a menu to its factory function. /// This eliminates the need to duplicate category IDs and menu titles when creating menus. /// public class MenuContext { /// /// The category ID this menu belongs to (e.g., "fun", "players"). /// Used for automatic "Back" button navigation. /// public string CategoryId { get; init; } = string.Empty; /// /// The unique identifier for this menu within its category. /// public string MenuId { get; init; } = string.Empty; /// /// The display title of the menu (from registration). /// public string MenuTitle { get; init; } = string.Empty; /// /// The permission required to access this menu (if any). /// public string? Permission { get; init; } /// /// The command name for permission override checking (if any). /// public string? CommandName { get; init; } /// /// Creates a new MenuContext with the specified values. /// public MenuContext(string categoryId, string menuId, string menuTitle, string? permission = null, string? commandName = null) { CategoryId = categoryId; MenuId = menuId; MenuTitle = menuTitle; Permission = permission; CommandName = commandName; } }