mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-09 16:14:13 +00:00
Fixes issues with pen bbcode. Replacetext did not work correctly after I changed text2list - (It was missing 'needles' at the beginning of 'haystacks').
>dd_replacetext and dd_replacetext_case are now replacetext and replacetextEx respectively. >replacetext and replacetextEx works using strings only; it doesn't convert it into a list and then back into a string. Fixes some dumb-dumbs in textlist and text2listEx > "<" where there should be a "<=" > no else case for when the separator is longer than the text (causing empty lists to be returned) git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4971 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -25,9 +25,9 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an", "monkey", "ali
|
||||
var/original_msg = msg
|
||||
|
||||
//The symbol <20> (fancy multiplication sign) will be used to mark where to put replacements, so the original message must not contain it.
|
||||
msg = dd_replacetext(msg, "<22>", "")
|
||||
msg = dd_replacetext(msg, "HOLDERREF", "HOLDER-REF") //HOLDERREF is a key word which gets replaced with the admin's holder ref later on, so it mustn't be in the original message
|
||||
msg = dd_replacetext(msg, "ADMINREF", "ADMIN-REF") //ADMINREF is a key word which gets replaced with the admin's client's ref. So it mustn't be in the original message.
|
||||
msg = replacetext(msg, "<22>", "")
|
||||
msg = replacetext(msg, "HOLDERREF", "HOLDER-REF") //HOLDERREF is a key word which gets replaced with the admin's holder ref later on, so it mustn't be in the original message
|
||||
msg = replacetext(msg, "ADMINREF", "ADMIN-REF") //ADMINREF is a key word which gets replaced with the admin's client's ref. So it mustn't be in the original message.
|
||||
|
||||
var/list/msglist = text2list(msg, " ")
|
||||
|
||||
@@ -50,14 +50,14 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an", "monkey", "ali
|
||||
for(var/i = 1; i <= msglist.len; i++)
|
||||
var/word = msglist[i]
|
||||
var/original_word = word
|
||||
word = dd_replacetext(word, ".", "")
|
||||
word = dd_replacetext(word, ",", "")
|
||||
word = dd_replacetext(word, "!", "")
|
||||
word = dd_replacetext(word, "?", "") //Strips some common punctuation characters so the actual word can be better compared.
|
||||
word = dd_replacetext(word, ";", "")
|
||||
word = dd_replacetext(word, ":", "")
|
||||
word = dd_replacetext(word, "(", "")
|
||||
word = dd_replacetext(word, ")", "")
|
||||
word = replacetext(word, ".", "")
|
||||
word = replacetext(word, ",", "")
|
||||
word = replacetext(word, "!", "")
|
||||
word = replacetext(word, "?", "") //Strips some common punctuation characters so the actual word can be better compared.
|
||||
word = replacetext(word, ";", "")
|
||||
word = replacetext(word, ":", "")
|
||||
word = replacetext(word, "(", "")
|
||||
word = replacetext(word, ")", "")
|
||||
if(lowertext(word) in adminhelp_ignored_words)
|
||||
continue
|
||||
if(lowertext(word) == "ai")
|
||||
@@ -104,8 +104,8 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an", "monkey", "ali
|
||||
check_laws_text = (" (<A HREF='?src=\ref[X.holder];adminchecklaws=[ref_mob]'>CL</A>)")
|
||||
|
||||
var/msg_to_send = "\blue <b><font color=red>HELP: </font>[key_name(src, X)] (<A HREF='?src=\ref[X.holder];adminmoreinfo=[ref_mob]'>?</A>) (<A HREF='?src=\ref[X.holder];adminplayeropts=[ref_mob]'>PP</A>) (<A HREF='?src=\ref[X.holder];adminplayervars=[ref_mob]'>VV</A>) (<A HREF='?src=\ref[X.holder];adminplayersubtlemessage=[ref_mob]'>SM</A>) (<A HREF='?src=\ref[X.holder];adminplayerobservejump=[ref_mob]'>JMP</A>) (<A HREF='?src=\ref[X.holder];secretsadmin=check_antagonist'>CA</A>) [check_laws_text]:</b> [msg]"
|
||||
msg_to_send = dd_replacetext(msg_to_send, "HOLDERREF", "\ref[X.holder]")
|
||||
msg_to_send = dd_replacetext(msg_to_send, "ADMINREF", "\ref[X]")
|
||||
msg_to_send = replacetext(msg_to_send, "HOLDERREF", "\ref[X.holder]")
|
||||
msg_to_send = replacetext(msg_to_send, "ADMINREF", "\ref[X]")
|
||||
X << msg_to_send
|
||||
else
|
||||
var/ref_client = "\ref[src]"
|
||||
@@ -117,8 +117,8 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an", "monkey", "ali
|
||||
if(X.holder.sound_adminhelp)
|
||||
X << 'sound/effects/adminhelp.ogg'
|
||||
var/msg_to_send = "\blue <b><font color=red>HELP: </font>[key_name(src, X)] (<A HREF='?src=\ref[X.holder];adminplayervars=[ref_client]'>VV</A>) (<A HREF='?src=\ref[X.holder];secretsadmin=check_antagonist'>CA</A>):</b> [msg]"
|
||||
msg_to_send = dd_replacetext(msg_to_send, "HOLDERREF", "\ref[X.holder]")
|
||||
msg_to_send = dd_replacetext(msg_to_send, "ADMINREF", "\ref[X]")
|
||||
msg_to_send = replacetext(msg_to_send, "HOLDERREF", "\ref[X.holder]")
|
||||
msg_to_send = replacetext(msg_to_send, "ADMINREF", "\ref[X]")
|
||||
X << msg_to_send
|
||||
|
||||
src << "<font color='blue'>PM to-<b>Admins</b>: [original_msg]</font>"
|
||||
|
||||
Reference in New Issue
Block a user