From af1d15c2bc8d98af4b5cbfc843389f8310122da5 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 31 Dec 2023 21:42:52 +0100 Subject: [PATCH] [MIRROR] adds screentips to the janicart (pimpin' ride) [MDB IGNORE] (#25933) * 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 <94711066+kawoppi@users.noreply.github.com> --- code/modules/vehicles/pimpin_ride.dm | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/code/modules/vehicles/pimpin_ride.dm b/code/modules/vehicles/pimpin_ride.dm index 39b78b99f62..7ef79cb89cf 100644 --- a/code/modules/vehicles/pimpin_ride.dm +++ b/code/modules/vehicles/pimpin_ride.dm @@ -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 @@ -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