Skip to content

Commit

Permalink
[MIRROR] Add UI screentips to spraycans [MDB IGNORE] (#25869)
Browse files Browse the repository at this point in the history
* Add UI screentips to spraycans (#80564)

## About The Pull Request

This adds screentips to spraycans for:

- AltClick - toggle cap
- RMB - copy
- LMB - paint

## Why It's Good For The Game

Better UI/UX.

## Changelog

:cl:
qol: Add UI screentips to spraycans
/:cl:

---------

Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>

* Add UI screentips to spraycans

---------

Co-authored-by: Tim <[email protected]>
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
  • Loading branch information
3 people authored and FFMirrorBot committed Dec 27, 2023
1 parent 4d01112 commit 1b26cc6
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions code/game/objects/items/crayons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,30 @@
/datum/component/slapcrafting,\
slapcraft_recipes = slapcraft_recipe_list,\
)
register_context()
register_item_context()

/obj/item/toy/crayon/spraycan/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
. = ..()

if(!user.can_perform_action(src, NEED_DEXTERITY|NEED_HANDS))
return .

if(has_cap)
context[SCREENTIP_CONTEXT_ALT_LMB] = "Toggle cap"

return CONTEXTUAL_SCREENTIP_SET

/obj/item/toy/crayon/spraycan/add_item_context(datum/source, list/context, atom/target, mob/living/user)
. = ..()

if(!user.can_perform_action(src, NEED_DEXTERITY|NEED_HANDS))
return .

context[SCREENTIP_CONTEXT_LMB] = "Paint"
context[SCREENTIP_CONTEXT_RMB] = "Copy color"

return CONTEXTUAL_SCREENTIP_SET

/obj/item/toy/crayon/spraycan/isValidSurface(surface)
return (isfloorturf(surface) || iswallturf(surface))
Expand Down

0 comments on commit 1b26cc6

Please sign in to comment.