Skip to content

Commit

Permalink
adds screentips to the janicart (pimpin' ride) (#223)
Browse files Browse the repository at this point in the history
* adds screentips to the janicart (pimpin' ride) (#80665)

## About The Pull Request
Adds screentips the janicart (pimpin' ride) for dismounting, adding and
removing trash bags/upgrades/keys and inserting into the connected trash
bag.

The dismounting and key insertion/removal screentips could maybe be used
in the base vehicle. But right now I can't figure out how to move those
there without needing to do the same checks on the janicart (pimpin'
ride) again.
## Why It's Good For The Game
The janicart (pimpin' ride) has a lot of things you can do with it that
are not immediately obvious. It took me a while to figure out that you
can grab the trash bag from it without having to get off of it first.
## Changelog
:cl:
qol: added screentips to the janicart (pimpin' ride)
/:cl:

* adds screentips to the janicart (pimpin' ride)

---------

Co-authored-by: kawoppi <[email protected]>
Co-authored-by: NovaBot <[email protected]>
  • Loading branch information
3 people authored and Iajret committed Jan 3, 2024
1 parent 4772aba commit f4ac12b
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions code/modules/vehicles/pimpin_ride.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

/obj/vehicle/ridden/janicart/Initialize(mapload)
. = ..()
register_context()
update_appearance()
AddElement(/datum/element/ridable, /datum/component/riding/vehicle/janicart)
GLOB.janitor_devices += src
Expand Down Expand Up @@ -85,6 +86,44 @@
if (!.)
try_remove_bag(user)

/obj/vehicle/ridden/janicart/add_context(atom/source, list/context, obj/item/held_item, mob/user)
. = ..()

if(!held_item)
if(occupant_amount() > 0)
context[SCREENTIP_CONTEXT_LMB] = "Dismount"
context[SCREENTIP_CONTEXT_RMB] = "Dismount"
if(trash_bag)
context[SCREENTIP_CONTEXT_RMB] = "Remove trash bag"
if(is_key(inserted_key) && occupants.Find(user))
context[SCREENTIP_CONTEXT_ALT_LMB] = "Remove key"
return CONTEXTUAL_SCREENTIP_SET
else if(trash_bag)
context[SCREENTIP_CONTEXT_LMB] = "Remove trash bag"
context[SCREENTIP_CONTEXT_RMB] = "Remove trash bag"
return CONTEXTUAL_SCREENTIP_SET

if(istype(held_item, /obj/item/storage/bag/trash) && !trash_bag)
context[SCREENTIP_CONTEXT_LMB] = "Add trash bag"
context[SCREENTIP_CONTEXT_RMB] = "Add trash bag"
return CONTEXTUAL_SCREENTIP_SET

if(istype(held_item, /obj/item/janicart_upgrade) && !installed_upgrade)
context[SCREENTIP_CONTEXT_LMB] = "Install upgrade"
return CONTEXTUAL_SCREENTIP_SET

if(istype(held_item, /obj/item/screwdriver) && installed_upgrade)
context[SCREENTIP_CONTEXT_LMB] = "Remove upgrade"
return CONTEXTUAL_SCREENTIP_SET

if(is_key(held_item) && !is_key(inserted_key))
context[SCREENTIP_CONTEXT_LMB] = "Insert key"
context[SCREENTIP_CONTEXT_RMB] = "Insert key"
return CONTEXTUAL_SCREENTIP_SET
else if (trash_bag)
context[SCREENTIP_CONTEXT_LMB] = "Insert into trash bag"
context[SCREENTIP_CONTEXT_RMB] = "Insert into trash bag"
return CONTEXTUAL_SCREENTIP_SET

/**
* Called if the attached bag is being qdeleted, ensures appearance is maintained properly
Expand Down

0 comments on commit f4ac12b

Please sign in to comment.