mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
46 lines
1.1 KiB
C#
46 lines
1.1 KiB
C#
|
|
using System;
|
|
|
|
namespace GlitchyEngine.Editor;
|
|
|
|
/// <summary>
|
|
/// Specifies the visibility of a button.
|
|
/// </summary>
|
|
public enum ButtonVisibility
|
|
{
|
|
/// <summary>
|
|
/// The button will be visible in edit mode.
|
|
/// </summary>
|
|
InEditMode = 1,
|
|
/// <summary>
|
|
/// The button will be visible in play mode.
|
|
/// </summary>
|
|
InPlayMode = 2,
|
|
/// <summary>
|
|
/// The button will always be visible.
|
|
/// </summary>
|
|
Always = InEditMode | InPlayMode
|
|
}
|
|
|
|
/// <summary>
|
|
/// Specifies that a button will be shown in the editor that, when clicked, executes the method this attribute is attached to.
|
|
/// </summary>
|
|
[AttributeUsage(AttributeTargets.Method)]
|
|
public sealed class ShowButtonAttribute : Attribute
|
|
{
|
|
/// <summary>
|
|
/// The text on the button.
|
|
/// </summary>
|
|
public string ButtonText { get; private set; }
|
|
|
|
/// <summary>
|
|
/// Determines whether the button is visible in edit and/or play mode.
|
|
/// </summary>
|
|
public ButtonVisibility Visibility { get; set; } = ButtonVisibility.Always;
|
|
|
|
public ShowButtonAttribute(string buttonText)
|
|
{
|
|
ButtonText = buttonText;
|
|
}
|
|
}
|