Skip to content

Conversation

amylizzle
Copy link
Collaborator

@amylizzle amylizzle commented Sep 22, 2025

Implements:

  • /atom/mouse_drag_pointer
  • /atom/mouse_drop_pointer
  • /atom/mouse_drop_zone
  • /atom/mouse_over_pointer
  • /client/mouse_pointer_icon

Requires space-wizards/RobustToolbox#6226

@boring-cyborg boring-cyborg bot added Client Involves the OpenDream client Compiler Involves the OpenDream compiler Runtime Involves the OpenDream server/runtime labels Sep 22, 2025
[Dependency] private readonly ClientAppearanceSystem _appearanceSystem = default!;
[Dependency] private readonly IClyde _clyde = default!;

public bool IsDragging { get => _selectedEntity?.IsDrag ?? false; }

Check notice

Code scanning / InspectCode

Use preferred body style: Convert into property, indexer, or event with preferred body style Note

Code body does not conform to code style settings: use expression-bodied property
} else
_mouseInput?.SetCursorFromDefine(0, 0);

}

Check warning

Code scanning / InspectCode

Incorrect blank lines: Incorrect number of blank lines near braces Warning

Incorrect number of blank lines near braces, expected maximum 0 instead of 1
_mouseInput?.HandleAtomMouseMove(Viewport, relativePos, atom.Value, iconPos);
}
_mouseInput?.HandleAtomMouseMove(Viewport, relativePos, atom.Value, iconPos);
}

Check notice

Code scanning / InspectCode

Incorrect indent: Around statement braces Note

Line indent is not restored to the previous level around statement braces
using SixLabors.ImageSharp;
using System.Linq;
using Robust.Shared.Map;
using SixLabors.ImageSharp.PixelFormats;

Check warning

Code scanning / InspectCode

Redundant using directive Warning

Using directive is not required by the code and can be safely removed
using System.Linq;
using Robust.Shared.Map;
using SixLabors.ImageSharp.PixelFormats;
using OpenToolkit.GraphicsLibraryFramework;

Check warning

Code scanning / InspectCode

Redundant using directive Warning

Using directive is not required by the code and can be safely removed
public readonly ClientVerbsList ClientVerbs;
public ViewRange View { get; private set; }
public bool ShowPopupMenus { get; private set; } = true;
public IconResource? CursorIcon = null;

Check warning

Code scanning / InspectCode

Redundant member initializer Warning

Initializing field by default value is redundant
break;
case "mouse_pointer_icon":
//resolve the value to an icon file
if (value.TryGetValueAsDreamResource(out var iconResource) && iconResource is IconResource)

Check notice

Code scanning / InspectCode

Type check and casts can be merged Note

Merge cast with type check
buffer.Write((byte)IconAppearanceProperty.MouseDragPointer);
buffer.WriteVariableInt32(MouseDragPointer);
}
if (MouseDropZone) {

Check warning

Code scanning / InspectCode

Incorrect blank lines: Blank lines are missing elsewhere Warning

Blank lines are missing, expected minimum 1 instead of 0
if (MouseDropZone) {
buffer.Write((byte)IconAppearanceProperty.MouseDropZone);
}
if (MouseOverPointer != MutableAppearance.Default.MouseOverPointer) {

Check warning

Code scanning / InspectCode

Incorrect blank lines: Blank lines are missing elsewhere Warning

Blank lines are missing, expected minimum 1 instead of 0
buffer.Write((byte)IconAppearanceProperty.MouseOverPointer);
buffer.WriteVariableInt32(MouseOverPointer);
}
if (MouseDropPointer != MutableAppearance.Default.MouseDropPointer) {

Check warning

Code scanning / InspectCode

Incorrect blank lines: Blank lines are missing elsewhere Warning

Blank lines are missing, expected minimum 1 instead of 0
_clyde.SetCursor(_dreamInterfaceManager.Cursors.BaseCursor);
return;
}
switch (define) {

Check warning

Code scanning / InspectCode

Incorrect blank lines: Blank lines are missing elsewhere Warning

Blank lines are missing, expected minimum 1 instead of 0
_dreamResource.LoadResourceAsync<DMIResource>(msg.CursorResource, resource => {
var allState = resource.GetStateAsImage("all", AtomDirection.South);
if (allState is not null) { //all overrides all possible states
Cursors.BaseCursor = _clyde.CreateCursor(allState!, new(32, 32));

Check warning

Code scanning / InspectCode

Redundant nullable warning suppression expression Warning

The nullable warning suppression expression is redundant
public ICursor? DragCursor;
public ICursor? OverCursor;
public ICursor? DropCursor;
public bool AllStateSet = false;

Check warning

Code scanning / InspectCode

Redundant member initializer Warning

Initializing field by default value is redundant
public ICursor? DropCursor;
public bool AllStateSet = false;

public CursorHolder() {}

Check warning

Code scanning / InspectCode

Empty constructor Warning

Empty constructor is redundant. The compiler generates the same by default.
using OpenDreamClient.Interface.Controls;
using OpenDreamShared.Dream;
using OpenDreamShared.Network.Messages;
using Robust.Client.Graphics;

Check warning

Code scanning / InspectCode

Redundant using directive Warning

Using directive is not required by the code and can be safely removed
@amylizzle amylizzle marked this pull request as draft September 28, 2025 13:29
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Client Involves the OpenDream client Compiler Involves the OpenDream compiler Runtime Involves the OpenDream server/runtime size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant