Files
RobustToolbox/Robust.Client/UserInterface/Control.Cursor.cs
Acruid 2183cd7ca1 Massive Namespace Cleanup (#1544)
* Removed the Interfaces folder.
* All objects inside the GameObjects subfolders are now in the GameObjects namespace.
* Added a Resharper DotSettings file to mark the GameObjects subfolders as not providing namespaces.
* Simplified Robust.client.Graphics namespace.
* Automated remove redundant using statements.
2021-02-10 23:27:19 -08:00

64 lines
1.7 KiB
C#

using System;
using Robust.Client.Graphics;
namespace Robust.Client.UserInterface
{
public partial class Control
{
private CursorShape _cursorShape;
private ICursor? _customCursor;
/// <summary>
/// Default common cursor shapes available in the UI.
/// </summary>
public enum CursorShape: byte
{
Arrow,
IBeam,
Crosshair,
Hand,
HResize,
VResize,
/// <summary>
/// Special cursor shape indicating that <see cref="CustomCursorShape"/> is set and being used.
/// </summary>
Custom,
}
/// <summary>
/// The shape the cursor will get when being over this control.
/// </summary>
public CursorShape DefaultCursorShape
{
get => _cursorShape;
set
{
if (value == CursorShape.Custom)
{
throw new ArgumentException(
"Cannot set to CursorShape.Custom directly. Set CustomCursorShape instead.");
}
_cursorShape = value;
_customCursor = null;
UserInterfaceManagerInternal.CursorChanged(this);
}
}
/// <summary>
/// Custom cursor shape to use.
/// </summary>
public ICursor? CustomCursorShape
{
get => _customCursor;
set
{
_customCursor = value;
_cursorShape = value == null ? CursorShape.Arrow : CursorShape.Custom;
UserInterfaceManagerInternal.CursorChanged(this);
}
}
}
}