/client/proc/debug_variables(datum/thing 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, span_danger("You need to be an administrator to access this."), confidential = TRUE)
return
if(!thing)
return
var/datum/asset/asset_cache_datum = get_asset_datum(/datum/asset/simple/vv)
asset_cache_datum.send(usr)
var/islist = islist(thing) || (!isdatum(thing) && hascall(thing, "Cut")) // Some special lists dont count as lists, but can be detected by if they have list procs
if(!islist && !isdatum(thing))
return
var/title = ""
var/refid = REF(thing)
var/icon/sprite
var/hash
var/type = islist? /list : thing.type
var/no_icon = FALSE
if(isatom(thing))
sprite = getFlatIcon(thing)
if(!sprite)
no_icon = TRUE
else if(isimage(thing))
var/image/image_object = thing
sprite = icon(image_object.icon, image_object.icon_state)
var/sprite_text
if(sprite)
hash = md5(sprite)
src << browse_rsc(sprite, "vv[hash].png")
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.