Adds ghost drag-dropping into mobs.

A port of https://github.com/tgstation/-tg-station/pull/8957.
This is so slick, you have no idea.
This commit is contained in:
ComicIronic
2015-05-03 17:00:34 +01:00
parent fceffdd887
commit 09a3c3ed25
2 changed files with 44 additions and 1 deletions

View File

@@ -1353,3 +1353,36 @@ proc/formatLocation(location)
proc/formatPlayerPanel(var/mob/U,var/text="PP") proc/formatPlayerPanel(var/mob/U,var/text="PP")
return "<A HREF='?_src_=holder;adminplayeropts=\ref[U]'>[text]</A>" return "<A HREF='?_src_=holder;adminplayeropts=\ref[U]'>[text]</A>"
//Credit to MrStonedOne from TG for this QoL improvement
//returns 1 to let the dragdrop code know we are trapping this event
//returns 0 if we don't plan to trap the event
/datum/admins/proc/cmd_ghost_drag(var/mob/dead/observer/frommob, var/mob/living/tomob)
//if we couldn't do it manually, we can't do it here - the 0 means no message is displayed for failure
if (!check_rights(R_VAREDIT, 0))
return 0
if (!frommob.ckey)
return 0
var/question = ""
if (tomob.ckey)
question = "This mob already has a user ([tomob.key]) in control of it! "
question += "Are you sure you want to place [frommob.name]([frommob.key]) in control of [tomob.name]?"
if(alert(question, "Place ghost in control of mob?", "Yes", "No") != "Yes")
return 1
if (!frommob || !tomob) //make sure the mobs don't go away while we waited for a response
return 1
tomob.ghostize(0) //boot the old mob out
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has put [frommob.ckey] in control of [tomob.name].</span>")
log_admin("[key_name(usr)] stuffed [frommob.ckey] into [tomob.name].")
feedback_add_details("admin_verb","CGD")
tomob.ckey = frommob.ckey
qdel(frommob)
return 1

View File

@@ -9,4 +9,14 @@
if(locate(/obj/machinery/computer/cloning, get_step(canclone.loc, dir))) if(locate(/obj/machinery/computer/cloning, get_step(canclone.loc, dir)))
src << 'sound/effects/adminhelp.ogg' src << 'sound/effects/adminhelp.ogg'
src << "<b><font color = #330033><font size = 3>Your corpse has been placed into a cloning scanner. Return to your body if you want to be resurrected/cloned!</b> (Verbs -> Ghost -> Re-enter corpse)</font color>" src << "<b><font color = #330033><font size = 3>Your corpse has been placed into a cloning scanner. Return to your body if you want to be resurrected/cloned!</b> (Verbs -> Ghost -> Re-enter corpse)</font color>"
canclone = null canclone = null
/mob/dead/observer/MouseDrop(atom/over)
if(!usr || !over)
return
if (isobserver(usr) && usr.client.holder && isliving(over))
if (usr.client.holder.cmd_ghost_drag(src,over))
return
return ..()