// Copyright Epic Games, Inc. All Rights Reserved.
using System;
namespace P4VUtils
{
public enum CommandCategory
{
///
/// Commands that help with common but simple operations
///
Root,
///
/// Commands that help with operations relating to content files
///
Content,
///
/// Commands that help with common but simple operations
///
Toolbox,
///
/// Complex commands to facilitate integrations
///
Integrate,
///
/// Local build and horde preflights
///
Horde,
///
/// Commands that open pages in the users browser
///
Browser
}
///
/// Attribute used to define a class as a Command to hook into P4V
///
/// Containing attributes to define the cli name of the command, the categorization of the command, and the order it appears in the UI.
///
[AttributeUsage(AttributeTargets.Class)]
public sealed class CommandAttribute : System.Attribute
{
///
/// Command name, use to reference the command via command line args
///
public string CommandName { get; internal set; } = null!;
///
/// Category to organize into UI Elements.
///
public CommandCategory Category { get; internal set; }
///
/// Used to preserve previous order.
///
/// Defaults to int.MaxValue to ensure any new items appear at the end of the sub menus.
///
public int Order { get; internal set; }
public CommandAttribute(string commandName, CommandCategory category, int order = int.MaxValue)
{
CommandName = commandName;
Category = category;
Order = order;
}
}
}