From 30ab05f2ad58bdb9c3147588e9976143f022fe23 Mon Sep 17 00:00:00 2001 From: Kocma-san <112967882+Kocma-san@users.noreply.github.com> Date: Tue, 2 Jul 2024 00:17:38 +0700 Subject: [PATCH] adds swapping pens in PDAs (#84437) ## About The Pull Request Added the ability to swap items in PDAs
Videos https://github.com/tgstation/tgstation/assets/112967882/b3c63d7b-7913-42a6-83e7-d2989cdac8b2
## Why It's Good For The Game You can quickly change items stored in the PDA slots without doing unnecessary actions (pulling the pen out of the PDA, removing it, and inserting another pen) ## Changelog :cl: qol: you can now swap pens in pdas /:cl: --------- Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com> --- .../modular_computers/computers/item/pda.dm | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/code/modules/modular_computers/computers/item/pda.dm b/code/modules/modular_computers/computers/item/pda.dm index 2fb7863445d..f1fced454e4 100644 --- a/code/modules/modular_computers/computers/item/pda.dm +++ b/code/modules/modular_computers/computers/item/pda.dm @@ -149,14 +149,14 @@ if(tool.w_class >= WEIGHT_CLASS_SMALL) // Anything equal to or larger than small won't work user.balloon_alert(user, "too big!") return ITEM_INTERACT_BLOCKING - if(inserted_item) - balloon_alert(user, "no room!") - return ITEM_INTERACT_BLOCKING if(!user.transferItemToLoc(tool, src)) return ITEM_INTERACT_BLOCKING - balloon_alert(user, "inserted [tool]") - inserted_item = tool - playsound(src, 'sound/machines/pda_button1.ogg', 50, TRUE) + if(inserted_item) + swap_pen(user, tool) + else + balloon_alert(user, "inserted [tool]") + inserted_item = tool + playsound(src, 'sound/machines/pda_button1.ogg', 50, TRUE) return ITEM_INTERACT_SUCCESS @@ -185,6 +185,14 @@ update_appearance() playsound(src, 'sound/machines/pda_button2.ogg', 50, TRUE) +/obj/item/modular_computer/pda/proc/swap_pen(mob/user, obj/item/tool) + if(inserted_item) + balloon_alert(user, "swapped pens") + user.put_in_hands(inserted_item) + inserted_item = tool + update_appearance() + playsound(src, 'sound/machines/pda_button1.ogg', 50, TRUE) + /obj/item/modular_computer/pda/proc/explode(mob/target, mob/bomber, from_message_menu = FALSE) var/turf/current_turf = get_turf(src)