[MIRROR] adds swapping pens in PDAs (#28544)

* adds swapping pens in PDAs (#84437)

## About The Pull Request

Added the ability to swap items in PDAs

<details>
<summary>Videos</summary>

https://github.com/tgstation/tgstation/assets/112967882/b3c63d7b-7913-42a6-83e7-d2989cdac8b2

</details>

## 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
🆑
qol: you can now swap pens in pdas
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@ users.noreply.github.com>

* adds swapping pens in PDAs

---------

Co-authored-by: Kocma-san <112967882+Kocma-san@users.noreply.github.com>
Co-authored-by: Ghom <42542238+Ghommie@ users.noreply.github.com>
This commit is contained in:
SkyratBot
2024-07-02 15:27:06 +05:30
committed by GitHub
co-authored by Ghom Kocma-san
parent 9d19cba971
commit 9d9a6c2078
@@ -153,14 +153,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
@@ -189,6 +189,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)