Skip to content

Custom Ability Cursor #11869

Open
Venuska1117 wants to merge 1 commit intocmss13-devs:masterfrom
Venuska1117:custom-ability-cursor
Open

Custom Ability Cursor #11869
Venuska1117 wants to merge 1 commit intocmss13-devs:masterfrom
Venuska1117:custom-ability-cursor

Conversation

@Venuska1117
Copy link
Copy Markdown
Contributor

@Venuska1117 Venuska1117 commented Mar 4, 2026

About the pull request

This change was made for: #11168

This was made for other PR as QoL improvement, but i thought it would be better if i made separate PR for this change considering its not exclusive to PR but can be used for anything else. (added a little modularity)

Explain why it's good for the game

Allows to attach custom cursor sprite to abilities, this change is not exclusive to #11168, this change was made to include any ability and allows people (in future) to add their own custom cursors for abilities, placing anything inside set_action_cursor() for example set_action_cursor('icons/effects/mouse_pointer/custom_cursor.dmi') will automatically apply defined cursor, switching ability automatically clear cursors, but if for some reason you need to clear cursor inside ability, use clear_action_cursor()

>How custom sprites work.< This part is dedicated to people interested in how new added ability sprites works, in general i created it for designer but if someone in future will check this PR for more info, here is how to use the 3 new added lines that can be used anywhere you want with specific setup. (players can disable it with preference -> allow custom cursors)

in xenomorph.dm there are 3 new proc's:

set_action_cursor()
clear_action_cursor()
handle_view()

your interest is in 2 first proc's, 3rd one exist for purpose of "looping", mouse will dissapear after delay because of (maybe) engine fault, so looping using signals make it persist on screen for any amount of time you want it. (view override with signals)

(!) made sure that anywhere you want to add this, you have xenomorph path defined inside it example:
"var/mob/living/carbon/xenomorph/xeno = owner", if you adding it in behavior_delegate, its already defined as "bound_xeno".

set_action_cursor() is responsible for changing your mouse icon to any icon you put inside of it, for example you want ability to change cursor? then put it anywhere in code where code activates and place xeno.set_action_cursor('[custom cursor image path]') by putting image path inside proc call will automatically create and place image in your cursor place.
(if you still don't get it, check designer.dm code and see how it works)

clear_action_cursor() is responsible for cleaning (removing) cursor, best use is if you don't want cursor carrying out to other abities that are stored in same action button.

Extra info for cursor issues:
If you read this far and wonder how to make "custom cursor registers clicks where i want it", you need to do it inside Dream Maker program (the one that view and allow sprites edit), there is button called "Hot Spot" that you can call by pressing H (default) and wherever you press on that sprite, it will become your cursor "click" point.

Here is description from Dream Maker helping tool to explain how hotspot works.

Hot Spot: If this icon will be used as a mouse cursor, you can change the hot spot (where the cursor click actually registers) by choosing this tool and clicking a pixel in the icon. That pixel will become the new hot spot.

Testing Photographs and Procedure

Example of Custom Cursor used on Designer Please ignore low video quality, it makes cursor look ugly.
2026-02-10.23-29-40.mp4

Changelog

🆑 Venuska1117
add: Abilities now can have custom .dmi sprites as their cursors, custom cursors can be enabled in preferences > allow custom cursors > Enable/Disable Ability Cursor.
/:cl:

@github-project-automation github-project-automation Bot moved this to Awaiting Review in Review Backlog Mar 4, 2026
@cmss13-ci cmss13-ci Bot added the Feature Feature coder badge label Mar 4, 2026
@Venuska1117 Venuska1117 changed the title Custom Abilities Cursor Custom Ability Cursor Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Feature coder badge

Projects

Status: Awaiting Review

Development

Successfully merging this pull request may close these issues.

1 participant