Optimized and refactored list2text, text2list, and replacetext.

Also fixed some grammar in the station blueprint code.

Conflicts:
	code/game/objects/items/blueprints.dm
	code/game/objects/items/devices/uplinks.dm
	code/modules/admin/verbs/debug.dm
	code/modules/clothing/masks/gasmask.dm
	code/modules/detectivework/scanner.dm
	code/modules/flufftext/TextFilters.dm
	code/modules/mob/living/carbon/human/say.dm
	code/modules/mob/living/silicon/ai/say.dm

Conflicts:
	code/modules/admin/verbs/debug.dm
	code/modules/detectivework/scanner.dm
This commit is contained in:
YotaXP
2014-01-07 22:15:25 -05:00
committed by ZomgPonies
parent a6b70bc8b4
commit b7efb1b7ed
22 changed files with 543 additions and 147 deletions
+11 -11
View File
@@ -1,6 +1,6 @@
/obj/item/blueprints
name = "station blueprints"
desc = "Blueprints of the station. There's stamp \"Classified\" and several coffee stains on it."
desc = "Blueprints of the station. There is a \"Classified\" stamp and several coffee stains on it."
icon = 'icons/obj/items.dmi'
icon_state = "blueprints"
attack_verb = list("attacked", "bapped", "hit")
@@ -21,7 +21,7 @@
/obj/item/blueprints/attack_self(mob/M as mob)
if (!istype(M,/mob/living/carbon/human))
M << "This is stack of useless pieces of harsh paper." //monkeys cannot into projecting
M << "This stack of blue paper means nothing to you." //monkeys cannot into projecting
return
interact()
return
@@ -53,18 +53,18 @@
switch (get_area_type())
if (AREA_SPACE)
text += {"
<p>According this blueprints you are in <b>open space</b> now.</p>
<p>According the blueprints, you are now in <b>outer space</b>. Hold your breath.</p>
<p><a href='?src=\ref[src];action=create_area'>Mark this place as new area.</a></p>
"}
if (AREA_STATION)
text += {"
<p>According this blueprints you are in <b>[A.name]</b> now.</p>
<p>According the blueprints, you are now in <b>\"[A.name]\"</b>.</p>
<p>You may <a href='?src=\ref[src];action=edit_area'>
move an amendment</a> to the drawing.</p>
"}
if (AREA_SPECIAL)
text += {"
<p>This place isn't noted on these blueprints.</p>
<p>This place isn't noted on the blueprint.</p>
"}
else
return
@@ -105,20 +105,20 @@ move an amendment</a> to the drawing.</p>
if(!istype(res,/list))
switch(res)
if(ROOM_ERR_SPACE)
usr << "\red New area must be complete airtight!"
usr << "\red The new area must be completely airtight!"
return
if(ROOM_ERR_TOOLARGE)
usr << "\red New area too large!"
usr << "\red The new area too large!"
return
else
usr << "\red Error! Please notify administration!"
return
var/list/turf/turfs = res
var/str = trim(stripped_input(usr,"New area title","Blueprints editing", "", MAX_NAME_LEN))
var/str = trim(stripped_input(usr,"New area name:","Blueprint Editing", "", MAX_NAME_LEN))
if(!str || !length(str)) //cancel
return
if(length(str) > 50)
usr << "\red Text too long."
usr << "\red Name too long."
return
var/area/A = new
A.name = str
@@ -153,8 +153,8 @@ move an amendment</a> to the drawing.</p>
/obj/item/blueprints/proc/edit_area()
var/area/A = get_area()
//world << "DEBUG: edit_area"
var/prevname = A.name
var/str = trim(stripped_input(usr,"New area title","Blueprints editing", prevname, MAX_NAME_LEN))
var/prevname = "[A.name]"
var/str = trim(stripped_input(usr,"New area name:","Blueprint Editing", prevname, MAX_NAME_LEN))
if(!str || !length(str) || str==prevname) //cancel
return
if(length(str) > 50)
+1 -1
View File
@@ -100,7 +100,7 @@ A list of items and costs is stored under the datum of every game mode, alongsid
if (href_list["buy_item"])
var/item = href_list["buy_item"]
var/list/split = stringsplit(item, ":") // throw away variable
var/list/split = text2list(item, ":") // throw away variable
if(split.len == 2)
// Collect category and number
@@ -594,7 +594,7 @@ obj/structure/ex_act(severity)
if(text in direction_table)
return direction_table[text]
var/list/split_text = stringsplit(text, "-")
var/list/split_text = text2list(text, "-")
// If the first token is D, the icon_state represents
// a purely decorative tube, and doesn't actually