mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-02-17 18:39:07 +00:00
Add CS2-SimpleAdmin documentation site
Introduces a new documentation site for CS2-SimpleAdmin using Docusaurus, including developer API references, tutorials, user guides, and module documentation. Removes the CleanModule example and updates FunCommands and ExampleModule. Also updates main plugin and API files to support new documentation and module structure.
This commit is contained in:
48
CS2-SimpleAdminApi/MenuContext.cs
Normal file
48
CS2-SimpleAdminApi/MenuContext.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using CounterStrikeSharp.API.Core;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user