Custom Ability Cursor #11869
Open
Venuska1117 wants to merge 1 commit intocmss13-devs:masterfrom
Open
Conversation
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
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: