// Variables to not even show in the list. // step_* and bound_* are here because they literally break the game and do nothing else. // parent_type is here because it's pointless to show in VV. /var/list/view_variables_hide_vars = list("bound_x", "bound_y", "bound_height", "bound_width", "bounds", "parent_type", "step_x", "step_y", "step_size") // Variables not to expand the lists of. Vars is pointless to expand, and overlays/underlays cannot be expanded. /var/list/view_variables_dont_expand = list("overlays", "underlays", "vars", "screen", "our_overlays", "priority_overlays", "queued_overlays") // Acceptable 'in world', as VV would be incredibly hampered otherwise /client/proc/debug_variables(datum/D in world) set category = "Debug" set name = "View Variables" debug_variables_open(D) /client/proc/debug_variables_open(datum/thing, search = "") if(!check_rights(0)) return if(!thing) return var/static/list/blacklist = list(/datum/configuration) if(is_type_in_list(thing,blacklist)) return 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 var/icon/sprite if(istype(thing, /atom)) var/atom/A = thing if(A.icon && A.icon_state) sprite = icon(A.icon, A.icon_state) send_rsc(usr, sprite, "view_vars_sprite.png") send_rsc(usr, 'code/js/view_variables.js', "view_variables.js") var/list/header = islist ? list("/list") : thing.vv_get_header() var/list/dropdownoptions = thing.vv_get_dropdown() var/html = {" [thing] ([REF(thing)] - [thing.type])
[sprite ? "" : ""]
[header.Join()]
[replacetext("[get_debug_type(thing)]", "/", "/")] [holder.marked_datum == thing ? "
Marked Object" : ""]
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:

    [make_view_variables_var_list(thing)]
"} usr << browse(html, "window=variables[REF(thing)];size=520x720") /proc/make_view_variables_var_list(datum/D) . = "" var/list/variables = D.make_variable_list() variables = sortList(variables) for(var/x in variables) CHECK_TICK . += make_view_variables_var_entry(D, x, D.vars[x]) /datum/proc/make_variable_list() . = list() for(var/x in vars) CHECK_TICK if(x in view_variables_hide_vars) continue if(!can_vv_get(x)) continue . += x return . /proc/make_view_variables_value(datum/D, value, varname = "*") var/vtext = "" var/debug_type = get_debug_type(value, FALSE) var/extra = list() if(istext(value)) debug_type = null // it's kinda annoying here; we can tell the type by the quotes vtext = "\"[html_encode(value)]\"" else if(isicon(value)) vtext = "[value]" else if(isfile(value)) vtext = "'[value]'" else if(istype(value, /datum)) var/datum/DA = value if("[DA]" == "[DA.type]" || !"[DA]") vtext = "[REF(DA)] - [DA.type]" else vtext = "[REF(DA)] - [DA] ([DA.type])" else if(istype(value, /client)) var/client/C = value vtext = "[REF(C)] - [C] ([C.type])" else if(islist(value)) var/list/L = value vtext = "/list ([length(L)])" //Let's just compute it once instead of for every element var/is_normal_list = IS_NORMAL_LIST(L) if(!(varname in view_variables_dont_expand) && length(L) > 0 && length(L) < 100) extra += "" else if(length(L) >= 100) vtext = "([length(L)]): " else vtext = "[value]" return "[debug_type] [vtext][jointext(extra, "")]" /proc/make_view_variables_var_entry(datum/D, varname, value, level=0) var/ecm = null if(D) //These are the VV_HK_BASIC_* defines ecm = {" (E) (C) (M) "} var/valuestr = make_view_variables_value(D, value, varname) return "
  • [ecm][varname] = [valuestr]
  • "