mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-11-07 12:07:05 +01:00
Replace MenuManagerCS2 with Panorama UI Kit for the admin menus and css_vote. Layout names (menu, vote, banner, toast) are configurable under MenuConfig and preloaded on startup; MenuType is removed and ConfigVersion bumped to 26. - Drop MenuManagerApi.dll and the old chat menu classes - Reference PanoramaUiKit.Shared.dll, bump CounterStrikeSharp to 1.0.376 - Add .editorconfig and CODING_CONVENTIONS.md, apply them codebase-wide - Remove the CS2-SimpleAdmin-docs site - Rewrite README for the fork
46 lines
1.5 KiB
C#
46 lines
1.5 KiB
C#
namespace CS2_SimpleAdminApi;
|
|
|
|
/// <summary>
|
|
/// Provides contextual information about a menu to its factory function.
|
|
/// This eliminates the need to duplicate category IDs and menu titles when creating menus.
|
|
/// </summary>
|
|
public class MenuContext
|
|
{
|
|
/// <summary>
|
|
/// The category ID this menu belongs to (e.g., "fun", "players").
|
|
/// Used for automatic "Back" button navigation.
|
|
/// </summary>
|
|
public string CategoryId { get; init; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// The unique identifier for this menu within its category.
|
|
/// </summary>
|
|
public string MenuId { get; init; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// The display title of the menu (from registration).
|
|
/// </summary>
|
|
public string MenuTitle { get; init; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// The permission required to access this menu (if any).
|
|
/// </summary>
|
|
public string? Permission { get; init; }
|
|
|
|
/// <summary>
|
|
/// The command name for permission override checking (if any).
|
|
/// </summary>
|
|
public string? CommandName { get; init; }
|
|
|
|
/// <summary>
|
|
/// Creates a new MenuContext with the specified values.
|
|
/// </summary>
|
|
public MenuContext(string categoryId, string menuId, string menuTitle, string? permission = null, string? commandName = null)
|
|
{
|
|
CategoryId = categoryId;
|
|
MenuId = menuId;
|
|
MenuTitle = menuTitle;
|
|
Permission = permission;
|
|
CommandName = commandName;
|
|
}
|
|
}
|