client proc/debug_variables(datum/D in world) set category = "Debug" set name = "View Variables" //set src in world var/title = "" var/body = "" 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 title = "[D] (\ref[D]) = [D.type]" 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) body += "
" var/html = "" if (title) html += "[title]" html += {""} html += "" html += body html += "" usr << browse(html, "window=variables\ref[D]") return proc/debug_variable(name, value, level) var/html = "" 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 += "
      " for (var/entry in L) html += debug_variable(entry, L[entry], level + 1) html += "
    " else html += "" else html += "[name] = [value]" html += "
  • " return html Topic(href, href_list, hsrc) if (href_list["Vars"]) debug_variables(locate(href_list["Vars"])) else ..() /mob/proc/Delete(atom/A in view()) set category = "Debug" switch (alert("Are you sure you wish to delete \the [A.name] at ([A.x],[A.y],[A.z]) ?", "Admin Delete Object","Yes","No")) if("Yes") log_admin("[usr.key] deleted [A.name] at ([A.x],[A.y],[A.z])")