Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

You can altClick to take out DNA Disks from DNA consoles #51247

Merged
merged 3 commits into from
May 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 29 additions & 7 deletions code/game/machinery/computer/dna_console.dm
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,14 @@

return ..()


/obj/machinery/computer/scan_consolenew/AltClick(mob/user)
// Make sure the user can interact with the machine.
if(!user.canUseTopic(src, !issilicon(user)))
return

eject_disk(user)

/obj/machinery/computer/scan_consolenew/Initialize()
. = ..()

Expand Down Expand Up @@ -1048,13 +1056,7 @@

// Eject stored diskette from console
if("eject_disk")
// GUARD CHECK - This code shouldn't even be callable without a diskette
// inserted. Unexpected result
if(!diskette)
return

diskette.forceMove(drop_location())
diskette = null
eject_disk(usr)
return

// Create a Genetic Makeup injector. These injectors are timed and thus are
Expand Down Expand Up @@ -1986,6 +1988,26 @@
tgui_view_state["storageConsSubMode"] = "mutations"
tgui_view_state["storageDiskSubMode"] = "mutations"

/**
* Ejects the DNA Disk from the console.
*
* Will insert into the user's hand if possible, otherwise will drop it at the
* console's location.
*
* Arguments:
* * user - The mob that is attempting to eject the diskette.
*/
/obj/machinery/computer/scan_consolenew/proc/eject_disk(mob/user)
// Check for diskette.
if(!diskette)
return

to_chat(user, "<span class='notice'>You eject [diskette] from [src].</span>")

// If the disk shouldn't pop into the user's hand for any reason, drop it on the console instead.
if(!istype(user) || !Adjacent(user) || !user.put_in_active_hand(diskette))
diskette.forceMove(drop_location())
diskette = null

#undef INJECTOR_TIMEOUT
#undef NUMBER_OF_BUFFERS
Expand Down