mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 11:40:52 +01:00
* 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.
64 lines
1.7 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|
|
}
|