mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 12:07:27 +01:00
Adds admin ghost click shortcuts
Also refactors extra mob info code into its own proc.
This commit is contained in:
+50
-1
@@ -270,4 +270,53 @@ proc/add_logs(mob/target, mob/user, what_done, var/object=null, var/addition=nul
|
||||
. = 0
|
||||
break
|
||||
if(progress)
|
||||
qdel(progbar)
|
||||
qdel(progbar)
|
||||
|
||||
/proc/admin_mob_info(mob/M, mob/user = usr)
|
||||
if(!ismob(M))
|
||||
to_chat(user, "This can only be used on instances of type /mob")
|
||||
return
|
||||
|
||||
var/location_description = ""
|
||||
var/special_role_description = ""
|
||||
var/health_description = ""
|
||||
var/gender_description = ""
|
||||
var/turf/T = get_turf(M)
|
||||
|
||||
//Location
|
||||
if(isturf(T))
|
||||
if(isarea(T.loc))
|
||||
location_description = "([M.loc == T ? "at coordinates " : "in [M.loc] at coordinates "] [T.x], [T.y], [T.z] in area <b>[T.loc]</b>)"
|
||||
else
|
||||
location_description = "([M.loc == T ? "at coordinates " : "in [M.loc] at coordinates "] [T.x], [T.y], [T.z])"
|
||||
|
||||
//Job + antagonist
|
||||
if(M.mind)
|
||||
special_role_description = "Role: <b>[M.mind.assigned_role]</b>; Antagonist: <font color='red'><b>[M.mind.special_role]</b></font>; Has been rev: [(M.mind.has_been_rev)?"Yes":"No"]"
|
||||
else
|
||||
special_role_description = "Role: <i>Mind datum missing</i> Antagonist: <i>Mind datum missing</i>; Has been rev: <i>Mind datum missing</i>;"
|
||||
|
||||
//Health
|
||||
if(isliving(M))
|
||||
var/mob/living/L = M
|
||||
var/status
|
||||
switch(M.stat)
|
||||
if(0) status = "Alive"
|
||||
if(1) status = "<font color='orange'><b>Unconscious</b></font>"
|
||||
if(2) status = "<font color='red'><b>Dead</b></font>"
|
||||
health_description = "Status = [status]"
|
||||
health_description += "<BR>Oxy: [L.getOxyLoss()] - Tox: [L.getToxLoss()] - Fire: [L.getFireLoss()] - Brute: [L.getBruteLoss()] - Clone: [L.getCloneLoss()] - Brain: [L.getBrainLoss()]"
|
||||
else
|
||||
health_description = "This mob type has no health to speak of."
|
||||
|
||||
//Gener
|
||||
switch(M.gender)
|
||||
if(MALE,FEMALE) gender_description = "[M.gender]"
|
||||
else gender_description = "<font color='red'><b>[M.gender]</b></font>"
|
||||
|
||||
to_chat(user, "<b>Info about [M.name]:</b> ")
|
||||
to_chat(user, "Mob type = [M.type]; Gender = [gender_description] Damage = [health_description]")
|
||||
to_chat(user, "Name = <b>[M.name]</b>; Real_name = [M.real_name]; Mind_name = [M.mind?"[M.mind.name]":""]; Key = <b>[M.key]</b>;")
|
||||
to_chat(user, "Location = [location_description];")
|
||||
to_chat(user, "[special_role_description]")
|
||||
to_chat(user, "(<a href='?src=\ref[usr];priv_msg=\ref[M]'>PM</a>) (<A HREF='?src=\ref[src];adminplayeropts=\ref[M]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[M]'>VV</A>) (<A HREF='?src=\ref[src];subtlemessage=\ref[M]'>SM</A>) (<A HREF='?src=\ref[src];adminplayerobservefollow=\ref[M]'>FLW</A>) (<A HREF='?src=\ref[src];secretsadmin=check_antagonist'>CA</A>)")
|
||||
|
||||
@@ -25,6 +25,25 @@
|
||||
return
|
||||
|
||||
var/list/modifiers = params2list(params)
|
||||
if(check_rights(R_ADMIN, 0)) // Admin click shortcuts
|
||||
var/mob/M = A
|
||||
if(!istype(M))
|
||||
M = locate() in A
|
||||
if(modifiers["shift"] && modifiers["ctrl"])
|
||||
client.debug_variables(A)
|
||||
return
|
||||
if(modifiers["ctrl"])
|
||||
if(M)
|
||||
client.holder.show_player_panel(M)
|
||||
else
|
||||
to_chat(src, "<span class='warning'>No mob was found in the atom you clicked on.</span>")
|
||||
return
|
||||
if(modifiers["shift"] && modifiers["middle"])
|
||||
if(M)
|
||||
admin_mob_info(M)
|
||||
else
|
||||
to_chat(src, "<span class='warning'>No mob was found in the atom you clicked on.</span>")
|
||||
return
|
||||
if(modifiers["shift"])
|
||||
ShiftClickOn(A)
|
||||
return
|
||||
|
||||
@@ -1565,53 +1565,7 @@
|
||||
|
||||
else if(href_list["adminmoreinfo"])
|
||||
var/mob/M = locate(href_list["adminmoreinfo"])
|
||||
if(!ismob(M))
|
||||
to_chat(usr, "This can only be used on instances of type /mob")
|
||||
return
|
||||
|
||||
var/location_description = ""
|
||||
var/special_role_description = ""
|
||||
var/health_description = ""
|
||||
var/gender_description = ""
|
||||
var/turf/T = get_turf(M)
|
||||
|
||||
//Location
|
||||
if(isturf(T))
|
||||
if(isarea(T.loc))
|
||||
location_description = "([M.loc == T ? "at coordinates " : "in [M.loc] at coordinates "] [T.x], [T.y], [T.z] in area <b>[T.loc]</b>)"
|
||||
else
|
||||
location_description = "([M.loc == T ? "at coordinates " : "in [M.loc] at coordinates "] [T.x], [T.y], [T.z])"
|
||||
|
||||
//Job + antagonist
|
||||
if(M.mind)
|
||||
special_role_description = "Role: <b>[M.mind.assigned_role]</b>; Antagonist: <font color='red'><b>[M.mind.special_role]</b></font>; Has been rev: [(M.mind.has_been_rev)?"Yes":"No"]"
|
||||
else
|
||||
special_role_description = "Role: <i>Mind datum missing</i> Antagonist: <i>Mind datum missing</i>; Has been rev: <i>Mind datum missing</i>;"
|
||||
|
||||
//Health
|
||||
if(isliving(M))
|
||||
var/mob/living/L = M
|
||||
var/status
|
||||
switch(M.stat)
|
||||
if(0) status = "Alive"
|
||||
if(1) status = "<font color='orange'><b>Unconscious</b></font>"
|
||||
if(2) status = "<font color='red'><b>Dead</b></font>"
|
||||
health_description = "Status = [status]"
|
||||
health_description += "<BR>Oxy: [L.getOxyLoss()] - Tox: [L.getToxLoss()] - Fire: [L.getFireLoss()] - Brute: [L.getBruteLoss()] - Clone: [L.getCloneLoss()] - Brain: [L.getBrainLoss()]"
|
||||
else
|
||||
health_description = "This mob type has no health to speak of."
|
||||
|
||||
//Gener
|
||||
switch(M.gender)
|
||||
if(MALE,FEMALE) gender_description = "[M.gender]"
|
||||
else gender_description = "<font color='red'><b>[M.gender]</b></font>"
|
||||
|
||||
to_chat(src.owner, "<b>Info about [M.name]:</b> ")
|
||||
to_chat(src.owner, "Mob type = [M.type]; Gender = [gender_description] Damage = [health_description]")
|
||||
to_chat(src.owner, "Name = <b>[M.name]</b>; Real_name = [M.real_name]; Mind_name = [M.mind?"[M.mind.name]":""]; Key = <b>[M.key]</b>;")
|
||||
to_chat(src.owner, "Location = [location_description];")
|
||||
to_chat(src.owner, "[special_role_description]")
|
||||
to_chat(src.owner, "(<a href='?src=\ref[usr];priv_msg=\ref[M]'>PM</a>) (<A HREF='?src=\ref[src];adminplayeropts=\ref[M]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[M]'>VV</A>) (<A HREF='?src=\ref[src];subtlemessage=\ref[M]'>SM</A>) (<A HREF='?src=\ref[src];adminplayerobservefollow=\ref[M]'>FLW</A>) (<A HREF='?src=\ref[src];secretsadmin=check_antagonist'>CA</A>)")
|
||||
admin_mob_info(M)
|
||||
|
||||
else if(href_list["adminspawncookie"])
|
||||
if(!check_rights(R_ADMIN|R_EVENT)) return
|
||||
|
||||
@@ -89,6 +89,11 @@ Admin:
|
||||
\tF7 = Player Panel
|
||||
\tF8 = Admin PM
|
||||
\tF9 = Invisimin
|
||||
|
||||
Admin ghost:
|
||||
\tCtrl+Click = Player Panel
|
||||
\tCtrl+Shift+Click = View Variables
|
||||
\tShift+Middle Click = Mob Info
|
||||
</font>"}
|
||||
|
||||
mob.hotkey_help()
|
||||
|
||||
Reference in New Issue
Block a user