ID:173711
 
I am having a problem with my edit verb for Game Moderators.

here is the code

Edit(atom/O in world)
set desc = "(object) Modify/examine the variables of any object"
set category = "zAdmin"
var/html = "<html><body bgcolor=gray text=#CCCCCC link=white vlink=white alink=white>"
var/variables[0]

html += "<h3 align=center>[O.name] ([O.type])</h3>"

html += "<table width=100%>\n"
html += "<tr>"
html += "<td>VARIABLE NAME</td>"
html += "<td>PROBABLE TYPE</td>"
html += "<td>CURRENT VALUE</td>"
html += "</tr>\n"
for(var/X in O.vars) variables += X

//Protect the key var for mobs, since that's a pretty important var! We don't
//want GMs editing players' keys and disconnecting them from their character,
//after all.
variables -= "key"

//Protect the top-secret _temp_gm var! This is used internally only.
variables -= "_temp_gm"
//Prevent this one, too. GMs should use the GM_movement verb so they are aware.
variables -= "_GM_lockmove"

//Also protect these lists because you should never edit lists directly.
//(And, because s_admin isn't capable of editing lists, and never will be.)
variables -= "contents"
variables -= "overlays"
variables -= "underlays"
variables -= "verbs"
variables -= "vars"
variables -= "group"
variables -= "gmrank"

for(var/X in variables)
html += "<tr>"
html += "<td><a href=byond://?src=\ref[O];action=edit;var=[X]>"
html += X
html += "</a>"
if(!issaved(variables[X]) || istype(X,/list))
html += " <font color=red>(*)</font></td>"
else html += "</td>"

html += "<td>[DetermineVarType(O.vars[X])]</td>"
html += "<td>[DetermineVarValue(O.vars[X])]</td>"
html += "</tr>"
html += "</table>"

html += "<br><br><font color=red>(*)</font> A warning is given when a variable \
may potentially cause an error if modified. If you ignore that warning and \
continue to modify the variable, you alone are responsible for whatever \
mayhem results!</body></html>"

usr << browse(html)


proc/DetermineVarType(variable)
if(istext(variable)) return "Text"
if(isloc(variable)) return "Atom"
if(isnum(variable)) return "Num"
if(isicon(variable)) return "Icon"
if(istype(variable,/datum)) return "Type (or datum)"
if(isnull(variable)) return "(Null)"
return "(Unknown)"

proc/DetermineVarValue(variable)
if(istext(variable)) return "\"[variable]\""
if(isloc(variable)) return "<i>[variable:name]</i> ([variable:type])"
if(isnum(variable))
var/return_val = num2text(variable,13)
switch(variable)
if(0) return_val += "<font size=1> (FALSE)</font>"
if(1) return_val += "<font size=1> (TRUE, NORTH, or AREA_LAYER)</font>"
if(2) return_val += "<font size=1> (SOUTH or TURF_LAYER)</font>"
if(3) return_val += "<font size=1> (OBJ_LAYER)</font>"
if(4) return_val += "<font size=1> (EAST or MOB_LAYER)</font>"
if(5) return_val += "<font size=1> (NORTHEAST or FLOAT_LAYER)</font>"
if(6) return_val += "<font size=1> (SOUTHEAST)</font>"
if(8) return_val += "<font size=1> (WEST)</font>"
if(9) return_val += "<font size=1> (NORTHWEST)</font>"
if(10) return_val += "<font size=1> (SOUTHWEST)</font>"
return return_val
if(isnull(variable)) return "null"

return "- [variable] -"


When you click this verb it brings up a box you can pick the atom and then once you pick that it pops up the browser with a list of all that users vars. You should be able to click on them and edit them. But nothing happens. I have no clue why.

Thanks in advance
TK6000
Try re-downloading S_Admin. You might've accidently messed something up with the client/Topic() stuff he has.