/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, span_danger("You need to be an administrator to access this."), confidential = TRUE) return if(!D) return var/datum/asset/asset_cache_datum = get_asset_datum(/datum/asset/simple/vv) asset_cache_datum.send(usr) 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\]" : "" var/list/header = islist(D)? list("/list") : D.vv_get_header() var/marked_line if(holder && holder.marked_datum && holder.marked_datum == D) marked_line = VV_MSG_MARKED var/varedited_line if(!islist && (D.datum_flags & DF_VAR_EDITED)) varedited_line = VV_MSG_EDITED var/deleted_line if(!islist && D.gc_destroyed) deleted_line = VV_MSG_DELETED var/list/dropdownoptions if (islist) dropdownoptions = list( "---", "Add Item" = VV_HREF_TARGETREF_INTERNAL(refid, VV_HK_LIST_ADD), "Remove Nulls" = VV_HREF_TARGETREF_INTERNAL(refid, VV_HK_LIST_ERASE_NULLS), "Remove Dupes" = VV_HREF_TARGETREF_INTERNAL(refid, VV_HK_LIST_ERASE_DUPES), "Set len" = VV_HREF_TARGETREF_INTERNAL(refid, VV_HK_LIST_SET_LENGTH), "Shuffle" = VV_HREF_TARGETREF_INTERNAL(refid, VV_HK_LIST_SHUFFLE), "Show VV To Player" = VV_HREF_TARGETREF_INTERNAL(refid, VV_HK_EXPOSE), "---" ) for(var/i in 1 to length(dropdownoptions)) var/name = dropdownoptions[i] var/link = dropdownoptions[name] dropdownoptions[i] = "" else dropdownoptions = D.vv_get_dropdown() var/list/names = list() if(!islist) for(var/V in D.vars) names += V sleep(1) var/list/variable_html = list() if(islist) var/list/L = D for(var/i in 1 to L.len) var/key = L[i] var/value if(IS_NORMAL_LIST(L) && IS_VALID_ASSOC_KEY(key)) value = L[key] variable_html += debug_variable(i, value, 0, L) else names = sortList(names) for(var/V in names) if(D.can_vv_get(V)) variable_html += D.vv_get_var(V) var/html = {" [title]
[sprite_text]
[header.Join()]
[formatted_type] [marked_line] [varedited_line] [deleted_line]
Refresh

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.

Search:

    [variable_html.Join()]
"} src << browse(html, "window=variables[refid];size=475x650") /client/proc/vv_update_display(datum/D, span, content) src << output("[span]:[content]", "variables[REF(D)].browser:replace_span")