Adds "Move" command to atom/movable's VV dropdown that lets you jump it to a coordinate.

This commit is contained in:
Leshana
2020-04-22 11:43:18 -04:00
parent a94ef33d1c
commit 323f20cfec
2 changed files with 42 additions and 1 deletions
+11
View File
@@ -48,6 +48,17 @@
pulledby = null
QDEL_NULL(riding_datum) //VOREStation Add
/atom/movable/vv_get_dropdown()
. = ..()
VV_DROPDOWN_OPTION("move_atom", "Move To Coordinate")
/atom/vv_do_topic(list/href_list)
. = ..()
IF_VV_OPTION("move_atom")
usr.client.cmd_admin_move_atom(src)
href_list["datumrefresh"] = "\ref[src]"
/atom/movable/vv_edit_var(var_name, var_value)
if(var_name in GLOB.VVpixelmovement) //Pixel movement is not yet implemented, changing this will break everything irreversibly.
return FALSE
+31 -1
View File
@@ -169,4 +169,34 @@
message_admins(msg)
admin_ticket_log(M, msg)
else
alert("Admin jumping disabled")
alert("Admin jumping disabled")
/client/proc/cmd_admin_move_atom(var/atom/movable/AM, tx as num, ty as num, tz as num)
set category = "Admin"
set name = "Move Atom to Coordinate"
if(!check_rights(R_ADMIN|R_DEBUG|R_EVENT))
return
if(config.allow_admin_jump)
if(isnull(tx))
tx = input("Select X coordinate", "Move Atom", null, null) as null|num
if(!tx) return
if(isnull(ty))
ty = input("Select Y coordinate", "Move Atom", null, null) as null|num
if(!ty) return
if(isnull(tz))
tz = input("Select Z coordinate", "Move Atom", null, null) as null|num
if(!tz) return
var/turf/T = locate(tx, ty, tz)
if(!T)
to_chat(usr, "<span class='warning'>Those coordinates are outside the boundaries of the map.</span>")
return
if(ismob(AM))
var/mob/M = AM
M.on_mob_jump()
AM.forceMove(T)
feedback_add_details("admin_verb", "MA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
message_admins("[key_name_admin(usr)] jumped [AM] to coordinates [tx], [ty], [tz]")
else
alert("Admin jumping disabled")