using System; using Robust.Client.Graphics; namespace Robust.Client.UserInterface { public partial class Control { private CursorShape _cursorShape; private ICursor? _customCursor; /// /// Default common cursor shapes available in the UI. /// /// public enum CursorShape: byte { /// /// Corresponds to /// Arrow, /// /// Corresponds to /// IBeam, /// /// Corresponds to /// Text = IBeam, /// /// Corresponds to /// Crosshair, /// /// Corresponds to /// Hand, /// /// Corresponds to /// Pointer = Hand, /// /// Corresponds to /// HResize, /// /// Corresponds to /// EWResize = HResize, /// /// Corresponds to /// VResize, /// /// Corresponds to /// NSResize = VResize, /// /// Corresponds to /// Progress, /// /// Corresponds to /// NWSEResize, /// /// Corresponds to /// NESWResize, /// /// Corresponds to /// Move, /// /// Corresponds to /// NotAllowed, /// /// Corresponds to /// NWResize, /// /// Corresponds to /// NResize, /// /// Corresponds to /// NEResize, /// /// Corresponds to /// EResize, /// /// Corresponds to /// SEResize, /// /// Corresponds to /// SResize, /// /// Corresponds to /// SWResize, /// /// Corresponds to /// WResize, /// /// Special cursor shape indicating that is set and being used. /// Custom, } /// /// The shape the cursor will get when being over this control. /// 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); } } /// /// Custom cursor shape to use. /// public ICursor? CustomCursorShape { get => _customCursor; set { _customCursor = value; _cursorShape = value == null ? CursorShape.Arrow : CursorShape.Custom; UserInterfaceManagerInternal.CursorChanged(this); } } } }