diff --git a/code/ZAS/Variable Settings.dm b/code/ZAS/Variable Settings.dm index 7e91a26b3f..2bfbed9681 100644 --- a/code/ZAS/Variable Settings.dm +++ b/code/ZAS/Variable Settings.dm @@ -348,7 +348,7 @@ var/global/vs_control/vsc = new else if(istext(vars["[V]_RANDOM"])) var/txt = vars["[V]_RANDOM"] if(findtextEx(txt,"PROB")) - txt = text2list(txt,"/") + txt = splittext(txt,"/") txt[1] = replacetext(txt[1],"PROB","") var/p = text2num(txt[1]) var/r = txt[2] @@ -358,7 +358,7 @@ var/global/vs_control/vsc = new newvalue = vars[V] else if(findtextEx(txt,"PICK")) txt = replacetext(txt,"PICK","") - txt = text2list(txt,",") + txt = splittext(txt,",") newvalue = pick(txt) else newvalue = roll(txt) diff --git a/code/modules/nano/JSON Reader.dm b/code/_compatibility/509/JSON Reader.dm similarity index 98% rename from code/modules/nano/JSON Reader.dm rename to code/_compatibility/509/JSON Reader.dm index 12edf1dd5c..544d197ccd 100644 --- a/code/modules/nano/JSON Reader.dm +++ b/code/_compatibility/509/JSON Reader.dm @@ -1,3 +1,5 @@ +#if DM_VERSION < 510 + json_token var value @@ -202,4 +204,6 @@ json_reader die(json_token/T) if(!T) T = get_token() - CRASH("Unexpected token: [T.value].") \ No newline at end of file + CRASH("Unexpected token: [T.value].") + +#endif \ No newline at end of file diff --git a/code/modules/nano/JSON Writer.dm b/code/_compatibility/509/JSON Writer.dm similarity index 97% rename from code/modules/nano/JSON Writer.dm rename to code/_compatibility/509/JSON Writer.dm index 97acc0b2cc..de3bb54a3e 100644 --- a/code/modules/nano/JSON Writer.dm +++ b/code/_compatibility/509/JSON Writer.dm @@ -1,3 +1,5 @@ +#if DM_VERSION < 510 + json_writer var use_cache = 0 @@ -48,7 +50,7 @@ json_writer var/lrep = length(json_escape[targ]) txt = copytext(txt, 1, i) + json_escape[targ] + copytext(txt, i + length(targ)) start = i + lrep - + return {""[txt]""} is_associative(list/L) @@ -56,3 +58,5 @@ json_writer // if the key is a list that means it's actually an array of lists (stupid Byond...) if(!isnum(key) && !isnull(L[key]) && !istype(key, /list)) return TRUE + +#endif \ No newline at end of file diff --git a/code/modules/nano/_JSON.dm b/code/_compatibility/509/_JSON.dm similarity index 54% rename from code/modules/nano/_JSON.dm rename to code/_compatibility/509/_JSON.dm index 9579189981..46f488ac56 100644 --- a/code/modules/nano/_JSON.dm +++ b/code/_compatibility/509/_JSON.dm @@ -1,17 +1,14 @@ +#if DM_VERSION < 510 /* n_Json v11.3.21 */ proc - json2list(json) + json_decode(json) var/static/json_reader/_jsonr = new() return _jsonr.ReadObject(_jsonr.ScanJson(json)) - list2json(list/L) + json_encode(list/L) var/static/json_writer/_jsonw = new() return _jsonw.write(L) - - list2json_usecache(list/L) - var/static/json_writer/_jsonw = new() - _jsonw.use_cache = 1 - return _jsonw.write(L) +#endif \ No newline at end of file diff --git a/code/_compatibility/509/text.dm b/code/_compatibility/509/text.dm new file mode 100644 index 0000000000..c22790ccb8 --- /dev/null +++ b/code/_compatibility/509/text.dm @@ -0,0 +1,6 @@ +#if DM_VERSION < 510 + +/proc/replacetext(text, find, replacement) + return jointext(splittext(text, find), replacement) + +#endif \ No newline at end of file diff --git a/code/_compatibility/509/type2type.dm b/code/_compatibility/509/type2type.dm new file mode 100644 index 0000000000..62d7a5e5c7 --- /dev/null +++ b/code/_compatibility/509/type2type.dm @@ -0,0 +1,102 @@ +#if DM_VERSION < 510 +// Concatenates a list of strings into a single string. A seperator may optionally be provided. +/proc/jointext(list/ls, sep) + if (ls.len <= 1) // Early-out code for empty or singleton lists. + return ls.len ? ls[1] : "" + + var/l = ls.len // Made local for sanic speed. + var/i = 0 // Incremented every time a list index is accessed. + + if (sep <> null) + // Macros expand to long argument lists like so: sep, ls[++i], sep, ls[++i], sep, ls[++i], etc... + #define S1 sep, ls[++i] + #define S4 S1, S1, S1, S1 + #define S16 S4, S4, S4, S4 + #define S64 S16, S16, S16, S16 + + . = "[ls[++i]]" // Make sure the initial element is converted to text. + + // Having the small concatenations come before the large ones boosted speed by an average of at least 5%. + if (l-1 & 0x01) // 'i' will always be 1 here. + . = text("[][][]", ., S1) // Append 1 element if the remaining elements are not a multiple of 2. + if (l-i & 0x02) + . = text("[][][][][]", ., S1, S1) // Append 2 elements if the remaining elements are not a multiple of 4. + if (l-i & 0x04) + . = text("[][][][][][][][][]", ., S4) // And so on.... + if (l-i & 0x08) + . = text("[][][][][][][][][][][][][][][][][]", ., S4, S4) + if (l-i & 0x10) + . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16) + if (l-i & 0x20) + . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16, S16) + if (l-i & 0x40) + . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64) + while (l > i) // Chomp through the rest of the list, 128 elements at a time. + . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64, S64) + + #undef S64 + #undef S16 + #undef S4 + #undef S1 + else + // Macros expand to long argument lists like so: ls[++i], ls[++i], ls[++i], etc... + #define S1 ls[++i] + #define S4 S1, S1, S1, S1 + #define S16 S4, S4, S4, S4 + #define S64 S16, S16, S16, S16 + + . = "[ls[++i]]" // Make sure the initial element is converted to text. + + if (l-1 & 0x01) // 'i' will always be 1 here. + . += S1 // Append 1 element if the remaining elements are not a multiple of 2. + if (l-i & 0x02) + . = text("[][][]", ., S1, S1) // Append 2 elements if the remaining elements are not a multiple of 4. + if (l-i & 0x04) + . = text("[][][][][]", ., S4) // And so on... + if (l-i & 0x08) + . = text("[][][][][][][][][]", ., S4, S4) + if (l-i & 0x10) + . = text("[][][][][][][][][][][][][][][][][]", ., S16) + if (l-i & 0x20) + . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16, S16) + if (l-i & 0x40) + . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64) + while (l > i) // Chomp through the rest of the list, 128 elements at a time. + . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ + [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64, S64) + + #undef S64 + #undef S16 + #undef S4 + #undef S1 + +// Converts a string into a list by splitting the string at each delimiter found. (discarding the seperator) +/proc/splittext(text, delimiter="\n") + var/delim_len = length(delimiter) + if (delim_len < 1) + return list(text) + + . = list() + var/last_found = 1 + var/found + + do + found = findtext(text, delimiter, last_found, 0) + . += copytext(text, last_found, found) + last_found = found + delim_len + while (found) +#endif \ No newline at end of file diff --git a/code/_helpers/text.dm b/code/_helpers/text.dm index 549060b0af..224301a898 100644 --- a/code/_helpers/text.dm +++ b/code/_helpers/text.dm @@ -175,13 +175,6 @@ /* * Text modification */ - -/proc/replacetext(text, find, replacement) - return list2text(text2list(text, find), replacement) - -/proc/replacetextEx(text, find, replacement) - return list2text(text2listEx(text, find), replacement) - /proc/replace_characters(var/t,var/list/repl_chars) for(var/char in repl_chars) t = replacetext(t, char, repl_chars[char]) diff --git a/code/_helpers/type2type.dm b/code/_helpers/type2type.dm index 4a6958aaad..ebdee3c659 100644 --- a/code/_helpers/type2type.dm +++ b/code/_helpers/type2type.dm @@ -50,141 +50,15 @@ while (left-- > 0) . = "0[.]" -// Concatenates a list of strings into a single string. A seperator may optionally be provided. -/proc/list2text(list/ls, sep) - if (ls.len <= 1) // Early-out code for empty or singleton lists. - return ls.len ? ls[1] : "" - - var/l = ls.len // Made local for sanic speed. - var/i = 0 // Incremented every time a list index is accessed. - - if (sep <> null) - // Macros expand to long argument lists like so: sep, ls[++i], sep, ls[++i], sep, ls[++i], etc... - #define S1 sep, ls[++i] - #define S4 S1, S1, S1, S1 - #define S16 S4, S4, S4, S4 - #define S64 S16, S16, S16, S16 - - . = "[ls[++i]]" // Make sure the initial element is converted to text. - - // Having the small concatenations come before the large ones boosted speed by an average of at least 5%. - if (l-1 & 0x01) // 'i' will always be 1 here. - . = text("[][][]", ., S1) // Append 1 element if the remaining elements are not a multiple of 2. - if (l-i & 0x02) - . = text("[][][][][]", ., S1, S1) // Append 2 elements if the remaining elements are not a multiple of 4. - if (l-i & 0x04) - . = text("[][][][][][][][][]", ., S4) // And so on.... - if (l-i & 0x08) - . = text("[][][][][][][][][][][][][][][][][]", ., S4, S4) - if (l-i & 0x10) - . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16) - if (l-i & 0x20) - . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16, S16) - if (l-i & 0x40) - . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64) - while (l > i) // Chomp through the rest of the list, 128 elements at a time. - . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64, S64) - - #undef S64 - #undef S16 - #undef S4 - #undef S1 - else - // Macros expand to long argument lists like so: ls[++i], ls[++i], ls[++i], etc... - #define S1 ls[++i] - #define S4 S1, S1, S1, S1 - #define S16 S4, S4, S4, S4 - #define S64 S16, S16, S16, S16 - - . = "[ls[++i]]" // Make sure the initial element is converted to text. - - if (l-1 & 0x01) // 'i' will always be 1 here. - . += S1 // Append 1 element if the remaining elements are not a multiple of 2. - if (l-i & 0x02) - . = text("[][][]", ., S1, S1) // Append 2 elements if the remaining elements are not a multiple of 4. - if (l-i & 0x04) - . = text("[][][][][]", ., S4) // And so on... - if (l-i & 0x08) - . = text("[][][][][][][][][]", ., S4, S4) - if (l-i & 0x10) - . = text("[][][][][][][][][][][][][][][][][]", ., S16) - if (l-i & 0x20) - . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16, S16) - if (l-i & 0x40) - . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64) - while (l > i) // Chomp through the rest of the list, 128 elements at a time. - . = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\ - [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64, S64) - - #undef S64 - #undef S16 - #undef S4 - #undef S1 - -// Slower then list2text, but correctly processes associative lists. -proc/tg_list2text(list/list, glue=",") - if (!istype(list) || !list.len) - return - var/output - for(var/i=1 to list.len) - output += (i!=1? glue : null)+(!isnull(list["[list[i]]"])?"[list["[list[i]]"]]":"[list[i]]") - return output - -// Converts a string into a list by splitting the string at each delimiter found. (discarding the seperator) -/proc/text2list(text, delimiter="\n") - var/delim_len = length(delimiter) - if (delim_len < 1) - return list(text) - - . = list() - var/last_found = 1 - var/found - - do - found = findtext(text, delimiter, last_found, 0) - . += copytext(text, last_found, found) - last_found = found + delim_len - while (found) - -// Case sensitive version of /proc/text2list(). -/proc/text2listEx(text, delimiter="\n") - var/delim_len = length(delimiter) - if (delim_len < 1) - return list(text) - - . = list() - var/last_found = 1 - var/found - - do - found = findtextEx(text, delimiter, last_found, 0) - . += copytext(text, last_found, found) - last_found = found + delim_len - while (found) - /proc/text2numlist(text, delimiter="\n") var/list/num_list = list() - for(var/x in text2list(text, delimiter)) + for(var/x in splittext(text, delimiter)) num_list += text2num(x) return num_list // Splits the text of a file at seperator and returns them in a list. /proc/file2list(filename, seperator="\n") - return text2list(return_file_text(filename),seperator) + return splittext(return_file_text(filename),seperator) // Turns a direction into text /proc/num2dir(direction) diff --git a/code/_onclick/hud/movable_screen_objects.dm b/code/_onclick/hud/movable_screen_objects.dm index d543b8b12a..71eff4a392 100644 --- a/code/_onclick/hud/movable_screen_objects.dm +++ b/code/_onclick/hud/movable_screen_objects.dm @@ -27,13 +27,13 @@ return //Split screen-loc up into X+Pixel_X and Y+Pixel_Y - var/list/screen_loc_params = text2list(PM["screen-loc"], ",") + var/list/screen_loc_params = splittext(PM["screen-loc"], ",") //Split X+Pixel_X up into list(X, Pixel_X) - var/list/screen_loc_X = text2list(screen_loc_params[1],":") + var/list/screen_loc_X = splittext(screen_loc_params[1],":") screen_loc_X[1] = encode_screen_X(text2num(screen_loc_X[1])) //Split Y+Pixel_Y up into list(Y, Pixel_Y) - var/list/screen_loc_Y = text2list(screen_loc_params[2],":") + var/list/screen_loc_Y = splittext(screen_loc_params[2],":") screen_loc_Y[1] = encode_screen_Y(text2num(screen_loc_Y[1])) if(snap2grid) //Discard Pixel Values diff --git a/code/_onclick/hud/spell_screen_objects.dm b/code/_onclick/hud/spell_screen_objects.dm index a59474749a..3365a4384d 100644 --- a/code/_onclick/hud/spell_screen_objects.dm +++ b/code/_onclick/hud/spell_screen_objects.dm @@ -57,15 +57,15 @@ overlays.Add(open_state) /obj/screen/movable/spell_master/proc/open_spellmaster() - var/list/screen_loc_xy = text2list(screen_loc,",") + var/list/screen_loc_xy = splittext(screen_loc,",") //Create list of X offsets - var/list/screen_loc_X = text2list(screen_loc_xy[1],":") + var/list/screen_loc_X = splittext(screen_loc_xy[1],":") var/x_position = decode_screen_X(screen_loc_X[1]) var/x_pix = screen_loc_X[2] //Create list of Y offsets - var/list/screen_loc_Y = text2list(screen_loc_xy[2],":") + var/list/screen_loc_Y = splittext(screen_loc_xy[2],":") var/y_position = decode_screen_Y(screen_loc_Y[1]) var/y_pix = screen_loc_Y[2] diff --git a/code/controllers/Processes/garbage.dm b/code/controllers/Processes/garbage.dm index 20e866c315..f306d49683 100644 --- a/code/controllers/Processes/garbage.dm +++ b/code/controllers/Processes/garbage.dm @@ -58,7 +58,7 @@ world/loop_checks = 0 if(A.loc != null) testing("GC: [A] | [A.type] is located in [A.loc] instead of null") if(A.contents.len) - testing("GC: [A] | [A.type] has contents: [list2text(A.contents)]") + testing("GC: [A] | [A.type] has contents: [jointext(A.contents)]") if(searching.len) for(var/atom/D in world) LookForRefs(D, searching) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 28dadc5adb..bd817baf41 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -265,7 +265,7 @@ var/list/gamemode_cache = list() if(type == "config") switch (name) if ("resource_urls") - config.resource_urls = text2list(value, " ") + config.resource_urls = splittext(value, " ") if ("admin_legacy_system") config.admin_legacy_system = 1 @@ -337,7 +337,7 @@ var/list/gamemode_cache = list() config.generate_asteroid = 1 if ("asteroid_z_levels") - config.asteroid_z_levels = text2list(value, ";") + config.asteroid_z_levels = splittext(value, ";") //Numbers get stored as strings, so we'll fix that right now. for(var/z_level in config.asteroid_z_levels) z_level = text2num(z_level) @@ -696,7 +696,7 @@ var/list/gamemode_cache = list() config.starlight = value >= 0 ? value : 0 if("ert_species") - config.ert_species = text2list(value, ";") + config.ert_species = splittext(value, ";") if(!config.ert_species.len) config.ert_species += "Human" @@ -707,7 +707,7 @@ var/list/gamemode_cache = list() config.aggressive_changelog = 1 if("default_language_prefixes") - var/list/values = text2list(value, " ") + var/list/values = splittext(value, " ") if(values.len > 0) language_prefixes = values diff --git a/code/datums/helper_datums/getrev.dm b/code/datums/helper_datums/getrev.dm index 5d6400886e..34082d12ba 100644 --- a/code/datums/helper_datums/getrev.dm +++ b/code/datums/helper_datums/getrev.dm @@ -14,7 +14,7 @@ var/global/datum/getrev/revdata = new() var/list/head_log = file2list(".git/logs/HEAD", "\n") for(var/line=head_log.len, line>=1, line--) if(head_log[line]) - var/list/last_entry = text2list(head_log[line], " ") + var/list/last_entry = splittext(head_log[line], " ") if(last_entry.len < 2) continue revision = last_entry[2] // Get date/time diff --git a/code/defines/obj.dm b/code/defines/obj.dm index 602008ccd7..7babc9c4c1 100644 --- a/code/defines/obj.dm +++ b/code/defines/obj.dm @@ -114,7 +114,7 @@ var/global/ManifestJSON department = 1 if(depthead && sci.len != 1) sci.Swap(1,sci.len) - + if(real_rank in cargo_positions) car[++car.len] = list("name" = name, "rank" = rank, "active" = isactive) department = 1 @@ -146,7 +146,7 @@ var/global/ManifestJSON "bot" = bot,\ "misc" = misc\ ) - ManifestJSON = list2json(PDA_Manifest) + ManifestJSON = json_encode(PDA_Manifest) return diff --git a/code/game/jobs/whitelist.dm b/code/game/jobs/whitelist.dm index f1dc546aea..440cf2e22e 100644 --- a/code/game/jobs/whitelist.dm +++ b/code/game/jobs/whitelist.dm @@ -28,7 +28,7 @@ var/list/whitelist = list() if (!text) log_misc("Failed to load config/alienwhitelist.txt") else - alien_whitelist = text2list(text, "\n") + alien_whitelist = splittext(text, "\n") //todo: admin aliens /proc/is_alien_whitelisted(mob/M, var/species) diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index 087d4a9025..e35b0953fe 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -85,7 +85,7 @@ usr << "No input found please hang up and try your call again." return - var/list/tempnetwork = text2list(input, ",") + var/list/tempnetwork = splittext(input, ",") if(tempnetwork.len < 1) usr << "No network found please hang up and try your call again." return diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index 3090e7ab7a..e1c6658ab4 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -58,7 +58,7 @@ var/cam = C.nano_structure() cameras[++cameras.len] = cam - camera_cache=list2json(cameras) + camera_cache=json_encode(cameras) if(current) data["current"] = current.nano_structure() diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 8747f7750c..2624c4ff28 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -286,7 +286,7 @@ What a mess.*/ return Perp = new/list() t1 = lowertext(t1) - var/list/components = text2list(t1, " ") + var/list/components = splittext(t1, " ") if(components.len > 5) return //Lets not let them search too greedily. for(var/datum/data/record/R in data_core.general) diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm index 8e57548d6e..1fa38c4a71 100644 --- a/code/game/machinery/computer/skills.dm +++ b/code/game/machinery/computer/skills.dm @@ -219,7 +219,7 @@ What a mess.*/ return Perp = new/list() t1 = lowertext(t1) - var/list/components = text2list(t1, " ") + var/list/components = splittext(t1, " ") if(components.len > 5) return //Lets not let them search too greedily. for(var/datum/data/record/R in data_core.general) diff --git a/code/game/machinery/computer/supply.dm b/code/game/machinery/computer/supply.dm index a8a4591ee2..224e201628 100644 --- a/code/game/machinery/computer/supply.dm +++ b/code/game/machinery/computer/supply.dm @@ -109,7 +109,7 @@ reqform.info += "RANK: [idrank]
" reqform.info += "REASON: [reason]
" reqform.info += "SUPPLY CRATE TYPE: [P.name]
" - reqform.info += "ACCESS RESTRICTION: [replacetext(get_access_desc(P.access))]
" + reqform.info += "ACCESS RESTRICTION: [get_access_desc(P.access)]
" reqform.info += "CONTENTS:
" reqform.info += P.manifest reqform.info += "
" @@ -310,7 +310,7 @@ reqform.info += "RANK: [idrank]
" reqform.info += "REASON: [reason]
" reqform.info += "SUPPLY CRATE TYPE: [P.name]
" - reqform.info += "ACCESS RESTRICTION: [replacetext(get_access_desc(P.access))]
" + reqform.info += "ACCESS RESTRICTION: [get_access_desc(P.access)]
" reqform.info += "CONTENTS:
" reqform.info += P.manifest reqform.info += "
" diff --git a/code/game/machinery/computer3/computers/security.dm b/code/game/machinery/computer3/computers/security.dm index 0c58ea6728..59bb46fd69 100644 --- a/code/game/machinery/computer3/computers/security.dm +++ b/code/game/machinery/computer3/computers/security.dm @@ -305,7 +305,7 @@ What a mess.*/ return Perp = new/list() t1 = lowertext(t1) - var/list/components = text2list(t1, " ") + var/list/components = splittext(t1, " ") if(components.len > 5) return //Lets not let them search too greedily. for(var/datum/data/record/R in data_core.general) diff --git a/code/game/machinery/embedded_controller/airlock_docking_controller_multi.dm b/code/game/machinery/embedded_controller/airlock_docking_controller_multi.dm index d03bffcbae..0cffb34dc6 100644 --- a/code/game/machinery/embedded_controller/airlock_docking_controller_multi.dm +++ b/code/game/machinery/embedded_controller/airlock_docking_controller_multi.dm @@ -2,21 +2,21 @@ //this is the master controller, that things will try to dock with. /obj/machinery/embedded_controller/radio/docking_port_multi name = "docking port controller" - + var/child_tags_txt var/child_names_txt var/list/child_names = list() - + var/datum/computer/file/embedded_program/docking/multi/docking_program /obj/machinery/embedded_controller/radio/docking_port_multi/initialize() ..() docking_program = new/datum/computer/file/embedded_program/docking/multi(src) program = docking_program - - var/list/names = text2list(child_names_txt, ";") - var/list/tags = text2list(child_tags_txt, ";") - + + var/list/names = splittext(child_names_txt, ";") + var/list/tags = splittext(child_tags_txt, ";") + if (names.len == tags.len) for (var/i = 1; i <= tags.len; i++) child_names[tags[i]] = names[i] @@ -84,10 +84,10 @@ /obj/machinery/embedded_controller/radio/airlock/docking_port_multi/Topic(href, href_list) if(..()) return - + usr.set_machine(src) src.add_fingerprint(usr) - + var/clean = 0 switch(href_list["command"]) //anti-HTML-hacking checks if("cycle_ext") diff --git a/code/game/machinery/embedded_controller/docking_program_multi.dm b/code/game/machinery/embedded_controller/docking_program_multi.dm index 3901591720..a4ad7d2985 100644 --- a/code/game/machinery/embedded_controller/docking_program_multi.dm +++ b/code/game/machinery/embedded_controller/docking_program_multi.dm @@ -17,7 +17,7 @@ if (istype(M,/obj/machinery/embedded_controller/radio/docking_port_multi)) //if our parent controller is the right type, then we can auto-init stuff at construction var/obj/machinery/embedded_controller/radio/docking_port_multi/controller = M //parse child_tags_txt and create child tags - children_tags = text2list(controller.child_tags_txt, ";") + children_tags = splittext(controller.child_tags_txt, ";") children_ready = list() children_override = list() diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index 443a704934..0c14c66990 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -49,7 +49,7 @@ var/global/list/navbeacons // no I don't like putting this in, but it will do codes = new() - var/list/entries = text2list(codes_txt, ";") // entries are separated by semicolons + var/list/entries = splittext(codes_txt, ";") // entries are separated by semicolons for(var/e in entries) var/index = findtext(e, "=") // format is "key=value" diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 561979e6e4..b1b8d497b3 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -96,7 +96,7 @@ wires = new(src) spawn(4) if(src.product_slogans) - src.slogan_list += text2list(src.product_slogans, ";") + src.slogan_list += splittext(src.product_slogans, ";") // So not all machines speak at the exact same time. // The first time this machine says something will be at slogantime + this random value, @@ -104,7 +104,7 @@ src.last_slogan = world.time + rand(0, slogan_delay) if(src.product_ads) - src.ads_list += text2list(src.product_ads, ";") + src.ads_list += splittext(src.product_ads, ";") src.build_inventory() power_change() diff --git a/code/game/objects/items/devices/violin.dm b/code/game/objects/items/devices/violin.dm index 2286f78714..6d195bd2bd 100644 --- a/code/game/objects/items/devices/violin.dm +++ b/code/game/objects/items/devices/violin.dm @@ -202,10 +202,10 @@ for(var/line in song.lines) //world << line - for(var/beat in text2list(lowertext(line), ",")) + for(var/beat in splittext(lowertext(line), ",")) //world << "beat: [beat]" - var/list/notes = text2list(beat, "/") - for(var/note in text2list(notes[1], "-")) + var/list/notes = splittext(beat, "/") + for(var/note in splittext(notes[1], "-")) //world << "note: [note]" if(!playing || !isliving(loc))//If the violin is playing, or isn't held by a person playing = 0 @@ -367,7 +367,7 @@ //split into lines spawn() - var/list/lines = text2list(t, "\n") + var/list/lines = splittext(t, "\n") var/tempo = 5 if(copytext(lines[1],1,6) == "BPM: ") tempo = 600 / text2num(copytext(lines[1],6)) diff --git a/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm b/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm index ef6b4c4d57..61de25f44c 100644 --- a/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm +++ b/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm @@ -9,7 +9,7 @@ var/list/network var/locked = 1 var/emagged = 0 - + /obj/item/weapon/circuitboard/security/New() ..() network = station_networks @@ -18,7 +18,7 @@ name = T_BOARD("engineering camera monitor") build_path = /obj/machinery/computer/security/engineering req_access = list() - + /obj/item/weapon/circuitboard/security/engineering/New() ..() network = engineering_networks @@ -36,7 +36,7 @@ /obj/item/weapon/circuitboard/security/deconstruct(var/obj/machinery/computer/security/C) if (..(C)) network = C.network - + /obj/item/weapon/circuitboard/security/emag_act(var/remaining_charges, var/mob/user) if(emagged) user << "Circuit lock is already removed." @@ -60,12 +60,12 @@ if(locked) user << "Circuit controls are locked." return - var/existing_networks = list2text(network,",") + var/existing_networks = jointext(network,",") var/input = sanitize(input(usr, "Which networks would you like to connect this camera console circuit to? Seperate networks with a comma. No Spaces!\nFor example: SS13,Security,Secret ", "Multitool-Circuitboard interface", existing_networks)) if(!input) usr << "No input found please hang up and try your call again." return - var/list/tempnetwork = text2list(input, ",") + var/list/tempnetwork = splittext(input, ",") tempnetwork = difflist(tempnetwork,restricted_camera_networks,1) if(tempnetwork.len < 1) usr << "No network found please hang up and try your call again." diff --git a/code/game/objects/structures/musician.dm b/code/game/objects/structures/musician.dm index fa53637f88..a39e9658dd 100644 --- a/code/game/objects/structures/musician.dm +++ b/code/game/objects/structures/musician.dm @@ -220,10 +220,10 @@ for(var/line in song.lines) //world << line - for(var/beat in text2list(lowertext(line), ",")) + for(var/beat in splittext(lowertext(line), ",")) //world << "beat: [beat]" - var/list/notes = text2list(beat, "/") - for(var/note in text2list(notes[1], "-")) + var/list/notes = splittext(beat, "/") + for(var/note in splittext(notes[1], "-")) //world << "note: [note]" if(!playing || !anchored)//If the piano is playing, or is loose playing = 0 @@ -387,7 +387,7 @@ //split into lines spawn() - var/list/lines = text2list(t, "\n") + var/list/lines = splittext(t, "\n") var/tempo = 5 if(copytext(lines[1],1,6) == "BPM: ") tempo = 600 / text2num(copytext(lines[1],6)) diff --git a/code/game/objects/structures/transit_tubes.dm b/code/game/objects/structures/transit_tubes.dm index 47a2f53fb3..0f9b4a603a 100644 --- a/code/game/objects/structures/transit_tubes.dm +++ b/code/game/objects/structures/transit_tubes.dm @@ -367,7 +367,7 @@ obj/structure/ex_act(severity) // currently on. /obj/structure/transit_tube_pod/proc/mix_air() var/datum/gas_mixture/environment = loc.return_air() - + //note that share_ratio assumes both gas mixes have the same volume, //so if the volume is changed this may need to be changed as well. air_contents.share_ratio(environment, 1) @@ -539,7 +539,7 @@ obj/structure/ex_act(severity) if(text in direction_table) return direction_table[text] - var/list/split_text = text2list(text, "-") + var/list/split_text = splittext(text, "-") // If the first token is D, the icon_state represents // a purely decorative tube, and doesn't actually diff --git a/code/modules/admin/admin_ranks.dm b/code/modules/admin/admin_ranks.dm index 5d1f5db452..3652237454 100644 --- a/code/modules/admin/admin_ranks.dm +++ b/code/modules/admin/admin_ranks.dm @@ -14,7 +14,7 @@ var/list/admin_ranks = list() //list of all ranks with associated rights if(!length(line)) continue if(copytext(line,1,2) == "#") continue - var/list/List = text2list(line,"+") + var/list/List = splittext(line,"+") if(!List.len) continue var/rank = ckeyEx(List[1]) @@ -77,7 +77,7 @@ var/list/admin_ranks = list() //list of all ranks with associated rights if(copytext(line,1,2) == "#") continue //Split the line at every "-" - var/list/List = text2list(line, "-") + var/list/List = splittext(line, "-") if(!List.len) continue //ckey is before the first "-" diff --git a/code/modules/admin/create_mob.dm b/code/modules/admin/create_mob.dm index a723fe3795..4a892d893d 100644 --- a/code/modules/admin/create_mob.dm +++ b/code/modules/admin/create_mob.dm @@ -2,7 +2,7 @@ /datum/admins/proc/create_mob(var/mob/user) if (!create_mob_html) var/mobjs = null - mobjs = list2text(typesof(/mob), ";") + mobjs = jointext(typesof(/mob), ";") create_mob_html = file2text('html/create_object.html') create_mob_html = replacetext(create_mob_html, "null /* object types */", "\"[mobjs]\"") diff --git a/code/modules/admin/create_object.dm b/code/modules/admin/create_object.dm index 779cb7bc90..3778441b1d 100644 --- a/code/modules/admin/create_object.dm +++ b/code/modules/admin/create_object.dm @@ -3,7 +3,7 @@ /datum/admins/proc/create_object(var/mob/user) if (!create_object_html) var/objectjs = null - objectjs = list2text(typesof(/obj), ";") + objectjs = jointext(typesof(/obj), ";") create_object_html = file2text('html/create_object.html') create_object_html = replacetext(create_object_html, "null /* object types */", "\"[objectjs]\"") @@ -22,7 +22,7 @@ if (!quick_create_object_html) var/objectjs = null - objectjs = list2text(typesof(path), ";") + objectjs = jointext(typesof(path), ";") quick_create_object_html = file2text('html/create_object.html') quick_create_object_html = replacetext(quick_create_object_html, "null /* object types */", "\"[objectjs]\"") diff --git a/code/modules/admin/create_turf.dm b/code/modules/admin/create_turf.dm index 0938b7bd33..fdaa103b5d 100644 --- a/code/modules/admin/create_turf.dm +++ b/code/modules/admin/create_turf.dm @@ -2,7 +2,7 @@ /datum/admins/proc/create_turf(var/mob/user) if (!create_turf_html) var/turfjs = null - turfjs = list2text(typesof(/turf), ";") + turfjs = jointext(typesof(/turf), ";") create_turf_html = file2text('html/create_object.html') create_turf_html = replacetext(create_turf_html, "null /* object types */", "\"[turfjs]\"") diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 4bc8298193..4b07ce2ad8 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -769,7 +769,7 @@ message_admins("\blue [key_name_admin(usr)] removed [t]", 1) jobban_remove(t) href_list["ban"] = 1 // lets it fall through and refresh - var/t_split = text2list(t, " - ") + var/t_split = splittext(t, " - ") var/key = t_split[1] var/job = t_split[2] DB_ban_unban(ckey(key), BANTYPE_JOB_PERMA, job) @@ -1574,9 +1574,9 @@ alert("Select fewer object types, (max 5)") return else if(length(removed_paths)) - alert("Removed:\n" + list2text(removed_paths, "\n")) + alert("Removed:\n" + jointext(removed_paths, "\n")) - var/list/offset = text2list(href_list["offset"],",") + var/list/offset = splittext(href_list["offset"],",") var/number = dd_range(1, 100, text2num(href_list["object_count"])) var/X = offset.len > 0 ? text2num(offset[1]) : 0 var/Y = offset.len > 1 ? text2num(offset[2]) : 0 diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index 5f4595e026..f4ce67aa2c 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -29,7 +29,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey"," var/original_msg = msg //explode the input msg into a list - var/list/msglist = text2list(msg, " ") + var/list/msglist = splittext(msg, " ") //generate keywords lookup var/list/surnames = list() @@ -40,7 +40,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey"," if(M.mind) indexing += M.mind.name for(var/string in indexing) - var/list/L = text2list(string, " ") + var/list/L = splittext(string, " ") var/surname_found = 0 //surnames for(var/i=L.len, i>=1, i--) diff --git a/code/modules/admin/verbs/check_customitem_activity.dm b/code/modules/admin/verbs/check_customitem_activity.dm index 1bda56c6e5..80bbfccc12 100644 --- a/code/modules/admin/verbs/check_customitem_activity.dm +++ b/code/modules/admin/verbs/check_customitem_activity.dm @@ -37,11 +37,11 @@ var/inactive_keys = "None
" var/list/ckeys_with_customitems = list() var/file = file2text("config/custom_items.txt") - var/lines = text2list(file, "\n") + var/lines = splittext(file, "\n") for(var/line in lines) // split & clean up - var/list/Entry = text2list(line, ":") + var/list/Entry = splittext(line, ":") for(var/i = 1 to Entry.len) Entry[i] = trim(Entry[i]) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 6522c5e1a4..0bf386d4a7 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -932,17 +932,17 @@ switch(input("Which list?") in list("Players","Admins","Mobs","Living Mobs","Dead Mobs", "Clients")) if("Players") - usr << list2text(player_list,",") + usr << jointext(player_list,",") if("Admins") - usr << list2text(admins,",") + usr << jointext(admins,",") if("Mobs") - usr << list2text(mob_list,",") + usr << jointext(mob_list,",") if("Living Mobs") - usr << list2text(living_mob_list,",") + usr << jointext(living_mob_list,",") if("Dead Mobs") - usr << list2text(dead_mob_list,",") + usr << jointext(dead_mob_list,",") if("Clients") - usr << list2text(clients,",") + usr << jointext(clients,",") // DNA2 - Admin Hax /client/proc/cmd_admin_toggle_block(var/mob/M,var/block) diff --git a/code/modules/customitems/item_spawning.dm b/code/modules/customitems/item_spawning.dm index 729c204f8b..4e25a6be8f 100644 --- a/code/modules/customitems/item_spawning.dm +++ b/code/modules/customitems/item_spawning.dm @@ -75,7 +75,7 @@ K.new_icon_file = CUSTOM_ITEM_OBJ if(istype(item, /obj/item/device/kit/paint)) var/obj/item/device/kit/paint/kit = item - kit.allowed_types = text2list(additional_data, ", ") + kit.allowed_types = splittext(additional_data, ", ") else if(istype(item, /obj/item/device/kit/suit)) var/obj/item/device/kit/suit/kit = item kit.new_light_overlay = additional_data @@ -130,7 +130,7 @@ /hook/startup/proc/load_custom_items() var/datum/custom_item/current_data - for(var/line in text2list(file2text("config/custom_items.txt"), "\n")) + for(var/line in splittext(file2text("config/custom_items.txt"), "\n")) line = trim(line) if(line == "" || !line || findtext(line, "#", 1, 2)) @@ -173,7 +173,7 @@ if("req_access") current_data.req_access = text2num(field_data) if("req_titles") - current_data.req_titles = text2list(field_data,", ") + current_data.req_titles = splittext(field_data,", ") if("kit_name") current_data.kit_name = field_data if("kit_desc") diff --git a/code/modules/flufftext/TextFilters.dm b/code/modules/flufftext/TextFilters.dm index 44cc91a8e4..5a40ea1934 100644 --- a/code/modules/flufftext/TextFilters.dm +++ b/code/modules/flufftext/TextFilters.dm @@ -26,7 +26,7 @@ proc/Intoxicated(phrase) proc/NewStutter(phrase,stunned) phrase = html_decode(phrase) - var/list/split_phrase = text2list(phrase," ") //Split it up into words. + var/list/split_phrase = splittext(phrase," ") //Split it up into words. var/list/unstuttered_words = split_phrase.Copy() var/i = rand(1,3) @@ -57,7 +57,7 @@ proc/NewStutter(phrase,stunned) split_phrase[index] = word - return sanitize(list2text(split_phrase," ")) + return sanitize(jointext(split_phrase," ")) proc/Stagger(mob/M,d) //Technically not a filter, but it relates to drunkenness. step(M, pick(d,turn(d,90),turn(d,-90))) @@ -67,7 +67,7 @@ proc/Ellipsis(original_msg, chance = 50) if(chance >= 100) return original_msg var/list - words = text2list(original_msg," ") + words = splittext(original_msg," ") new_words = list() var/new_msg = "" @@ -78,6 +78,6 @@ proc/Ellipsis(original_msg, chance = 50) else new_words += w - new_msg = list2text(new_words," ") + new_msg = jointext(new_words," ") return new_msg diff --git a/code/modules/mob/hear_say.dm b/code/modules/mob/hear_say.dm index f925c32b79..dfbaa45154 100644 --- a/code/modules/mob/hear_say.dm +++ b/code/modules/mob/hear_say.dm @@ -230,7 +230,7 @@ var/heard = "" if(prob(15)) var/list/punctuation = list(",", "!", ".", ";", "?") - var/list/messages = text2list(message, " ") + var/list/messages = splittext(message, " ") var/R = rand(1, messages.len) var/heardword = messages[R] if(copytext(heardword,1, 1) in punctuation) diff --git a/code/modules/mob/living/autohiss.dm b/code/modules/mob/living/autohiss.dm index 196d48a944..7f9c832e84 100644 --- a/code/modules/mob/living/autohiss.dm +++ b/code/modules/mob/living/autohiss.dm @@ -92,7 +92,7 @@ . += pick(map[min_char]) message = copytext(message, min_index + 1) - return list2text(.) + return jointext(., null) #undef AUTOHISS_OFF #undef AUTOHISS_BASIC diff --git a/code/modules/mob/living/carbon/human/whisper.dm b/code/modules/mob/living/carbon/human/whisper.dm index 4d59841cd6..8817c43528 100644 --- a/code/modules/mob/living/carbon/human/whisper.dm +++ b/code/modules/mob/living/carbon/human/whisper.dm @@ -92,7 +92,7 @@ if(voice_sub == "Unknown") if(copytext(message, 1, 2) != "*") - var/list/temp_message = text2list(message, " ") + var/list/temp_message = splittext(message, " ") var/list/pick_list = list() for(var/i = 1, i <= temp_message.len, i++) pick_list += i @@ -101,7 +101,7 @@ if(findtext(temp_message[H], "*") || findtext(temp_message[H], ";") || findtext(temp_message[H], ":")) continue temp_message[H] = ninjaspeak(temp_message[H]) pick_list -= H - message = list2text(temp_message, " ") + message = jointext(temp_message, " ") message = replacetext(message, "o", "¤") message = replacetext(message, "p", "þ") message = replacetext(message, "l", "£") diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index cecb005613..761ef5110d 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -232,11 +232,11 @@ var/list/ai_verbs_hidden = list( // For why this exists, refer to https://xkcd.c /mob/living/silicon/ai/proc/setup_icon() var/file = file2text("config/custom_sprites.txt") - var/lines = text2list(file, "\n") + var/lines = splittext(file, "\n") for(var/line in lines) // split & clean up - var/list/Entry = text2list(line, ":") + var/list/Entry = splittext(line, ":") for(var/i = 1 to Entry.len) Entry[i] = trim(Entry[i]) diff --git a/code/modules/mob/living/silicon/robot/custom_sprites.dm b/code/modules/mob/living/silicon/robot/custom_sprites.dm index c3632cd62e..8eb937552e 100644 --- a/code/modules/mob/living/silicon/robot/custom_sprites.dm +++ b/code/modules/mob/living/silicon/robot/custom_sprites.dm @@ -6,7 +6,7 @@ var/list/robot_custom_icons /hook/startup/proc/load_robot_custom_sprites() var/config_file = file2text("config/custom_sprites.txt") - var/list/lines = text2list(config_file, "\n") + var/list/lines = splittext(config_file, "\n") robot_custom_icons = list() for(var/line in lines) diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm index c1e367fc98..e270185414 100644 --- a/code/modules/nano/nanoui.dm +++ b/code/modules/nano/nanoui.dm @@ -345,12 +345,12 @@ nanoui is used to open and update nano browser uis var/template_data_json = "{}" // An empty JSON object if (templates.len > 0) - template_data_json = list2json(templates) + template_data_json = json_encode(templates) var/list/send_data = get_send_data(initial_data) - var/initial_data_json = replacetext(replacetext(list2json_usecache(send_data), """, "&#34;"), "'", "'") + var/initial_data_json = replacetext(replacetext(json_encode(send_data), """, "&#34;"), "'", "'") - var/url_parameters_json = list2json(list("src" = "\ref[src]")) + var/url_parameters_json = json_encode(list("src" = "\ref[src]")) return {" @@ -459,7 +459,7 @@ nanoui is used to open and update nano browser uis var/list/send_data = get_send_data(data) //user << list2json(data) // used for debugging - user << output(list2params(list(list2json_usecache(send_data))),"[window_id].browser:receiveUpdateData") + user << output(list2params(list(json_encode(send_data))),"[window_id].browser:receiveUpdateData") /** * This Topic() proc is called whenever a user clicks on a link within a Nano UI diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm index efb05b90d7..a5e5a00043 100644 --- a/code/modules/research/server.dm +++ b/code/modules/research/server.dm @@ -40,12 +40,12 @@ var/list/temp_list if(!id_with_upload.len) temp_list = list() - temp_list = text2list(id_with_upload_string, ";") + temp_list = splittext(id_with_upload_string, ";") for(var/N in temp_list) id_with_upload += text2num(N) if(!id_with_download.len) temp_list = list() - temp_list = text2list(id_with_download_string, ";") + temp_list = splittext(id_with_download_string, ";") for(var/N in temp_list) id_with_download += text2num(N) diff --git a/code/modules/research/xenoarchaeology/finds/finds_talkingitem.dm b/code/modules/research/xenoarchaeology/finds/finds_talkingitem.dm index 58cfdbb031..0dd7e46ed8 100644 --- a/code/modules/research/xenoarchaeology/finds/finds_talkingitem.dm +++ b/code/modules/research/xenoarchaeology/finds/finds_talkingitem.dm @@ -44,7 +44,7 @@ /*var/l = lentext(msg) if(findtext(msg," ",l,l+1)==0) msg+=" "*/ - seperate = text2list(msg, " ") + seperate = splittext(msg, " ") for(var/Xa = 1,Xa[name()]
- [list2text(., "
")]
+ [jointext(., "
")] "} /datum/disease2/disease/get_view_variables_options() diff --git a/code/modules/virus2/disease2.dm b/code/modules/virus2/disease2.dm index b6e56d231b..9af07c48b6 100644 --- a/code/modules/virus2/disease2.dm +++ b/code/modules/virus2/disease2.dm @@ -210,7 +210,7 @@ var/global/list/virusDB = list() Antigen: [antigens2string(antigen)]
Transmitted By: [spreadtype]
Rate of Progression: [stageprob * 10]
- Species Affected: [list2text(affected_species, ", ")]
+ Species Affected: [jointext(affected_species, ", ")]
"} r += "Symptoms:
" diff --git a/code/modules/virus2/diseasesplicer.dm b/code/modules/virus2/diseasesplicer.dm index 7162144861..8d88639db3 100644 --- a/code/modules/virus2/diseasesplicer.dm +++ b/code/modules/virus2/diseasesplicer.dm @@ -52,7 +52,7 @@ if (memorybank) data["buffer"] = list("name" = (analysed ? memorybank.effect.name : "Unknown Symptom"), "stage" = memorybank.effect.stage) if (species_buffer) - data["species_buffer"] = analysed ? list2text(species_buffer, ", ") : "Unknown Species" + data["species_buffer"] = analysed ? jointext(species_buffer, ", ") : "Unknown Species" if (splicing) data["busy"] = "Splicing..." @@ -65,7 +65,7 @@ if (dish.virus2) if (dish.virus2.affected_species) - data["affected_species"] = dish.analysed ? list2text(dish.virus2.affected_species, ", ") : "Unknown" + data["affected_species"] = dish.analysed ? jointext(dish.virus2.affected_species, ", ") : "Unknown" if (dish.growth >= 50) var/list/effects[0] @@ -109,7 +109,7 @@ d.name = "[memorybank.effect.name] GNA disk (Stage: [memorybank.effect.stage])" d.effect = memorybank else if (species_buffer) - d.name = "[list2text(species_buffer, ", ")] GNA disk" + d.name = "[jointext(species_buffer, ", ")] GNA disk" d.species = species_buffer else if (memorybank) diff --git a/code/world.dm b/code/world.dm index 3fcdf2eb42..136228ccfc 100644 --- a/code/world.dm +++ b/code/world.dm @@ -452,7 +452,7 @@ var/world_topic_spam_protect_time = world.timeofday if (!text) error("Failed to load config/mods.txt") else - var/list/lines = text2list(text, "\n") + var/list/lines = splittext(text, "\n") for(var/line in lines) if (!line) continue @@ -473,7 +473,7 @@ var/world_topic_spam_protect_time = world.timeofday if (!text) error("Failed to load config/mentors.txt") else - var/list/lines = text2list(text, "\n") + var/list/lines = splittext(text, "\n") for(var/line in lines) if (!line) continue @@ -535,7 +535,7 @@ var/world_topic_spam_protect_time = world.timeofday features += "hosted by [config.hostedby]" if (features) - s += ": [list2text(features, ", ")]" + s += ": [jointext(features, ", ")]" /* does this help? I do not know */ if (src.status != s) diff --git a/polaris.dme b/polaris.dme index 1e71b20403..8a320ab478 100644 --- a/polaris.dme +++ b/polaris.dme @@ -33,6 +33,11 @@ #include "code\__defines\species_languages.dm" #include "code\__defines\targeting.dm" #include "code\__defines\turfs.dm" +#include "code\_compatibility\509\_JSON.dm" +#include "code\_compatibility\509\JSON Reader.dm" +#include "code\_compatibility\509\JSON Writer.dm" +#include "code\_compatibility\509\text.dm" +#include "code\_compatibility\509\type2type.dm" #include "code\_helpers\atmospherics.dm" #include "code\_helpers\datum_pool.dm" #include "code\_helpers\files.dm" @@ -1469,9 +1474,6 @@ #include "code\modules\multiz\pipes.dm" #include "code\modules\multiz\structures.dm" #include "code\modules\multiz\turf.dm" -#include "code\modules\nano\_JSON.dm" -#include "code\modules\nano\JSON Reader.dm" -#include "code\modules\nano\JSON Writer.dm" #include "code\modules\nano\nanoexternal.dm" #include "code\modules\nano\nanomanager.dm" #include "code\modules\nano\nanomapgen.dm"