/client/proc/debug_variables(datum/D in world)
set category = "Debug"
set name = "View Variables"
//set src in world
var/static/cookieoffset = rand(1, 9999) //to force cookies to reset after the round.
if(!usr.client || !usr.client.holder) //This is usr because admins can call the proc on other clients, even if they're not admins, to show them VVs.
to_chat(usr, "You need to be an administrator to access this.", confidential = TRUE)
return
if(!D)
return
var/islist = islist(D)
if(!islist && !istype(D))
return
var/title = ""
var/refid = REF(D)
var/icon/sprite
var/hash
var/type = islist? /list : D.type
var/no_icon = FALSE
if(istype(D, /atom))
sprite = getFlatIcon(D)
if(sprite)
hash = md5(sprite)
src << browse_rsc(sprite, "vv[hash].png")
else
no_icon = TRUE
title = "[D] ([REF(D)]) = [type]"
var/formatted_type = replacetext("[type]", "/", "/")
var/sprite_text
if(sprite)
sprite_text = no_icon? "\[NO ICON\]" : "
E - Edit, tries to determine the variable type by itself. C - Change, asks you for the var type first. M - Mass modify: changes this variable for all objects of this type.