// reference: /client/proc/modify_variables(var/atom/O, var/param_var_name = null, var/autodetect_class = 0) client proc/debug_variables(datum/D in world) set category = "Debug" set name = "View Variables" //set src in world var/title = "" var/body = "" if(!D) return if(istype(D, /atom)) var/atom/A = D title = "[A.name] (\ref[A]) = [A.type]" #ifdef VARSICON if (A.icon) body += debug_variable("icon", new/icon(A.icon, A.icon_state, A.dir), 0) #endif var/icon/sprite if(istype(D,/atom)) var/atom/AT = D if(AT.icon && AT.icon_state) sprite = new /icon(AT.icon, AT.icon_state) usr << browse_rsc(sprite, "view_vars_sprite.png") title = "[D] (\ref[D]) = [D.type]" body += {" "} body += "" body += "
" if(sprite) body += "" body += "
" else body += "
" body += "
" if(istype(D,/atom)) var/atom/A = D if(ismob(A)) body += "[D]" if(A.dir) body += "
<< [dir2text(A.dir)] >>" var/mob/M = A body += "
[M.ckey ? M.ckey : "No ckey"] / [M.real_name ? M.real_name : "No real name"]" body += {"
BRUTE:[M.getBruteLoss()] FIRE:[M.getFireLoss()] TOXIN:[M.getToxLoss()] OXY:[M.getOxyLoss()] CLONE:[M.getCloneLoss()] BRAIN:[M.getBrainLoss()] "} else body += "[D]" if(A.dir) body += "
<< [dir2text(A.dir)] >>" else body += "[D]" body += "
" body += "
" var/formatted_type = text("[D.type]") if(length(formatted_type) > 25) var/middle_point = length(formatted_type) / 2 var/splitpoint = findtext(formatted_type,"/",middle_point) if(splitpoint) formatted_type = "[copytext(formatted_type,1,splitpoint)]
[copytext(formatted_type,splitpoint)]" else formatted_type = "Type too long" //No suitable splitpoint (/) found. body += "
[formatted_type]" if(src.holder && src.holder.marked_datum && src.holder.marked_datum == D) body += "
Marked Object" body += "
" body += "
Refresh" //if(ismob(D)) // body += "
Show player panel

" body += {"
" body += "

" body += "E - Edit, tries to determine the variable type by itself.
" body += "C - Change, asks you for the var type first.
" body += "M - Mass modify: changes this variable for all objects of this type.

" body += "
Search:

" body += "
    " var/list/names = list() for (var/V in D.vars) names += V names = sortList(names) for (var/V in names) body += debug_variable(V, D.vars[V], 0, D) body += "
" var/html = "" if (title) html += "[title]" html += {""} html += "" html += body html += {" "} html += "" usr << browse(html, "window=variables\ref[D];size=475x650") return proc/debug_variable(name, value, level, var/datum/DA = null) var/html = "" if(DA) html += "
  • (E) (C) (M) " else html += "
  • " if (isnull(value)) html += "[name] = null" else if (istext(value)) html += "[name] = \"[value]\"" else if (isicon(value)) #ifdef VARSICON var/icon/I = new/icon(value) var/rnd = rand(1,10000) var/rname = "tmp\ref[I][rnd].png" usr << browse_rsc(I, rname) html += "[name] = ([value]) " #else html += "[name] = /icon ([value])" #endif /* else if (istype(value, /image)) #ifdef VARSICON var/rnd = rand(1, 10000) var/image/I = value src << browse_rsc(I.icon, "tmp\ref[value][rnd].png") html += "[name] = " #else html += "[name] = /image ([value])" #endif */ else if (isfile(value)) html += "[name] = '[value]'" else if (istype(value, /datum)) var/datum/D = value html += "[name] \ref[value] = [D.type]" else if (istype(value, /client)) var/client/C = value html += "[name] \ref[value] = [C] [C.type]" // else if (istype(value, /list)) var/list/L = value html += "[name] = /list ([L.len])" if (L.len > 0 && !(name == "underlays" || name == "overlays" || name == "vars" || L.len > 500)) // not sure if this is completely right... if(0) //(L.vars.len > 0) html += "
      " html += "
    " else html += "" else html += "[name] = [value]" html += "
  • " return html //All BYOND links pass through client/Topic() FIRST and are then directed to [hsrc]/Topic() by the ..() call at the end. client/Topic(href, href_list, hsrc) //search the href for script injection //This is a temporary measure if( findtext(href,"