diff --git a/code/__DEFINES/typeids.dm b/code/__DEFINES/typeids.dm
new file mode 100644
index 00000000000..ae5df258b4f
--- /dev/null
+++ b/code/__DEFINES/typeids.dm
@@ -0,0 +1,8 @@
+//Byond type ids
+#define TYPEID_NULL "0"
+#define TYPEID_NORMAL_LIST "f"
+//helper macros
+#define GET_TYPEID(ref) ( ( (lentext(ref) <= 10) ? "TYPEID_NULL" : copytext(ref, 4, lentext(ref)-6) ) )
+#define IS_NORMAL_LIST(L) (GET_TYPEID("\ref[L]") == TYPEID_NORMAL_LIST)
+
+
diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm
index 13e34807609..25cdc5a1569 100644
--- a/code/__HELPERS/unsorted.dm
+++ b/code/__HELPERS/unsorted.dm
@@ -1263,9 +1263,13 @@ B --><-- A
return closest_atom
-proc/pick_closest_path(value)
- var/list/matches = get_fancy_list_of_atom_types()
- if (!isnull(value) && value!="")
+proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types())
+ if (value == FALSE) //nothing should be calling us with a number, so this is safe
+ value = input("Enter type to find (blank for all, cancel to cancel)", "Search for type") as null|text
+ if (isnull(value))
+ return
+ value = trim(value)
+ if(!isnull(value) && value != "")
matches = filter_fancy_list(matches, value)
if(matches.len==0)
@@ -1275,7 +1279,7 @@ proc/pick_closest_path(value)
if(matches.len==1)
chosen = matches[1]
else
- chosen = input("Select an atom type", "Spawn Atom", matches[1]) as null|anything in matches
+ chosen = input("Select a type", "Pick Type", matches[1]) as null|anything in matches
if(!chosen)
return
chosen = matches[chosen]
diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm
index 4a39419d4f2..3d62b69738f 100644
--- a/code/datums/datumvars.dm
+++ b/code/datums/datumvars.dm
@@ -1,6 +1,3 @@
-
-var/global/list/internal_byond_list_vars = list("contents" = TRUE, "verbs" = TRUE, "screen" = TRUE, "images" = TRUE)
-
/datum
var/var_edited = FALSE //Warrenty void if seal is broken
var/datum/reagents/reagents = null
@@ -10,6 +7,8 @@ var/global/list/internal_byond_list_vars = list("contents" = TRUE, "verbs" = TRU
switch(var_name)
if ("vars")
return FALSE
+ if ("var_edited")
+ return FALSE
var_edited = TRUE
vars[var_name] = var_value
@@ -36,6 +35,8 @@ var/global/list/internal_byond_list_vars = list("contents" = TRUE, "verbs" = TRU
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)
usr << "You need to be an administrator to access this."
return
@@ -43,20 +44,27 @@ var/global/list/internal_byond_list_vars = list("contents" = TRUE, "verbs" = TRU
if(!D)
return
- var/islist = FALSE
- if (istype(D, /list))
- islist = TRUE
+ var/islist = islist(D)
+ if (!islist && !istype(D))
+ return
+
var/title = ""
var/refid = "\ref[D]"
var/icon/sprite
+ var/type = /list
+ if (!islist)
+ type = D.type
+
+
+
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]) = [(islist ? /list : D.type)]"
+ title = "[D] (\ref[D]) = [type]"
var/sprite_text
if(sprite)
@@ -89,7 +97,7 @@ var/global/list/internal_byond_list_vars = list("contents" = TRUE, "verbs" = TRU
else
atomsnowflake += "[D]"
- var/formatted_type = text("[(islist ? /list : D.type)]")
+ var/formatted_type = "[type]"
if(length(formatted_type) > 25)
var/middle_point = length(formatted_type) / 2
var/splitpoint = findtext(formatted_type,"/",middle_point)
@@ -127,7 +135,11 @@ var/global/list/internal_byond_list_vars = list("contents" = TRUE, "verbs" = TRU
if (islist)
var/list/L = D
for (var/i in 1 to L.len)
- variable_html += debug_variable(i, L[L[i]], 0, D)
+ var/key = L[i]
+ var/value
+ if (IS_NORMAL_LIST(L) && !isnum(key))
+ value = L[key]
+ variable_html += debug_variable(i, value, 0, D)
else
names = sortList(names)
@@ -226,7 +238,7 @@ var/global/list/internal_byond_list_vars = list("contents" = TRUE, "verbs" = TRU
var vars_ol1 = document.getElementById("vars");
vars_ol1.innerHTML = complete_list
}
- document.cookie="[refid]search="+encodeURIComponent(filter);
+ document.cookie="[refid][cookieoffset]search="+encodeURIComponent(filter);
if(filter == ""){
return;
}else{
@@ -259,7 +271,7 @@ var/global/list/internal_byond_list_vars = list("contents" = TRUE, "verbs" = TRU
var filter_text = document.getElementById('filter');
filter_text.focus();
filter_text.select();
- var lastsearch = getCookie("[refid]search");
+ var lastsearch = getCookie("[refid][cookieoffset]search");
if (lastsearch) {
filter_text.value = lastsearch;
updateSearch();
@@ -361,7 +373,10 @@ var/global/list/internal_byond_list_vars = list("contents" = TRUE, "verbs" = TRU
if(DA)
if (istype(DA, /list))
var/index = name
- name = DA[name] //name is really the index until this line
+ if (value)
+ name = DA[name] //name is really the index until this line
+ else
+ value = DA[name]
html += "
(E) (C) (-) "
else
html += "(E) (C) (M) "
@@ -409,29 +424,20 @@ var/global/list/internal_byond_list_vars = list("contents" = TRUE, "verbs" = TRU
else if (istype(value, /list))
var/list/L = value
- if (internal_byond_list_vars[name])
- html += "[html_encode(name)] = /list ([L.len])"
- else
- html += "[VV_HTML_ENCODE(name)] = /list ([L.len])"
-
+ html += "[VV_HTML_ENCODE(name)] = /list ([L.len])"
if (L.len > 0 && !(name == "underlays" || name == "overlays" || L.len > 500))
- name = "[name]" //Needs to be a string or it will go out of bounds in the internal_byond_list_vars array
html += ""
- var/index = 1
- for(var/entry in L)
- var/state = "ASSOC"
- var/val = null
- if(internal_byond_list_vars[name])
- state = "INDEX"
- else
- val = L[entry]
+ for (var/i in 1 to L.len)
+ var/key = L[i]
+ var/val
+ if (IS_NORMAL_LIST(L) && !isnum(key))
+ val = L[key]
+ if (!val)
+ val = key
+ key = i
+
+ html += debug_variable(key, val, level + 1, sanitize = sanitize)
- switch(state)
- if("INDEX")
- html += debug_variable(index, L[index], level + 1, sanitize = sanitize)
- if("ASSOC")
- html += debug_variable(entry, val, level + 1, sanitize = sanitize)
- index++
html += "
"
else
@@ -584,7 +590,7 @@ var/global/list/internal_byond_list_vars = list("contents" = TRUE, "verbs" = TRU
if (!index)
return
- var/list/L = locate(href_list["listedit"])
+ var/list/L = locate(href_list["listchange"])
if (!istype(L))
usr << "This can only be used on instances of type /list"
return
@@ -596,7 +602,7 @@ var/global/list/internal_byond_list_vars = list("contents" = TRUE, "verbs" = TRU
if (!index)
return
- var/list/L = locate(href_list["listedit"])
+ var/list/L = locate(href_list["listremove"])
if (!istype(L))
usr << "This can only be used on instances of type /list"
return
diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm
index 40948e4b02b..c441887ddbd 100644
--- a/code/modules/admin/verbs/debug.dm
+++ b/code/modules/admin/verbs/debug.dm
@@ -378,34 +378,29 @@ var/list/TYPES_SHORTCUTS = list(
/mob = "M"
)
+/proc/make_types_fancy(var/list/types)
+ if (ispath(types))
+ types = list(types)
+ . = list()
+ for(var/type in types)
+ var/typename = "[type]"
+ for (var/tn in TYPES_SHORTCUTS)
+ if (copytext(typename,1, length("[tn]/")+1)=="[tn]/" /*findtextEx(typename,"[tn]/",1,2)*/ )
+ typename = TYPES_SHORTCUTS[tn]+copytext(typename,length("[tn]/"))
+ break
+ .[typename] = type
/proc/get_fancy_list_of_atom_types()
var/static/list/pre_generated_list
if (!pre_generated_list) //init
- var/list/temp = sortList(typesof(/atom))
- pre_generated_list = new(temp.len)
- for(var/type in temp)
- var/typename = "[type]"
- for (var/tn in TYPES_SHORTCUTS)
- if (copytext(typename,1, length("[tn]/")+1)=="[tn]/" /*findtextEx(typename,"[tn]/",1,2)*/ )
- typename = TYPES_SHORTCUTS[tn]+copytext(typename,length("[tn]/"))
- break
- pre_generated_list[typename] = type
+ pre_generated_list = make_types_fancy(typesof(/atom))
return pre_generated_list
/proc/get_fancy_list_of_datum_types()
var/static/list/pre_generated_list
if (!pre_generated_list) //init
- var/list/temp = sortList(typesof(/datum) - typesof(/atom))
- pre_generated_list = new(temp.len)
- for(var/type in temp)
- var/typename = "[type]"
- for (var/tn in TYPES_SHORTCUTS)
- if (copytext(typename,1, length("[tn]/")+1)=="[tn]/" /*findtextEx(typename,"[tn]/",1,2)*/ )
- typename = TYPES_SHORTCUTS[tn]+copytext(typename,length("[tn]/"))
- break
- pre_generated_list[typename] = type
+ pre_generated_list = make_types_fancy(sortList(typesof(/datum) - typesof(/atom)))
return pre_generated_list
diff --git a/code/modules/admin/verbs/massmodvar.dm b/code/modules/admin/verbs/massmodvar.dm
index 1bb380bbe29..5da63bc8d3a 100644
--- a/code/modules/admin/verbs/massmodvar.dm
+++ b/code/modules/admin/verbs/massmodvar.dm
@@ -3,22 +3,13 @@
set name = "Mass Edit Variables"
set desc="(target) Edit all instances of a target item's variables"
- var/method = 0 //0 means strict type detection while 1 means this type and all subtypes (IE: /obj/item with this set to 1 will set it to ALL itms)
+ var/method = 0 //0 means strict type detection while 1 means this type and all subtypes (IE: /obj/item with this set to 1 will set it to ALL items)
if(!check_rights(R_VAREDIT))
return
if(A && A.type)
- if(typesof(A.type))
- switch(input("Strict object type detection?") as null|anything in list("Strictly this type","This type and subtypes", "Cancel"))
- if("Strictly this type")
- method = 0
- if("This type and subtypes")
- method = 1
- if("Cancel")
- return
- if(null)
- return
+ method = vv_subtype_prompt(A.type)
src.massmodify_variables(A, var_name, method)
feedback_add_details("admin_verb","MEV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -106,8 +97,9 @@
switch(class)
if(VV_RESTORE_DEFAULT)
- src << "Finding items"
- var/list/items = get_all_of_type(O.type, !method)
+ src << "Finding items..."
+ var/list/items = get_all_of_type(O.type, method)
+ src << "Changing [items.len] items..."
for(var/thing in items)
if (!thing)
continue
@@ -119,36 +111,26 @@
CHECK_TICK
if(VV_TEXT)
- var/process_vars = 0
- var/unique = 0
- if(findtext(new_value,"\["))
- process_vars = alert(usr, "\[] detected in string, process as variables?", "Process Variables?", "Yes", "No")
- if(process_vars == "Yes")
- process_vars = 1
- unique = alert(usr, "Process vars unique to each instance, or same for all?", "Variable Association", "Unique", "Same")
- if(unique == "Unique")
- unique = 1
- else
- unique = 0
- else
- process_vars = 0
-
+ var/list/varsvars = vv_parse_text(O, new_value)
var/pre_processing = new_value
- var/list/varsvars = list()
-
- if(process_vars && !unique)
- varsvars = string2listofvars(new_value, O)
- if(varsvars.len)
+ var/unique
+ if (varsvars && varsvars.len)
+ unique = alert(usr, "Process vars unique to each instance, or same for all?", "Variable Association", "Unique", "Same")
+ if(unique == "Unique")
+ unique = TRUE
+ else
+ unique = FALSE
for(var/V in varsvars)
new_value = replacetext(new_value,"\[[V]]","[O.vars[V]]")
- src << "Finding items"
- var/list/items = get_all_of_type(O.type, !method)
+ src << "Finding items..."
+ var/list/items = get_all_of_type(O.type, method)
+ src << "Changing [items.len] items..."
for(var/thing in items)
if (!thing)
continue
var/datum/D = thing
- if(process_vars && unique)
+ if(unique)
new_value = pre_processing
for(var/V in varsvars)
new_value = replacetext(new_value,"\[[V]]","[D.vars[V]]")
@@ -169,8 +151,9 @@
many = FALSE
var/type = value["type"]
- src << "Finding items"
- var/list/items = get_all_of_type(O.type, !method)
+ src << "Finding items..."
+ var/list/items = get_all_of_type(O.type, method)
+ src << "Changing [items.len] items..."
for(var/thing in items)
if (!thing)
continue
@@ -186,8 +169,9 @@
CHECK_TICK
else
- src << "Finding items"
- var/list/items = get_all_of_type(O.type, !method)
+ src << "Finding items..."
+ var/list/items = get_all_of_type(O.type, method)
+ src << "Changing [items.len] items..."
for(var/thing in items)
if (!thing)
continue
@@ -200,25 +184,24 @@
var/count = rejected+accepted
+ if (!count)
+ src << "No objects found"
+ return
if (!accepted)
- if (!rejected)
- src << "No objects found"
- else
- src << "Every object rejected your edit"
- //return
-
+ src << "Every object rejected your edit"
+ return
if (rejected)
src << "[rejected] out of [count] objects rejected your edit"
world.log << "### MassVarEdit by [src]: [O.type] (A/R [accepted]/[rejected]) [variable]=[html_encode("[O.vars[variable]]")]([list2params(value)])"
- log_admin("[key_name(src)] mass modified [accepted] [original_name]' [variable] to [O.vars[variable]]")
- message_admins("[key_name_admin(src)] mass modified [accepted] [original_name]' [variable] to [O.vars[variable]]")
+ log_admin("[key_name(src)] mass modified [original_name]'s [variable] to [O.vars[variable]] ([accepted] objects modified)")
+ message_admins("[key_name_admin(src)] mass modified [original_name]'s [variable] to [O.vars[variable]] ([accepted] objects modified)")
-/proc/get_all_of_type(var/T, stricttype = FALSE)
+/proc/get_all_of_type(var/T, subtypes = TRUE)
var/list/typecache = list()
typecache[T] = 1
- if (!stricttype)
+ if (subtypes)
typecache = typecacheof(typecache)
. = list()
if (ispath(T, /mob))
diff --git a/code/modules/admin/verbs/modifyvariables.dm b/code/modules/admin/verbs/modifyvariables.dm
index f57d546c8d8..8f03b06a3ee 100644
--- a/code/modules/admin/verbs/modifyvariables.dm
+++ b/code/modules/admin/verbs/modifyvariables.dm
@@ -57,9 +57,7 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width
VV_MESSAGE,
VV_ICON,
VV_ATOM_REFERENCE,
- //#ifdef TESTING
- //VV_DATUM_REFERENCE,
- //#endif TESTING
+ VV_DATUM_REFERENCE,
VV_MOB_REFERENCE,
VV_CLIENT,
VV_ATOM_TYPE,
@@ -98,21 +96,27 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width
if (.["value"] == null)
.["class"] = null
return
+
+
if (VV_NUM)
.["value"] = input("Enter new number:", "Num", current_value) as null|num
if (.["value"] == null)
.["class"] = null
return
+
+
if (VV_ATOM_TYPE)
- .["value"] = input("Enter type:", "Type", current_value) as null|anything in get_fancy_list_of_atom_types()
+ .["value"] = pick_closest_path(FALSE)
if (.["value"] == null)
.["class"] = null
return
+
if (VV_DATUM_TYPE)
- .["value"] = input("Enter type:", "Type", current_value) as null|anything in get_fancy_list_of_datum_types()
+ .["value"] = pick_closest_path(FALSE, get_fancy_list_of_datum_types())
if (.["value"] == null)
.["class"] = null
return
+
if (VV_TYPE)
var/type = current_value
do
@@ -125,67 +129,171 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width
.["class"] = null
return
.["value"] = type
+
+
if (VV_ATOM_REFERENCE)
- .["value"] = input("Select reference:", "Reference", current_value) as null|mob|obj|turf|area in world
- if (.["value"] == null)
+ var/type = pick_closest_path(FALSE)
+ var/subtypes = vv_subtype_prompt(type)
+ if (subtypes == null)
.["class"] = null
return
+ var/list/things = vv_reference_list(type, subtypes)
+ var/value = input("Select reference:", "Reference", current_value) as null|anything in things
+ if (!value)
+ .["class"] = null
+ return
+ .["value"] = things[value]
+
+ if (VV_DATUM_REFERENCE)
+ var/type = pick_closest_path(FALSE, get_fancy_list_of_datum_types())
+ var/subtypes = vv_subtype_prompt(type)
+ if (subtypes == null)
+ .["class"] = null
+ return
+ var/list/things = vv_reference_list(type, subtypes)
+ var/value = input("Select reference:", "Reference", current_value) as null|anything in things
+ if (!value)
+ .["class"] = null
+ return
+ .["value"] = things[value]
+
if (VV_MOB_REFERENCE)
- .["value"] = input("Select reference:", "Reference", current_value) as null|mob in world
- if (.["value"] == null)
+ var/type = pick_closest_path(FALSE, filter_fancy_list(get_fancy_list_of_datum_types(), /mob))
+ var/subtypes = vv_subtype_prompt(type)
+ if (subtypes == null)
.["class"] = null
return
+ var/list/things = vv_reference_list(type, subtypes)
+ var/value = input("Select reference:", "Reference", current_value) as null|anything in things
+ if (!value)
+ .["class"] = null
+ return
+ .["value"] = things[value]
+
+
+
if (VV_CLIENT)
.["value"] = input("Select reference:", "Reference", current_value) as null|anything in clients
if (.["value"] == null)
.["class"] = null
return
+
+
if (VV_FILE)
.["value"] = input("Pick file:", "File") as null|file
if (.["value"] == null)
.["class"] = null
return
+
+
if (VV_ICON)
.["value"] = input("Pick icon:", "Icon") as null|icon
if (.["value"] == null)
.["class"] = null
return
+
+
if (VV_MARKED_DATUM)
.["value"] = holder.marked_datum
if (.["value"] == null)
.["class"] = null
return
+
+
if (VV_NEW_ATOM)
- var/type = input("Enter type:", "Type", current_value) as null|anything in get_fancy_list_of_atom_types()
+ var/type = pick_closest_path(FALSE)
if (!type)
.["class"] = null
return
- .["value"] = new type()
.["type"] = type
+ .["value"] = new type()
+
if (VV_NEW_DATUM)
- var/type = input("Enter type:", "Type", current_value) as null|anything in get_fancy_list_of_datum_types()
+ var/type = pick_closest_path(FALSE, get_fancy_list_of_datum_types())
if (!type)
.["class"] = null
return
- .["value"] = new type()
.["type"] = type
+ .["value"] = new type()
+
if (VV_NEW_TYPE)
var/type = current_value
+ var/error = ""
do
- type = input("Enter type:", "Type", type) as null|text
+ type = input("Enter type:[error]", "Type", type) as null|text
if (!type)
break
type = text2path(type)
+ error = "\nType not found, Please try again"
while(!type)
if (!type)
.["class"] = null
return
- .["value"] = new type()
.["type"] = type
+ .["value"] = new type()
+
+
if (VV_NEW_LIST)
.["value"] = list()
.["type"] = /list
+/client/proc/vv_parse_text(O, new_var)
+ if(O && findtext(new_var,"\["))
+ var/process_vars = alert(usr,"\[] detected in string, process as variables?","Process Variables?","Yes","No")
+ if(process_vars == "Yes")
+ . = string2listofvars(new_var, O)
+
+//do they want you to include subtypes?
+//FALSE = no subtypes, strict exact type pathing (or the type doesn't have subtypes)
+//TRUE = Yes subtypes
+//NULL = User cancelled at the prompt or invalid type given
+/client/proc/vv_subtype_prompt(var/type)
+ if (!ispath(type))
+ return
+ var/list/subtypes = subtypesof(type)
+ if (!subtypes || !subtypes.len)
+ return FALSE
+ if (subtypes && subtypes.len)
+ switch(alert("Strict object type detection?", "Type detection", "Strictly this type","This type and subtypes", "Cancel"))
+ if("Strictly this type")
+ return FALSE
+ if("This type and subtypes")
+ return TRUE
+ else
+ return
+
+/client/proc/vv_reference_list(type, subtypes)
+ . = list()
+ var/list/types = list(type)
+ if (subtypes)
+ types = typesof(type)
+
+ var/list/fancytypes = make_types_fancy(types)
+
+ for(var/fancytype in fancytypes) //swap the assoication
+ types[fancytypes[fancytype]] = fancytype
+
+ var/things = get_all_of_type(type, subtypes)
+
+ var/i = 0
+ for(var/thing in things)
+ var/datum/D = thing
+ i++
+ //try one of 3 methods to shorten the type text:
+ // fancy type,
+ // fancy type with the base type removed from the begaining,
+ // the type with the base type removed from the begaining
+ var/fancytype = types[D.type]
+ if (findtext(fancytype, types[type]))
+ fancytype = copytext(fancytype, lentext(types[type])+1)
+ var/shorttype = copytext("[D.type]", lentext("[type]")+1)
+ if (lentext(shorttype) > lentext(fancytype))
+ shorttype = fancytype
+ if (!lentext(shorttype))
+ shorttype = "/"
+
+ .["[D]([shorttype])\ref[D]#[i]"] = D
+
/client/proc/mod_list_add_ass(atom/O) //hehe
var/list/L = vv_get_value(restricted_classes = list(VV_RESTORE_DEFAULT))
@@ -195,12 +303,9 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width
var/var_value = L["value"]
if(class == VV_TEXT || class == VV_MESSAGE)
- if(findtext(var_value,"\["))
- var/process_vars = alert(usr,"\[] detected in string, process as variables?","Process Variables?","Yes","No")
- if(process_vars == "Yes")
- var/list/varsvars = string2listofvars(var_value, O)
- for(var/V in varsvars)
- var_value = replacetext(var_value,"\[[V]]","[O.vars[V]]")
+ var/list/varsvars = vv_parse_text(O, var_value)
+ for(var/V in varsvars)
+ var_value = replacetext(var_value,"\[[V]]","[O.vars[V]]")
return var_value
@@ -213,12 +318,9 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width
var/var_value = LL["value"]
if(class == VV_TEXT || class == VV_MESSAGE)
- if(O && findtext(var_value,"\["))
- var/process_vars = alert(usr,"\[] detected in string, process as variables?","Process Variables?","Yes","No")
- if(process_vars == "Yes")
- var/list/varsvars = string2listofvars(var_value, O)
- for(var/V in varsvars)
- var_value = replacetext(var_value,"\[[V]]","[O.vars[V]]")
+ var/list/varsvars = vv_parse_text(O, var_value)
+ for(var/V in varsvars)
+ var_value = replacetext(var_value,"\[[V]]","[O.vars[V]]")
var/list/newlist = L.Copy()
newlist += var_value
@@ -248,9 +350,15 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width
- var/list/names = null
+ var/list/names = list()
for (var/i in 1 to L.len)
- names["#[i] [L[i]] = [L[L[i]]]"] = i
+ var/key = L[i]
+ var/value
+ if (IS_NORMAL_LIST(L) && !isnum(key))
+ value = L[key]
+ if (value == null)
+ value = "null"
+ names["#[i] [key] = [value]"] = i
if (!index)
var/variable = input("Which var?","Var") as null|anything in names + "(ADD VAR)" + "(CLEAR NULLS)" + "(CLEAR DUPES)" + "(SHUFFLE)"
@@ -370,12 +478,9 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width
return
if(VV_TEXT)
- if(O && findtext(new_var,"\["))
- var/process_vars = alert(usr,"\[] detected in string, process as variables?","Process Variables?","Yes","No")
- if(process_vars == "Yes")
- var/list/varsvars = string2listofvars(new_var, O)
- for(var/V in varsvars)
- new_var = replacetext(new_var,"\[[V]]","[O.vars[V]]")
+ var/list/varsvars = vv_parse_text(O, new_var)
+ for(var/V in varsvars)
+ new_var = replacetext(new_var,"\[[V]]","[O.vars[V]]")
if(assoc)
@@ -475,9 +580,6 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width
var/original_name = "[O]"
- if(holder.marked_datum && class == "marked datum ([holder.marked_datum.type])")
- class = "marked datum"
-
switch(class)
if(VV_LIST)
if(!istype(var_value,/list))
@@ -490,12 +592,9 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width
var_new = initial(O.vars[variable])
if(VV_TEXT)
- if(findtext(var_new,"\["))
- var/process_vars = alert(usr,"\[] detected in string, process as variables?","Process Variables?","Yes","No")
- if(process_vars == "Yes")
- var/list/varsvars = string2listofvars(var_new, O)
- for(var/V in varsvars)
- var_new = replacetext(var_new,"\[[V]]","[O.vars[V]]")
+ var/list/varsvars = vv_parse_text(O, var_new)
+ for(var/V in varsvars)
+ var_new = replacetext(var_new,"\[[V]]","[O.vars[V]]")
if (O.vv_edit_var(variable, var_new) == FALSE)
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index 41c4cc591db..4191848cda8 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -855,10 +855,10 @@ var/next_mob_id = 0
/mob/living/vv_edit_var(var_name, var_value)
switch(var_name)
if("stat")
- if((stat == 2) && (var_value < 2))//Bringing the dead back to life
+ if((stat == DEAD) && (var_value < DEAD))//Bringing the dead back to life
dead_mob_list -= src
living_mob_list += src
- if((stat < 2) && (var_value == 2))//Kill he
+ if((stat < DEAD) && (var_value == DEAD))//Kill he
living_mob_list -= src
dead_mob_list += src
. = ..()
@@ -915,4 +915,5 @@ var/next_mob_id = 0
/mob/vv_get_var(var_name)
switch(var_name)
if ("attack_log")
- return debug_variable(var_name, attack_log, 0, src, FALSE)
\ No newline at end of file
+ return debug_variable(var_name, attack_log, 0, src, FALSE)
+ . = ..()
\ No newline at end of file
diff --git a/tgstation.dme b/tgstation.dme
index cdf9fc819f8..4fd9be26085 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -54,6 +54,7 @@
#include "code\__DEFINES\tablecrafting.dm"
#include "code\__DEFINES\tgui.dm"
#include "code\__DEFINES\tick.dm"
+#include "code\__DEFINES\typeids.dm"
#include "code\__DEFINES\vv.dm"
#include "code\__DEFINES\wires.dm"
#include "code\__HELPERS\_logging.dm"