[DOWNSTREAM] Cyrillic Support v2 (#24075)

* cyrillic fixes https://github.com/ss220club/Paradise/commit/cbdad6f11f0e0e16694cdb60f8ccb3d6dd23fe92

* fix: remove control characters

* utf-8 support

* more fixes

* spellbook to utf8

* Update code/modules/research/server.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/modules/research/server.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/modules/paperwork/paper.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/modules/paperwork/folders.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/modules/mob/mob_say_base.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* update formatting

* fix ai alerts

* fix spaceheater

* fix noticeboard

---------

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
larentoun
2024-03-11 09:35:08 +00:00
committed by GitHub
co-authored by Burzah
parent d0514fef1f
commit c5c911d252
68 changed files with 185 additions and 185 deletions
+18 -18
View File
@@ -69,10 +69,10 @@
//Returns null if there is any bad text in the string
/proc/reject_bad_text(text, max_length=512)
if(length(text) > max_length) return //message too long
if(length_char(text) > max_length) return //message too long
var/non_whitespace = 0
for(var/i=1, i<=length(text), i++)
switch(text2ascii(text,i))
for(var/i=1, i<=length_char(text), i++)
switch(text2ascii_char(text,i))
if(62,60,92,47) return //rejects the text if it contains these bad characters: <, >, \ or /
if(127 to 255) return //rejects weird letters like
if(0 to 31) return //more weird stuff
@@ -103,25 +103,25 @@
/proc/reject_bad_name(t_in, allow_numbers=0, max_length=MAX_NAME_LEN)
// Decode so that names with characters like < are still rejected
t_in = html_decode(t_in)
if(!t_in || length(t_in) > max_length)
if(!t_in || length_char(t_in) > max_length)
return //Rejects the input if it is null or if it is longer than the max length allowed
var/number_of_alphanumeric = 0
var/last_char_group = 0
var/t_out = ""
for(var/i=1, i<=length(t_in), i++)
var/ascii_char = text2ascii(t_in,i)
for(var/i=1, i<=length_char(t_in), i++)
var/ascii_char = text2ascii_char(t_in,i)
switch(ascii_char)
// A .. Z
if(65 to 90) //Uppercase Letters
// A .. Z, А .. Я, Ё
if(65 to 90, 1040 to 1071, 1025) //Uppercase Letters
t_out += ascii2text(ascii_char)
number_of_alphanumeric++
last_char_group = 4
// a .. z
if(97 to 122) //Lowercase Letters
if(last_char_group<2) t_out += ascii2text(ascii_char-32) //Force uppercase first character
// a .. z, а .. я, ё
if(97 to 122, 1072 to 1103, 1105) //Lowercase Letters
if(last_char_group<2) t_out += uppertext(ascii2text(ascii_char)) //Force uppercase first character
else t_out += ascii2text(ascii_char)
number_of_alphanumeric++
last_char_group = 4
@@ -192,21 +192,21 @@
/proc/dd_hasprefix(text, prefix)
var/start = 1
var/end = length(prefix) + 1
return findtext(text, prefix, start, end)
return findtext_char(text, prefix, start, end)
//Checks the beginning of a string for a specified sub-string. This proc is case sensitive
//Returns the position of the substring or 0 if it was not found
/proc/dd_hasprefix_case(text, prefix)
var/start = 1
var/end = length(prefix) + 1
return findtextEx(text, prefix, start, end)
return findtextEx_char(text, prefix, start, end)
//Checks the end of a string for a specified substring.
//Returns the position of the substring or 0 if it was not found
/proc/dd_hassuffix(text, suffix)
var/start = length(text) - length(suffix)
if(start)
return findtext(text, suffix, start, null)
return findtext_char(text, suffix, start, null)
return
//Checks the end of a string for a specified substring. This proc is case sensitive
@@ -214,7 +214,7 @@
/proc/dd_hassuffix_case(text, suffix)
var/start = length(text) - length(suffix)
if(start)
return findtextEx(text, suffix, start, null)
return findtextEx_char(text, suffix, start, null)
/*
* Text modification
@@ -222,7 +222,7 @@
// See bygex.dm
/proc/replace_characters(t, list/repl_chars)
for(var/char in repl_chars)
t = replacetext(t, char, repl_chars[char])
t = replacetext_char(t, char, repl_chars[char])
return t
//Strips the first char and returns it and the new string as a list
@@ -276,7 +276,7 @@
//Returns a string with the first element of the string capitalized.
/proc/capitalize(t as text)
return uppertext(copytext(t, 1, 2)) + copytext(t, 2)
return uppertext(copytext_char(t, 1, 2)) + copytext_char(t, 2)
//Centers text by adding spaces to either side of the string.
/proc/dd_centertext(message, length)
@@ -366,7 +366,7 @@
else
break
if(max_length)
input = copytext(input,1,max_length)
input = copytext_char(input, 1, max_length)
return sanitize(input, allow_lines ? list("\t" = " ") : list("\n" = " ", "\t" = " "))
/proc/trim_strip_html_properly(input, max_length = MAX_MESSAGE_LEN, allow_lines = 0)
+2 -1
View File
@@ -239,6 +239,7 @@
var/html = {"
<html>
<meta charset="UTF-8">
<head>
<title>[title]</title>
<style>
@@ -570,7 +571,7 @@
to_chat(usr, "This can only be used on instances of type /mob")
return
var/new_name = reject_bad_name(sanitize(copytext(input(usr, "What would you like to name this mob?", "Input a name", M.real_name) as text|null, 1, MAX_NAME_LEN)), allow_numbers = TRUE)
var/new_name = reject_bad_name(sanitize(copytext_char(input(usr, "What would you like to name this mob?", "Input a name", M.real_name) as text|null, 1, MAX_NAME_LEN)), allow_numbers = TRUE)
if(!new_name || !M) return
message_admins("Admin [key_name_admin(usr)] renamed [key_name_admin(M)] to [new_name].")
+3 -3
View File
@@ -185,7 +185,7 @@
if(!recipient)
recipient = current
var/list/output = list()
output.Add("<B>[current.real_name]'s Memories:</B><HR>")
output.Add("<meta charset='UTF-8'><b>[current.real_name]'s Memories:</b><hr>")
output.Add(memory)
for(var/datum/antagonist/A in antag_datums)
@@ -524,7 +524,7 @@
alert("Not before round-start!", "Alert")
return
var/list/out = list("<B>[name]</B>[(current && (current.real_name != name))?" (as [current.real_name])" : ""]")
var/list/out = list("<meta charset='UTF-8'><b>[name]</b>[(current && (current.real_name != name))?" (as [current.real_name])" : ""]")
out.Add("Mind currently owned by key: [key] [active ? "(synced)" : "(not synced)"]")
out.Add("Assigned role: [assigned_role]. <a href='?src=[UID()];role_edit=1'>Edit</a>")
out.Add("Factions and special roles:")
@@ -762,7 +762,7 @@
var/datum/objective/escape/escape_with_identity/O = new_objective
O.target_real_name = new_objective.target.current.real_name
if("custom")
var/expl = sanitize(copytext(input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null,1,MAX_MESSAGE_LEN))
var/expl = sanitize(copytext_char(input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null, 1, MAX_MESSAGE_LEN))
if(!expl)
return
new_objective = new /datum/objective
+2 -2
View File
@@ -1236,7 +1236,7 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons)
if(!use_prefix)
default_value = name
else if(findtext(name, prefix) != 0)
default_value = copytext(name, length(prefix) + 1)
default_value = copytext_char(name, length_char(prefix) + 1)
else
// Either the thing has a non-conforming name due to being set in the map
// OR (much more likely) the thing is unlabeled yet.
@@ -1263,7 +1263,7 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons)
return null
t = sanitize(copytext(t, 1, MAX_NAME_LEN))
t = sanitize(copytext_char(t, 1, MAX_NAME_LEN))
// Logging
var/logged_name = initial(name)
+1 -1
View File
@@ -425,7 +425,7 @@
/proc/nukelastname(mob/M as mob) //--All praise goes to NEO|Phyte, all blame goes to DH, and it was Cindi-Kate's idea. Also praise Urist for copypasta ho.
var/randomname = pick(GLOB.last_names)
var/newname = sanitize(copytext(input(M,"You are the nuke operative [pick("Czar", "Boss", "Commander", "Chief", "Kingpin", "Director", "Overlord")]. Please choose a last name for your family.", "Name change",randomname),1,MAX_NAME_LEN))
var/newname = sanitize(copytext_char(input(M,"You are the nuke operative [pick("Czar", "Boss", "Commander", "Chief", "Kingpin", "Director", "Overlord")]. Please choose a last name for your family.", "Name change", randomname), 1, MAX_NAME_LEN))
if(!newname)
newname = randomname
+1 -1
View File
@@ -571,7 +571,7 @@ GLOBAL_LIST_INIT(potential_theft_objectives, (subtypesof(/datum/theft_objective)
if(!steal_target_path)
return
var/theft_objective_name = sanitize(copytext(input("Enter target name:", "Objective target", initial(steal_target_path.name)) as text|null, 1, MAX_NAME_LEN))
var/theft_objective_name = sanitize(copytext_char(input("Enter target name:", "Objective target", initial(steal_target_path.name)) as text|null, 1, MAX_NAME_LEN))
if(!theft_objective_name)
return
+1 -1
View File
@@ -241,7 +241,7 @@ GLOBAL_VAR(scoreboard) // Variable to save the scoreboard string once it's been
// Generate the score panel
var/list/dat = list("<b>Round Statistics and Score</b><br><hr>")
var/list/dat = list("<meta charset='UTF-8'><b>Round Statistics and Score</b><br><hr>")
if(SSticker.mode)
dat += SSticker.mode.get_scoreboard_stats()
+1 -1
View File
@@ -48,7 +48,7 @@
var/wizard_name_first = pick(GLOB.wizard_first)
var/wizard_name_second = pick(GLOB.wizard_second)
var/randomname = "[wizard_name_first] [wizard_name_second]"
var/newname = sanitize(copytext(input(M, "You are the wizard's apprentice. Would you like to change your name to something else?", "Name change", randomname) as null|text,1,MAX_NAME_LEN))
var/newname = sanitize(copytext_char(input(M, "You are the wizard's apprentice. Would you like to change your name to something else?", "Name change", randomname) as null|text, 1, MAX_NAME_LEN))
if(!newname)
newname = randomname
+1 -1
View File
@@ -809,7 +809,7 @@
/obj/item/spellbook/proc/wrap(content)
var/dat = ""
dat +="<html><head><title>Spellbook</title></head>"
dat +="<html><meta charset='utf-8'><head><title>Spellbook</title></head>"
dat += {"
<head>
<style type="text/css">
+1 -1
View File
@@ -87,7 +87,7 @@
var/wizard_name_first = pick(GLOB.wizard_first)
var/wizard_name_second = pick(GLOB.wizard_second)
var/randomname = "[wizard_name_first] [wizard_name_second]"
var/newname = sanitize(copytext(input(wizard_mob, "You are the Space Wizard. Would you like to change your name to something else?", "Name change", randomname) as null|text,1,MAX_NAME_LEN))
var/newname = sanitize(copytext_char(input(wizard_mob, "You are the Space Wizard. Would you like to change your name to something else?", "Name change", randomname) as null|text, 1, MAX_NAME_LEN))
if(!newname)
newname = randomname
+2 -2
View File
@@ -52,10 +52,10 @@ GLOBAL_LIST_INIT(role_playtime_requirements, list(
if(!check_rights(R_ADMIN|R_MOD|R_MENTOR))
return
var/list/msg = list()
msg += "<html><head><title>Playtime Report</title></head><body>"
msg += "<html><meta charset='utf-8'><head><title>Playtime Report</title></head><body>"
var/datum/job/theirjob
var/jtext
msg += "<TABLE border ='1'><TR><TH>Player</TH><TH>Job</TH><TH>Crew</TH>"
msg += "<table border ='1'><tr><th>Player</th><th>Job</th><th>Crew</th>"
for(var/thisdept in EXP_DEPT_TYPE_LIST)
msg += "<TH>[thisdept]</TH>"
msg += "</TR>"
+2 -2
View File
@@ -180,10 +180,10 @@
to_chat(AI, "<b>[U]</b> holds <a href='?_src_=usr;show_paper=1;'>\a [itemname]</a> up to one of your cameras ...")
else
to_chat(AI, "<b><a href='?src=[AI.UID()];track=[html_encode(U.name)]'>[U]</a></b> holds <a href='?_src_=usr;show_paper=1;'>\a [itemname]</a> up to one of your cameras ...")
AI.last_paper_seen = "<HTML><HEAD><TITLE>[itemname]</TITLE></HEAD><BODY><TT>[info]</TT></BODY></HTML>"
AI.last_paper_seen = "<html><meta charset='utf-8'><head><title>[itemname]</title></head><body><tt>[info]</tt></body></html>"
else if(O.client && O.client.eye == src)
to_chat(O, "[U] holds \a [itemname] up to one of the cameras ...")
O << browse("<HTML><HEAD><TITLE>[itemname]</TITLE></HEAD><BODY><TT>[info]</TT></BODY></HTML>", "window=[itemname]")
O << browse("<html><meta charset='utf-8'><head><title>[itemname]</title></head><body><tt>[info]</tt></body></html>", "window=[itemname]")
else if(istype(I, /obj/item/laser_pointer))
var/obj/item/laser_pointer/L = I
+4 -4
View File
@@ -485,7 +485,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
if(!job_in_department(SSjobs.GetJob(t1)))
return FALSE
if(t1 == "Custom")
var/temp_t = sanitize(reject_bad_name(copytext(input("Enter a custom job assignment.", "Assignment"), 1, MAX_MESSAGE_LEN), TRUE))
var/temp_t = sanitize(reject_bad_name(copytext_char(input("Enter a custom job assignment.", "Assignment"), 1, MAX_MESSAGE_LEN), TRUE))
//let custom jobs function as an impromptu alt title, mainly for sechuds
if(temp_t && scan && modify)
var/oldrank = modify.getRankAndAssignment()
@@ -543,7 +543,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
playsound(get_turf(src), 'sound/machines/buzz-sigh.ogg', 50, 0)
visible_message("<span class='warning'>[src]: Heads may only demote members of their own department.</span>")
return FALSE
var/reason = sanitize(copytext(input("Enter legal reason for demotion. Enter nothing to cancel.","Legal Demotion"), 1, MAX_MESSAGE_LEN))
var/reason = sanitize(copytext_char(input("Enter legal reason for demotion. Enter nothing to cancel.","Legal Demotion"), 1, MAX_MESSAGE_LEN))
if(!reason || !is_authenticated(usr) || !modify)
return FALSE
var/list/access = list()
@@ -570,7 +570,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
visible_message("<span class='warning'>[src]: Only the Captain or HOP may completely terminate the employment of a crew member.</span>")
return FALSE
var/jobnamedata = modify.getRankAndAssignment()
var/reason = sanitize(copytext(input("Enter legal reason for termination. Enter nothing to cancel.", "Employment Termination"), 1, MAX_MESSAGE_LEN))
var/reason = sanitize(copytext_char(input("Enter legal reason for termination. Enter nothing to cancel.", "Employment Termination"), 1, MAX_MESSAGE_LEN))
if(!reason || !has_idchange_access() || !modify)
return FALSE
var/m_ckey = modify.getPlayerCkey()
@@ -627,7 +627,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
message_admins("[key_name_admin(usr)] has closed a job slot for job \"[j.title]\".")
return
if("remote_demote")
var/reason = sanitize(copytext(input("Enter legal reason for demotion. Enter nothing to cancel.","Legal Demotion"), 1, MAX_MESSAGE_LEN))
var/reason = sanitize(copytext_char(input("Enter legal reason for demotion. Enter nothing to cancel.","Legal Demotion"), 1, MAX_MESSAGE_LEN))
if(!reason || !is_authenticated(usr) || !scan)
return FALSE
for(var/datum/data/record/E in GLOB.data_core.general)
+1 -1
View File
@@ -963,7 +963,7 @@ GLOBAL_LIST_EMPTY(turret_icons)
if(is_pen(I)) //you can rename turrets like bots!
var/t = input(user, "Enter new turret name", name, finish_name) as text
t = sanitize(copytext(t, 1, MAX_MESSAGE_LEN))
t = sanitize(copytext_char(t, 1, MAX_MESSAGE_LEN))
if(!t)
return
if(!in_range(src, usr) && loc != usr)
+6 -6
View File
@@ -96,21 +96,21 @@
var/dat
dat = "Power cell: "
if(cell)
dat += "<A href='byond://?src=[UID()];op=cellremove'>Installed</A><BR>"
dat += "<a href='byond://?src=[UID()];op=cellremove'>Installed</a><br>"
else
dat += "<A href='byond://?src=[UID()];op=cellinstall'>Removed</A><BR>"
dat += "<a href='byond://?src=[UID()];op=cellinstall'>Removed</a><br>"
dat += "Power Level: [cell ? round(cell.percent(),1) : 0]%<BR><BR>"
dat += "Power Level: [cell ? round(cell.percent(),1) : 0]%<br><br>"
dat += "Set Temperature: "
dat += "<A href='?src=[UID()];op=temp;val=-5'>-</A>"
dat += "<a href='?src=[UID()];op=temp;val=-5'>-</a>"
dat += " [set_temperature]&deg;C "
dat += "<A href='?src=[UID()];op=temp;val=5'>+</A><BR>"
dat += "<a href='?src=[UID()];op=temp;val=5'>+</a><br>"
user.set_machine(src)
user << browse("<HEAD><TITLE>Space Heater Control Panel</TITLE></HEAD><TT>[dat]</TT>", "window=spaceheater")
user << browse("<meta charset='utf-8'><head><title>Space Heater Control Panel Панель</title></head><tt>[dat]</tt>", "window=spaceheater")
onclose(user, "spaceheater")
else
+6 -6
View File
@@ -124,8 +124,8 @@ GLOBAL_LIST_EMPTY(status_displays)
line1 = message1
else
line1 = copytext("[message1]|[message1]", index1, index1 + DISPLAY_CHARS_PER_LINE)
var/message1_len = length(message1)
line1 = copytext_char("[message1]|[message1]", index1, index1 + DISPLAY_CHARS_PER_LINE)
var/message1_len = length_char(message1)
index1 += DISPLAY_SCROLL_SPEED
if(index1 > message1_len)
@@ -136,8 +136,8 @@ GLOBAL_LIST_EMPTY(status_displays)
line2 = message2
else
line2 = copytext("[message2]|[message2]", index2, index2 + DISPLAY_CHARS_PER_LINE)
var/message2_len = length(message2)
line2 = copytext_char("[message2]|[message2]", index2, index2 + DISPLAY_CHARS_PER_LINE)
var/message2_len = length_char(message2)
index2 += DISPLAY_SCROLL_SPEED
if(index2 > message2_len)
@@ -168,14 +168,14 @@ GLOBAL_LIST_EMPTY(status_displays)
/obj/machinery/status_display/proc/set_message(m1, m2)
if(m1)
index1 = (length(m1) > DISPLAY_CHARS_PER_LINE)
index1 = (length_char(m1) > DISPLAY_CHARS_PER_LINE)
message1 = m1
else
message1 = ""
index1 = 0
if(m2)
index2 = (length(m2) > DISPLAY_CHARS_PER_LINE)
index2 = (length_char(m2) > DISPLAY_CHARS_PER_LINE)
message2 = m2
else
message2 = ""
+1 -1
View File
@@ -53,7 +53,7 @@
return output
/obj/mecha/combat/honker/get_stats_html()
var/output = {"<html>
var/output = {"<html><meta charset='utf-8'>
<head><title>[name] data</title>
<style>
body {color: #00ff00; background: #32CD32; font-family:"Courier",monospace; font-size: 12px;}
@@ -124,7 +124,7 @@
/obj/item/mecha_parts/mecha_equipment/medical/sleeper/proc/get_patient_stats()
if(!patient)
return
return {"<html>
return {"<html><meta charset='utf-8'>
<head>
<title>[patient] statistics</title>
<script language='javascript' type='text/javascript'>
@@ -383,7 +383,7 @@
return
/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/proc/get_reagents_page()
var/output = {"<html>
var/output = {"<html><meta charset='utf-8'>
<head>
<title>Reagent Synthesizer</title>
<script language='javascript' type='text/javascript'>
+4 -4
View File
@@ -4,7 +4,7 @@
////////////////////////////////////
/obj/mecha/proc/get_stats_html()
var/output = {"<html>
var/output = {"<html><meta charset='utf-8'>
<head><title>[name] data</title>
<style>
body {color: #00ff00; background: #000000; font-family:"Lucida Console",monospace; font-size: 12px;}
@@ -150,7 +150,7 @@
/obj/mecha/proc/get_log_html()
var/output = "<html><head><title>[name] Log</title></head><body style='font: 13px 'Courier', monospace;'>"
var/output = "<html><meta charset='utf-8'><head><title>[name] Log</title></head><body style='font: 13px 'Courier', monospace;'>"
for(var/list/entry in log)
output += {"<div style='font-weight: bold;'>[time2text(entry["time"],"DDD MMM DD hh:mm:ss")] 2555</div>
<div style='margin-left:15px; margin-bottom:10px;'>[entry["message"]]</div>
@@ -169,7 +169,7 @@
/obj/mecha/proc/output_access_dialog(obj/item/card/id/id_card, mob/user)
if(!id_card || !user) return
var/output = {"<html>
var/output = {"<html><meta charset='utf-8'>
<head><style>
h1 {font-size:15px;margin-bottom:4px;}
body {color: #00ff00; background: #000000; font-family:"Courier New", Courier, monospace; font-size: 12px;}
@@ -199,7 +199,7 @@
/obj/mecha/proc/output_maintenance_dialog(obj/item/card/id/id_card,mob/user)
if(!id_card || !user) return
var/output = {"<html>
var/output = {"<html><meta charset='utf-8'>
<head>
<style>
body {color: #00ff00; background: #000000; font-family:"Courier New", Courier, monospace; font-size: 12px;}
+1 -1
View File
@@ -23,7 +23,7 @@
/obj/item/areaeditor/attack_self(mob/user as mob)
add_fingerprint(user)
var/text = "<BODY><HTML><head><title>[src]</title></head> \
var/text = "<BODY><HTML><meta charset='utf-8'><head><title>[src]</title></head> \
<h2>[station_name()] [src.name]</h2> \
<small>[fluffnotice]</small><hr>"
switch(get_area_type())
+1 -1
View File
@@ -36,7 +36,7 @@
user.set_machine(src)
var/dat = {"
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
<html>
<html><meta charset='utf-8'>
<head>
<style>
body {
@@ -40,7 +40,7 @@
to_chat(user, "<span class='notice'>You are now mimicking the voice on your ID card.</span>")
return
voice = sanitize(copytext(chosen_voice, 1, MAX_MESSAGE_LEN))
voice = sanitize(copytext_char(chosen_voice, 1, MAX_MESSAGE_LEN))
to_chat(user, "<span class='notice'>You are now mimicking <b>[voice]</b>.</span>")
/obj/item/voice_changer/voice_modulator
+1 -1
View File
@@ -360,7 +360,7 @@
var/answer = params["answer"]
if(!answer)
return
door_name = sanitize(copytext(answer, 1, UI_MODAL_INPUT_MAX_LENGTH_NAME))
door_name = sanitize(copytext_char(answer, 1, UI_MODAL_INPUT_MAX_LENGTH_NAME))
else
return FALSE
+12 -12
View File
@@ -34,7 +34,7 @@
icon_state ="bookDetective"
author = "Nanotrasen"
title = "The Film Noir: Proper Procedures for Investigations"
pages = list({"<html>
pages = list({"<html><meta charset='utf-8'>
<head>
<style>
h1 {font-size: 18px; margin: 15px 0px 5px;}
@@ -75,7 +75,7 @@
author = "Engineering Encyclopedia"
title = "Particle Accelerator User's Guide"
pages = list({"<html>
pages = list({"<html><meta charset='utf-8'>
<head>
<style>
h1 {font-size: 18px; margin: 15px 0px 5px;}
@@ -158,7 +158,7 @@
icon_state = "pipingbook"
author = "Maria Crash, Senior Atmospherics Technician"
title = "Pipes and You: Getting To Know Your Scary Tools"
pages = list({"<html>
pages = list({"<html><meta charset='utf-8'>
<head>
<style>
h1 {font-size: 18px; margin: 15px 0px 5px;}
@@ -245,7 +245,7 @@
icon_state = "evabook"
author = "Maria Crash, Senior Atmospherics Technician"
title = "EVA Gear and You: Not Spending All Day Inside"
pages = list({"<html>
pages = list({"<html><meta charset='utf-8'>
<head>
<style>
h1 {font-size: 18px; margin: 15px 0px 5px;}
@@ -306,7 +306,7 @@
author = "Engineering Encyclopedia"
title = "Singularity Safety in Special Circumstances"
pages = list({"<html>
pages = list({"<html><meta charset='utf-8'>
<head>
<style>
h1 {font-size: 18px; margin: 15px 0px 5px;}
@@ -354,7 +354,7 @@
author = "Medical Journal, volume 3"
title = "Cloning techniques of the 26th century"
pages = list({"<html>
pages = list({"<html><meta charset='utf-8'>
<head>
<style>
h1 {font-size: 18px; margin: 15px 0px 5px;}
@@ -431,7 +431,7 @@
author = "Weyland-Yutani Corp"
title = "APLU \"Ripley\" Construction and Operation Manual"
pages = list({"<html>
pages = list({"<html><meta charset='utf-8'>
<head>
<style>
h1 {font-size: 18px; margin: 15px 0px 5px;}
@@ -506,7 +506,7 @@
author = "Dr. L. Ight"
title = "Research and Development 101"
pages = list({"
<html>
<html><meta charset='utf-8'>
<head>
<style>
h1 {font-size: 18px; margin: 15px 0px 5px;}
@@ -556,7 +556,7 @@
icon_state = "barbook"
author = "Sir John Rose"
title = "Barman Recipes"
pages = list({"<html>
pages = list({"<html><meta charset='utf-8'>
<head>
<style>
h1 {font-size: 18px; margin: 15px 0px 5px;}
@@ -600,7 +600,7 @@
author = "Syndicate"
protected = TRUE
title = "Fission Mailed: Nuclear Sabotage 101"
pages = list({"<html>
pages = list({"<html><meta charset='utf-8'>
Nuclear Explosives 101:<br>
Hello and thank you for choosing the Syndicate for your nuclear information needs.<br>
Today's crash course will deal with the operation of a Fusion Class Nanotrasen made Nuclear Device.<br>
@@ -636,7 +636,7 @@
icon_state ="bookHydroponicsPodPeople"
author = "Farmer John"
title = "The Human Harvest - From seed to market"
pages = list({"<html>
pages = list({"<html><meta charset='utf-8'>
<head>
<style>
h1 {font-size: 18px; margin: 15px 0px 5px;}
@@ -692,7 +692,7 @@
/obj/item/book/manual/wiki/Initialize()
. = ..()
pages = list({"
<html><head></head><body bgcolor='[book_bgcolor]'>
<html><meta charset='utf-8'><head></head><body bgcolor='[book_bgcolor]'>
<iframe width='100%' height='97%' src="[GLOB.configuration.url.wiki_url]/index.php/[wiki_article_title]?action=render" frameborder="0" id="main_frame"></iframe>
</body></html>"})
+3 -3
View File
@@ -34,10 +34,10 @@
return ..()
/obj/structure/noticeboard/attack_hand(user as mob)
var/dat = "<B>Noticeboard</B><BR>"
var/dat = "<b>Noticeboard</b><br>"
for(var/obj/item/paper/P in src)
dat += "<A href='?src=[UID()];read=\ref[P]'>[P.name]</A> <A href='?src=[UID()];write=\ref[P]'>Write</A> <A href='?src=[UID()];remove=\ref[P]'>Remove</A><BR>"
user << browse("<HEAD><TITLE>Notices</TITLE></HEAD>[dat]","window=noticeboard")
dat += "<a href='?src=[UID()];read=\ref[P]'>[P.name]</a> <a href='?src=[UID()];write=\ref[P]'>Write</a> <a href='?src=[UID()];remove=\ref[P]'>Remove</a><br>"
user << browse("<meta charset='utf-8'><head><title>Notices Записки</title></head>[dat]","window=noticeboard")
onclose(user, "noticeboard")
/obj/structure/noticeboard/deconstruct(disassembled = TRUE)
+2 -2
View File
@@ -30,7 +30,7 @@ GLOBAL_VAR_INIT(admin_ooc_colour, "#b82e00")
if(!msg)
msg = typing_input(src.mob, "", "ooc \"text\"")
msg = trim(sanitize(copytext(msg, 1, MAX_MESSAGE_LEN)))
msg = trim(sanitize(copytext_char(msg, 1, MAX_MESSAGE_LEN)))
if(!msg)
return
@@ -186,7 +186,7 @@ GLOBAL_VAR_INIT(admin_ooc_colour, "#b82e00")
if(!msg)
msg = typing_input(src.mob, "Local OOC, seen only by those in view.", "looc \"text\"")
msg = trim(sanitize(copytext(msg, 1, MAX_MESSAGE_LEN)))
msg = trim(sanitize(copytext_char(msg, 1, MAX_MESSAGE_LEN)))
if(!msg)
return
+2 -2
View File
@@ -77,7 +77,7 @@ GLOBAL_VAR_INIT(nologevent, 0)
if(!check_rights(R_ADMIN|R_MOD))
return
var/body = "<html><head><title>Options for [M.key]</title></head>"
var/body = "<html><meta charset='UTF-8'><head><title>Options for [M.key]</title></head>"
body += "<body>Options panel for <b>[M]</b>"
if(M.client)
body += " played by <b>[M.client]</b> "
@@ -390,7 +390,7 @@ GLOBAL_VAR_INIT(nologevent, 0)
set desc = "Instantly ends the round and brings up the scoreboard, in the same way that wizards dying do."
if(!check_rights(R_SERVER))
return
var/input = sanitize(copytext(input(usr, "What text should players see announcing the round end? Input nothing to cancel.", "Specify Announcement Text", "Shift Has Ended!"), 1, MAX_MESSAGE_LEN))
var/input = sanitize(copytext_char(input(usr, "What text should players see announcing the round end? Input nothing to cancel.", "Specify Announcement Text", "Shift Has Ended!"), 1, MAX_MESSAGE_LEN))
if(!input)
return
+1 -1
View File
@@ -108,7 +108,7 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits
pda_select += "</select>"
var/dat = {"
<html><head><title>Create Outfit</title></head><body>
<html><meta charset='utf-8'><head><title>Create Outfit</title></head><body>
<form name="outfit" action="byond://?src=[UID()];" method="get">
<input type="hidden" name="src" value="[UID()]">
<input type="hidden" name="create_outfit_finalize" value="1">
@@ -14,7 +14,7 @@
permissions_asset.send(usr)
var/output = {"<!DOCTYPE html>
<html>
<html><meta charset='utf-8'>
<head>
<title>Permissions Panel</title>
<script type='text/javascript' src='[SSassets.transport.get_asset_url("search.js")]'></script>
+5 -5
View File
@@ -6,7 +6,7 @@
if(!check_rights(R_ADMIN))
message_admins("[key_name_admin(usr)] attempted to invoke player panel without admin rights. If this is a mentor, its a chance they accidentally hit F7. If this is NOT a mentor, there is a high chance an exploit is being used")
return
var/dat = "<html><head><title>Admin Player Panel</title></head>"
var/dat = "<html><meta charset='utf-8'><head><title>Admin Player Panel</title></head>"
//javascript, the part that does most of the work~
dat += {"
@@ -349,10 +349,10 @@
if(!check_rights(R_ADMIN))
return
if(SSticker && SSticker.current_state >= GAME_STATE_PLAYING)
var/dat = "<html><head><title>Round Status</title></head><body><h1><B>Round Status</B></h1>"
dat += "Current Game Mode: <B>[SSticker.mode.name]</B><BR>"
dat += "Round Duration: <B>[round(ROUND_TIME / 36000)]:[add_zero(num2text(ROUND_TIME / 600 % 60), 2)]:[add_zero(num2text(ROUND_TIME / 10 % 60), 2)]</B><BR>"
dat += "<B>Emergency shuttle</B><BR>"
var/dat = "<html><meta charset='utf-8'><head><title>Round Status</title></head><body><h1><b>Round Status</b></h1>"
dat += "Current Game Mode: <b>[SSticker.mode.name]</b><br>"
dat += "Round Duration: <b>[round(ROUND_TIME / 36000)]:[add_zero(num2text(ROUND_TIME / 600 % 60), 2)]:[add_zero(num2text(ROUND_TIME / 10 % 60), 2)]</b><br>"
dat += "<b>Emergency shuttle</b><br>"
if(SSshuttle.emergency.mode < SHUTTLE_CALL)
dat += "<a href='?src=[UID()];call_shuttle=1'>Call Shuttle</a><br>"
else
+1 -1
View File
@@ -5,7 +5,7 @@
if(!check_rights(0)) return
var/dat = "<html><body><center>"
var/dat = "<html><meta charset='utf-8'><body><center>"
dat += "<a href='?src=[UID()];secretsmenu=tab;tab=0' [current_tab == 0 ? "class='linkOn'" : ""]>Debug</a>"
dat += "<a href='?src=[UID()];secretsmenu=tab;tab=1' [current_tab == 1 ? "class='linkOn'" : ""]>IC Events</a>"
+1 -1
View File
@@ -179,7 +179,7 @@
var/navbar
var/ruler
ruler = "<hr style='background:#000000; border:0; height:3px'>"
navbar = "<a href='?_src_=holder;nonalpha=1'>\[All\]</a>|<a href='?_src_=holder;nonalpha=2'>\[#\]</a>"
navbar = "<meta charset='UTF-8'><a href='?_src_=holder;nonalpha=1'>\[All\]</a>|<a href='?_src_=holder;nonalpha=2'>\[#\]</a>"
for(var/letter in GLOB.alphabet)
navbar += "|<a href='?_src_=holder;shownote=[letter]'>\[[letter]\]</a>"
navbar += "<br><form method='GET' name='search' action='?'>\
+5 -5
View File
@@ -1072,9 +1072,9 @@
var/painame = "Default"
var/name = ""
if(alert(usr, "Do you want to set their name or let them choose their own name?", "Name Choice", "Set Name", "Let them choose") == "Set Name")
name = sanitize(copytext(input(usr, "Enter a name for the new pAI. Default name is [painame].", "pAI Name", painame),1,MAX_NAME_LEN))
name = sanitize(copytext_char(input(usr, "Enter a name for the new pAI. Default name is [painame].", "pAI Name", painame), 1, MAX_NAME_LEN))
else
name = sanitize(copytext(input(H, "An admin wants to make you into a pAI. Choose a name. Default is [painame].", "pAI Name", painame),1,MAX_NAME_LEN))
name = sanitize(copytext_char(input(H, "An admin wants to make you into a pAI. Choose a name. Default is [painame].", "pAI Name", painame), 1, MAX_NAME_LEN))
if(!name)
name = painame
@@ -2017,7 +2017,7 @@
D.assignment = "Pet"
C.access_id = D
spawn(30)
var/newname = sanitize(copytext(input(P, "You are [P], special event pet of [H]. Change your name to something else?", "Name change", P.name) as null|text,1,MAX_NAME_LEN))
var/newname = sanitize(copytext_char(input(P, "You are [P], special event pet of [H]. Change your name to something else?", "Name change", P.name) as null|text, 1, MAX_NAME_LEN))
if(newname && newname != P.name)
P.name = newname
if(P.mind)
@@ -2950,7 +2950,7 @@
return
if(alert(usr, "Are you sure you want to do this?", "Confirmation", "Yes", "No") != "Yes")
return
var/objective = sanitize(copytext(input("Enter an objective"),1,MAX_MESSAGE_LEN))
var/objective = sanitize(copytext_char(input("Enter an objective"), 1, MAX_MESSAGE_LEN))
if(!objective)
return
SSblackbox.record_feedback("tally", "admin_secrets_fun_used", 1, "Traitor All ([objective])")
@@ -3345,7 +3345,7 @@
if(!check_rights(R_ADMIN))
return
var/text = html_decode(href_list["showdetails"])
usr << browse("<HTML><HEAD><TITLE>Details</TITLE></HEAD><BODY><TT>[replacetext(text, "\n", "<BR>")]</TT></BODY></HTML>",
usr << browse("<html><meta charset='utf-8'><head><title>Details</title></head><body><tt>[replacetext(text, "\n", "<BR>")]</tt></body></html>",
"window=show_details;size=500x200")
else if(href_list["create_outfit_finalize"])
+1 -1
View File
@@ -21,7 +21,7 @@
if(handle_spam_prevention(msg, MUTE_ADMINHELP, OOC_COOLDOWN))
return
msg = sanitize_simple(copytext(msg, 1, MAX_MESSAGE_LEN))
msg = sanitize_simple(copytext_char(msg, 1, MAX_MESSAGE_LEN))
if(!msg) // No message after sanitisation
return
+1 -1
View File
@@ -106,7 +106,7 @@
//clean the message if it's not sent by a high-rank admin
if(!check_rights(R_SERVER|R_DEBUG,0))
msg = sanitize_simple(copytext(msg,1,MAX_MESSAGE_LEN))
msg = sanitize_simple(copytext_char(msg, 1, MAX_MESSAGE_LEN))
if(!msg)
return
else
+2 -2
View File
@@ -3,7 +3,7 @@
set hidden = 1
if(!check_rights(R_ADMIN)) return
msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
msg = sanitize(copytext_char(msg, 1, MAX_MESSAGE_LEN))
if(!msg) return
var/datum/asays/asay = new(usr.ckey, usr.client.holder.rank, msg, world.timeofday)
@@ -60,7 +60,7 @@
else if(!check_rights(R_ADMIN|R_MOD)) // Catch any other non-admins trying to use this proc
return
msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
msg = sanitize(copytext_char(msg, 1, MAX_MESSAGE_LEN))
log_mentorsay(msg, src)
mob.create_log(OOC_LOG, "MSAY: [msg]")
+1 -1
View File
@@ -31,7 +31,7 @@
if(check_rights(R_ADMIN, 0))
stafftype = "ADMIN"
msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
msg = sanitize(copytext_char(msg, 1, MAX_MESSAGE_LEN))
log_admin("[key_name(src)] : [msg]")
if(!msg)
+1 -1
View File
@@ -19,7 +19,7 @@ GLOBAL_VAR_INIT(deathsquad_sent, FALSE)
log_admin("[key_name_admin(proccaller)] has started to spawn a DeathSquad.")
to_chat(proccaller, "<span class='boldwarning'>This 'mode' will go on until everyone is dead or the station is destroyed. You may also admin-call the evac shuttle or use the end round verb when appropriate. Spawned commandos have internals cameras which are viewable through a monitor inside the Spec. Ops. Office. The first one selected will be the team leader.</span>")
var/mission = sanitize(copytext(input(src, "Please specify which mission the Deathsquad shall undertake.", "Specify Mission", "",), 1, MAX_MESSAGE_LEN))
var/mission = sanitize(copytext_char(input(src, "Please specify which mission the Deathsquad shall undertake.", "Specify Mission", "",), 1, MAX_MESSAGE_LEN))
if(!mission)
if(alert("Error, no mission set. Do you want to exit the setup process?",, "Yes", "No") == "Yes")
message_admins("[key_name_admin(proccaller)] cancelled their Deathsquad.")
+1 -1
View File
@@ -23,7 +23,7 @@
return
var/themission = null
while(!themission)
themission = sanitize(copytext(input(src, "Please specify a briefing message for the team.", "Specify Mission", ""),1,MAX_MESSAGE_LEN))
themission = sanitize(copytext_char(input(src, "Please specify a briefing message for the team.", "Specify Mission", ""), 1, MAX_MESSAGE_LEN))
if(!themission)
alert("No mission specified. Aborting.")
return
@@ -28,7 +28,7 @@ GLOBAL_VAR_INIT(sent_syndicate_infiltration_team, 0)
return
var/input = null
while(!input)
input = sanitize(copytext(input(src, "Please specify which mission the syndicate infiltration team shall undertake.", "Specify Mission", ""),1,MAX_MESSAGE_LEN))
input = sanitize(copytext_char(input(src, "Please specify which mission the syndicate infiltration team shall undertake.", "Specify Mission", ""), 1, MAX_MESSAGE_LEN))
if(!input)
alert("No mission specified. Aborting.")
return
+1 -1
View File
@@ -6,7 +6,7 @@
return
var/msg = input(src, "What message do you want the ping to show?", "Ping all admins") as text|null
msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
msg = sanitize(copytext_char(msg, 1, MAX_MESSAGE_LEN))
if(!msg)
return
+4 -4
View File
@@ -2,7 +2,7 @@
set category = "IC"
set name = "Pray"
msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
msg = sanitize(copytext_char(msg, 1, MAX_MESSAGE_LEN))
if(!msg)
return
@@ -42,7 +42,7 @@
SSblackbox.record_feedback("tally", "admin_verb", 1, "Pray") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/proc/Centcomm_announce(text, mob/Sender)
var/msg = sanitize(copytext(text, 1, MAX_MESSAGE_LEN))
var/msg = sanitize(copytext_char(text, 1, MAX_MESSAGE_LEN))
msg = "<span class='boldnotice'><font color=orange>CENTCOMM: </font>[key_name(Sender, 1)] ([ADMIN_PP(Sender,"PP")]) ([ADMIN_VV(Sender,"VV")]) ([ADMIN_TP(Sender,"TP")]) ([ADMIN_SM(Sender,"SM")]) ([admin_jump_link(Sender)]) ([ADMIN_BSA(Sender,"BSA")]) ([ADMIN_CENTCOM_REPLY(Sender,"RPLY")])):</span> [msg]"
for(var/client/X in GLOB.admins)
if(R_EVENT & X.holder.rights)
@@ -51,7 +51,7 @@
SEND_SOUND(X, sound('sound/effects/adminhelp.ogg'))
/proc/Syndicate_announce(text, mob/Sender)
var/msg = sanitize(copytext(text, 1, MAX_MESSAGE_LEN))
var/msg = sanitize(copytext_char(text, 1, MAX_MESSAGE_LEN))
msg = "<span class='boldnotice'><font color='#DC143C'>SYNDICATE: </font>[key_name(Sender, 1)] ([ADMIN_PP(Sender,"PP")]) ([ADMIN_VV(Sender,"VV")]) ([ADMIN_TP(Sender,"TP")]) ([ADMIN_SM(Sender,"SM")]) ([admin_jump_link(Sender)]) ([ADMIN_BSA(Sender,"BSA")]) ([ADMIN_SYNDICATE_REPLY(Sender,"RPLY")]):</span> [msg]"
for(var/client/X in GLOB.admins)
if(check_rights(R_EVENT,0,X.mob))
@@ -79,7 +79,7 @@
/proc/Nuke_request(text , mob/Sender)
var/nuke_code = get_nuke_code()
var/nuke_status = get_nuke_status()
var/msg = sanitize(copytext(text, 1, MAX_MESSAGE_LEN))
var/msg = sanitize(copytext_char(text, 1, MAX_MESSAGE_LEN))
msg = "<span class='adminnotice'><b><font color=orange>NUKE CODE REQUEST: </font>[key_name(Sender)] ([ADMIN_PP(Sender,"PP")]) ([ADMIN_VV(Sender,"VV")]) ([ADMIN_TP(Sender,"TP")]) ([ADMIN_SM(Sender,"SM")]) ([admin_jump_link(Sender)]) ([ADMIN_BSA(Sender,"BSA")]) ([ADMIN_CENTCOM_REPLY(Sender,"RPLY")]):</b> [msg]</span>"
for(var/client/X in GLOB.admins)
if(check_rights(R_EVENT,0,X.mob))
+3 -3
View File
@@ -1003,9 +1003,9 @@ Traitors and the like can also be revived with the previous role mostly intact.
return
/* ======== SSD Section ========= */
var/msg = "<html><head><title>SSD & AFK Report</title></head><body>"
msg += "SSD Players:<BR><TABLE border='1'>"
msg += "<TR><TD><B>Key</B></TD><TD><B>Real Name</B></TD><TD><B>Job</B></TD><TD><B>Mins SSD</B></TD><TD><B>Special Role</B></TD><TD><B>Area</B></TD><TD><B>PPN</B></TD><TD><B>Cryo</B></TD></TR>"
var/msg = "<html><meta charset='utf-8'><head><title>SSD & AFK Report</title></head><body>"
msg += "SSD Players:<br><TABLE border='1'>"
msg += "<tr><td><b>Key</b></td><td><b>Real Name</b></td><td><b>Job</b></td><td><b>Mins SSD</b></td><td><b>Special Role</b></td><td><b>Area</b></td><td><b>PPN</b></td><td><b>Cryo</b></td></tr>"
var/mins_ssd
var/job_string
var/key_string
@@ -23,7 +23,7 @@ GLOBAL_VAR_INIT(sent_syndicate_strike_team, 0)
var/input = null
while(!input)
input = sanitize(copytext(input(src, "Please specify which mission the syndicate strike team shall undertake.", "Specify Mission", ""),1,MAX_MESSAGE_LEN))
input = sanitize(copytext_char(input(src, "Please specify which mission the syndicate strike team shall undertake.", "Specify Mission", ""),1,MAX_MESSAGE_LEN))
if(!input)
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return
+1 -1
View File
@@ -72,7 +72,7 @@
return
var/dat = {"
<html>
<html><meta charset='utf-8'>
<head>
<title>Arcade Ticket Exchange</title>
<style type="text/css">
@@ -31,7 +31,7 @@
return
src.add_fingerprint(usr)
var/dat = {"
<html>
<html><meta charset='utf-8'>
<head>
<style type="text/css">
a.green:link
+3 -3
View File
@@ -1654,21 +1654,21 @@
if(length(med_record) <= 40)
HTML += "[med_record]"
else
HTML += "[copytext(med_record, 1, 37)]..."
HTML += "[copytext_char(med_record, 1, 37)]..."
HTML += "<br><a href=\"byond://?_src_=prefs;preference=records;task=gen_record\">Employment Records</a><br>"
if(length(gen_record) <= 40)
HTML += "[gen_record]"
else
HTML += "[copytext(gen_record, 1, 37)]..."
HTML += "[copytext_char(gen_record, 1, 37)]..."
HTML += "<br><a href=\"byond://?_src_=prefs;preference=records;task=sec_record\">Security Records</a><br>"
if(length(sec_record) <= 40)
HTML += "[sec_record]<br>"
else
HTML += "[copytext(sec_record, 1, 37)]...<br>"
HTML += "[copytext_char(sec_record, 1, 37)]...<br>"
HTML += "<a href=\"byond://?_src_=prefs;preference=records;records=-1\">\[Done\]</a>"
HTML += "</center></tt>"
+1 -1
View File
@@ -159,7 +159,7 @@
* buttons and then builds the rest of the UI based on what page the player is turned to.
*/
/obj/item/book/proc/show_content(mob/user)
var/dat = ""
var/dat = "<meta charset='utf-8'>"
//First, we're going to choose/generate our header buttons for switching pages and store it in var/dat
var/header_left = "<div style='float:left; text-align:left; width:49.9%'></div>"
var/header_right = "<div style ='float;left; text-align:right; width:49.9%'></div>"
@@ -1,5 +1,5 @@
/mob/dead/observer/say(message)
message = sanitize(copytext(message, 1, MAX_MESSAGE_LEN))
message = sanitize(copytext_char(message, 1, MAX_MESSAGE_LEN))
if(!message)
return
+5 -5
View File
@@ -76,11 +76,11 @@
. = list()
while(length(message))
while(length_char(message))
var/min_index = 10000 // if the message is longer than this, the autohiss is the least of your problems
var/min_char = null
for(var/char in map)
var/i = findtext(message, char)
var/i = findtext_char(message, char)
if(!i) // no more of this character anywhere in the string, don't even bother searching next time
map -= char
else if(i < min_index)
@@ -89,12 +89,12 @@
if(!min_char) // we didn't find any of the mapping characters
. += message
break
. += copytext(message, 1, min_index)
if(copytext(message, min_index, min_index + 1) == uppertext(min_char))
. += copytext_char(message, 1, min_index)
if(copytext_char(message, min_index, min_index + 1) == uppertext(min_char))
. += uppertext(pick(map[min_char]))
else
. += pick(map[min_char])
message = copytext(message, min_index + 1)
message = copytext_char(message, min_index + 1)
return jointext(., "")
+2 -2
View File
@@ -130,9 +130,9 @@ GLOBAL_LIST_EMPTY(channel_to_radio_key)
//parse the radio code and consume it
if(message_mode)
if(message_mode == "headset")
message = copytext(message, 2) //it would be really nice if the parse procs could do this for us.
message = copytext_char(message, 2) //it would be really nice if the parse procs could do this for us.
else
message = copytext(message, 3)
message = copytext_char(message, 3)
message = trim_left(message)
@@ -518,7 +518,7 @@
/mob/living/silicon/proc/place_on_head(obj/item/item_to_add, mob/user)
if(flags_2 & HOLOGRAM_2)
return FALSE
if(!item_to_add)
user.visible_message(
"<span class='notice'>[user] pats [src] on the head.</span>",
@@ -289,13 +289,13 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
status_tab_data = show_borg_info(status_tab_data)
/mob/living/silicon/ai/proc/ai_alerts()
var/list/dat = list("<HEAD><TITLE>Current Station Alerts</TITLE><META HTTP-EQUIV='Refresh' CONTENT='10'></HEAD><BODY>\n")
dat += "<A HREF='?src=[UID()];mach_close=aialerts'>Close</A><BR><BR>"
var/list/dat = list("<meta charset='utf-8'><head><title>Current Station Alerts</title><meta http-equiv='Refresh' content='10'></head><body>\n")
dat += "<a href='?src=[UID()];mach_close=aialerts'>Close</a><br><br>"
var/list/list/temp_alarm_list = GLOB.alarm_manager.alarms.Copy()
for(var/cat in temp_alarm_list)
if(!(cat in alarms_listend_for))
continue
dat += "<B>[cat]</B><BR>\n"
dat += "<b>[cat]</b><br>\n"
var/list/list/L = temp_alarm_list[cat].Copy()
for(var/alarm in L)
var/list/list/alm = L[alarm].Copy()
@@ -307,22 +307,22 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
if(A && A.z != z)
L -= alarm
continue
dat += "<NOBR>"
dat += "<nobr>"
if(C && islist(C))
var/dat2 = ""
for(var/cam in C)
var/obj/machinery/camera/I = locateUID(cam)
if(!QDELETED(I))
dat2 += "[(dat2 == "") ? "" : " | "]<A HREF=?src=[UID()];switchcamera=[cam]>[I.c_tag]</A>"
dat2 += "[(dat2 == "") ? "" : " | "]<a href=?src=[UID()];switchcamera=[cam]>[I.c_tag]</A>"
dat += "-- [area_name] ([(dat2 != "") ? dat2 : "No Camera"])"
else
dat += "-- [area_name] (No Camera)"
if(sources.len > 1)
dat += "- [length(sources)] sources"
dat += "</NOBR><BR>\n"
dat += "</nobr><br>\n"
if(!L.len)
dat += "-- All Systems Nominal<BR>\n"
dat += "<BR>\n"
dat += "-- All Systems Nominal<br>\n"
dat += "<br>\n"
viewalerts = TRUE
var/dat_text = dat.Join("")
@@ -99,13 +99,13 @@ GLOBAL_DATUM_INIT(paiController, /datum/paiController, new) // Global handler fo
candidate.reload_save(usr)
//In case people have saved unsanitized stuff.
if(candidate.pai_name)
candidate.pai_name = sanitize(copytext(candidate.pai_name, 1, MAX_NAME_LEN))
candidate.pai_name = sanitize(copytext_char(candidate.pai_name, 1, MAX_NAME_LEN))
if(candidate.description)
candidate.description = sanitize(copytext(candidate.description, 1, MAX_MESSAGE_LEN))
candidate.description = sanitize(copytext_char(candidate.description, 1, MAX_MESSAGE_LEN))
if(candidate.role)
candidate.role = sanitize(copytext(candidate.role, 1, MAX_MESSAGE_LEN))
candidate.role = sanitize(copytext_char(candidate.role, 1, MAX_MESSAGE_LEN))
if(candidate.ooc_comments)
candidate.ooc_comments = sanitize(copytext(candidate.ooc_comments, 1, MAX_MESSAGE_LEN))
candidate.ooc_comments = sanitize(copytext_char(candidate.ooc_comments, 1, MAX_MESSAGE_LEN))
if("submit")
if(candidate)
@@ -250,7 +250,7 @@ GLOBAL_DATUM_INIT(paiController, /datum/paiController, new) // Global handler fo
dat += {"
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
<html>
<html><meta charset='utf-8'>
<head>
<style>
body {
+1 -1
View File
@@ -930,7 +930,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
usr << browse(null,"window=mob\ref[src]")
if(href_list["flavor_more"])
usr << browse(text("<HTML><HEAD><TITLE>[]</TITLE></HEAD><BODY><TT>[]</TT></BODY></HTML>", name, replacetext(flavor_text, "\n", "<BR>")), "window=[name];size=500x200")
usr << browse(text("<html><meta charset='utf-8'><head><title>[]</title></head><body><tt>[]</tt></body></html>", name, replacetext(flavor_text, "\n", "<br>")), "window=[name];size=500x200")
onclose(usr, "[name]")
if(href_list["flavor_change"])
update_flavor_text()
+28 -28
View File
@@ -235,12 +235,12 @@
return n
var/te = n
var/t = ""
n = length(n)
n = length_char(n)
var/p = null
p = 1
while(p <= n)
if((copytext(te, p, p + 1) == " " || prob(pr)))
t = "[t][copytext(te, p, p + 1)]"
if((copytext_char(te, p, p + 1) == " " || prob(pr)))
t = "[t][copytext_char(te, p, p + 1)]"
else
t = "[t]*"
p++
@@ -252,12 +252,12 @@
/proc/slur(phrase, list/slurletters = ("'"))//use a different list as an input if you want to make robots slur with $#@%! characters
phrase = html_decode(phrase)
var/leng=length(phrase)
var/counter=length(phrase)
var/newphrase=""
var/newletter=""
while(counter>=1)
newletter=copytext(phrase,(leng-counter)+1,(leng-counter)+2)
var/leng = length_char(phrase)
var/counter = length_char(phrase)
var/newphrase = ""
var/newletter = ""
while(counter >= 1)
newletter=copytext_char(phrase, (leng - counter) + 1, (leng - counter) + 2)
if(rand(1,3)==3)
if(lowertext(newletter)=="o") newletter="u"
if(lowertext(newletter)=="s") newletter="ch"
@@ -276,12 +276,12 @@
/proc/stutter(n)
var/te = html_decode(n)
var/t = "" //placed before the message. Not really sure what it's for.
n = length(n) //length of the entire word
n = length_char(n) //length of the entire word
var/p = null
p = 1 //1 is the start of any word
while(p <= n) //while P, which starts at 1 is less or equal to N which is the length.
var/n_letter = copytext(te, p, p + 1)//copies text from a certain distance. In this case, only one letter at a time.
if(prob(80) && (ckey(n_letter) in list("b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z")))
var/n_letter = copytext_char(te, p, p + 1)//copies text from a certain distance. In this case, only one letter at a time.
if(prob(80) && (lowertext(n_letter) in list("b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z")))
if(prob(5))
n_letter = text("[n_letter]-[n_letter]-[n_letter]") //replaces the current letter with this instead.
else
@@ -291,18 +291,18 @@
n_letter = text("[n_letter]-[n_letter]")
t = text("[t][n_letter]") //since the above is ran through for each letter, the text just adds up back to the original word.
p++ //for each letter p is increased to find where the next letter will be.
return sanitize(copytext(t,1,MAX_MESSAGE_LEN))
return sanitize(copytext_char(t, 1, MAX_MESSAGE_LEN))
/proc/robostutter(n) //for robutts
var/te = html_decode(n)
var/t = ""//placed before the message. Not really sure what it's for.
n = length(n)//length of the entire word
n = length_char(n)//length of the entire word
var/p = null
p = 1//1 is the start of any word
while(p <= n)//while P, which starts at 1 is less or equal to N which is the length.
var/robotletter = pick("@", "!", "#", "$", "%", "&", "?") //for beep boop
var/n_letter = copytext(te, p, p + 1)//copies text from a certain distance. In this case, only one letter at a time.
if(prob(80) && (ckey(n_letter) in list("b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z")))
var/n_letter = copytext_char(te, p, p + 1)//copies text from a certain distance. In this case, only one letter at a time.
if(prob(80) && (lowertext(n_letter) in list("b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z")))
if(prob(10))
n_letter = text("[n_letter]-[robotletter]-[n_letter]-[n_letter]")//replaces the current letter with this instead.
else
@@ -315,15 +315,15 @@
n_letter = text("[n_letter]-[n_letter]")
t = text("[t][n_letter]")//since the above is ran through for each letter, the text just adds up back to the original word.
p++//for each letter p is increased to find where the next letter will be.
return sanitize(copytext(t,1,MAX_MESSAGE_LEN))
return sanitize(copytext_char(t, 1, MAX_MESSAGE_LEN))
/proc/Gibberish(t, p, replace_rate = 50)//t is the inputted message, and any value higher than 70 for p will cause letters to be replaced instead of added. replace_rate is the chance a letter is corrupted.
/* Turn text into complete gibberish! */
var/returntext = ""
for(var/i = 1, i <= length(t), i++)
for(var/i = 1, i <= length_char(t), i++)
var/letter = copytext(t, i, i+1)
var/letter = copytext_char(t, i, i + 1)
if(prob(replace_rate))
if(p >= 70)
letter = ""
@@ -342,12 +342,12 @@
/proc/muffledspeech(phrase)
phrase = html_decode(phrase)
var/leng=length(phrase)
var/counter=length(phrase)
var/newphrase=""
var/newletter=""
while(counter>=1)
newletter=copytext(phrase,(leng-counter)+1,(leng-counter)+2)
var/leng = length_char(phrase)
var/counter = length_char(phrase)
var/newphrase = ""
var/newletter = ""
while(counter >= 1)
newletter=copytext_char(phrase, (leng - counter) + 1, (leng - counter) + 2)
if(newletter in list(" ", "!", "?", ".", ","))
// Skip these
counter -= 1
@@ -685,12 +685,12 @@
/proc/cultslur(n) // Inflicted on victims of a stun talisman
var/phrase = html_decode(n)
var/leng = length(phrase)
var/counter=length(phrase)
var/leng = length_char(phrase)
var/counter = length_char(phrase)
var/newphrase=""
var/newletter=""
while(counter>=1)
newletter=copytext(phrase,(leng-counter)+1,(leng-counter)+2)
newletter=copytext_char(phrase, (leng - counter) + 1, (leng - counter) + 2)
if(rand(1,2)==2)
if(lowertext(newletter)=="o")
newletter="u"
+1 -1
View File
@@ -143,7 +143,7 @@
return standard_mode
if(length(message) >= 2)
var/channel_prefix = copytext(message, 1 ,3)
var/channel_prefix = copytext_char(message, 1, 3)
return GLOB.department_radio_keys[channel_prefix]
return null
+1 -1
View File
@@ -439,7 +439,7 @@
var/mins = (mills % 36000) / 600
var/hours = mills / 36000
var/dat = "<html><body><center>"
var/dat = "<html><meta charset='utf-8'><body><center>"
dat += "Round Duration: [round(hours)]h [round(mins)]m<br>"
dat += "<b>The station alert level is: [SSsecurity_level.get_colored_current_security_level_name()]</b><br>"
+1 -1
View File
@@ -43,7 +43,7 @@
return
if(ishuman(user))
var/mob/living/carbon/human/human_user = user
var/dat
var/dat = {"<meta charset="UTF-8">"}
pages = 0
switch(screen)
if(SCREEN_COVER) //Cover
+2 -2
View File
@@ -46,10 +46,10 @@
return ..()
/obj/item/folder/attack_self(mob/user as mob)
var/dat = "<title>[name]</title>"
var/dat = {"<meta charset="UTF-8"><title>[name]</title>"}
for(var/obj/item/paper/P in src)
dat += "<A href='?src=[UID()];remove=\ref[P]'>Remove</A> - <A href='?src=[UID()];read=\ref[P]'>[P.name]</A><BR>"
dat += "<a href='?src=[UID()];remove=\ref[P]'>Remove</a> - <a href='?src=[UID()];read=\ref[P]'>[P.name]</a><br>"
for(var/obj/item/photo/Ph in src)
dat += "<A href='?src=[UID()];remove=\ref[Ph]'>Remove</A> - <A href='?src=[UID()];look=\ref[Ph]'>[Ph.name]</A><BR>"
for(var/obj/item/paper_bundle/Pa in src)
+1 -1
View File
@@ -288,7 +288,7 @@
/obj/item/paper/proc/openhelp(mob/user as mob)
user << browse({"<HTML><HEAD><TITLE>Pen Help</TITLE></HEAD>
user << browse({"<html><meta charset='utf-8'><head><title>Pen Help</title></head>
<BODY>
<b><center>Crayon&Pen commands</center></b><br>
<br>
+2 -2
View File
@@ -105,7 +105,7 @@
. += "<span class='notice'>It is too far away.</span>"
/obj/item/paper_bundle/proc/show_content(mob/user as mob)
var/dat
var/dat = {"<meta charset="UTF-8">"}
var/obj/item/W = src[page]
switch(screen)
if(0)
@@ -127,7 +127,7 @@
else if(istype(src[page], /obj/item/photo))
var/obj/item/photo/P = W
usr << browse_rsc(P.img, "tmp_photo.png")
usr << browse(dat + "<html><head><title>[P.name]</title></head>" \
usr << browse(dat + "<html><meta charset='utf-8'><head><title>[P.name]</title></head>" \
+ "<body style='overflow:hidden'>" \
+ "<div> <img src='tmp_photo.png' width = '180'" \
+ "[P.scribble ? "<div><br> Written on the back:<br><i>[P.scribble]</i>" : ""]"\
+1 -1
View File
@@ -106,7 +106,7 @@
colormatrix[7], colormatrix[8], colormatrix[9],
)
usr << browse_rsc(img_shown, "tmp_photo.png")
usr << browse("<html><head><title>[name]</title></head>" \
usr << browse("<html><meta charset='utf-8'><head><title>[name]</title></head>" \
+ "<body style='overflow:hidden;margin:0;text-align:center'>" \
+ "<img src='tmp_photo.png' width='[64*photo_size]' style='-ms-interpolation-mode:nearest-neighbor' />" \
+ "[scribble ? "<br>Written on the back:<br><i>[scribble]</i>" : ""]"\
-1
View File
@@ -395,7 +395,6 @@ GLOBAL_LIST_EMPTY(PDAs)
to_chat(user, "The PDA softly beeps.")
close(user)
return TRUE
ttone = new_tone
return TRUE
+1 -1
View File
@@ -39,7 +39,7 @@
var/datum/data/pda/app/messenger/M = find_program(/datum/data/pda/app/messenger)
if(!M)
to_chat(usr, "<span class='warning'>Cannot use messenger!</span>")
var/HTML = "<html><head><title>AI PDA Message Log</title></head><body>"
var/HTML = "<html><meta charset='utf-8'><head><title>AI PDA Message Log</title></head><body>"
for(var/index in M.tnote)
if(index["sent"])
HTML += addtext("<i><b>&rarr; To <a href='byond://?src=[UID()];choice=Message;target=",index["src"],"'>", index["owner"],"</a>:</b></i><br>", index["message"], "<br>")
+3 -3
View File
@@ -347,9 +347,9 @@
dat += "[temp_server.name] Server to Server Transfer<BR><BR>"
dat += "Send Data to what server?<BR>"
for(var/obj/machinery/r_n_d/server/S in servers)
dat += "[S.name] <A href='?src=[UID()];send_to=[S.server_id]'> (Transfer)</A><BR>"
dat += "<HR><A href='?src=[UID()];main=1'>Main Menu</A>"
user << browse("<TITLE>R&D Server Control</TITLE><HR>[dat]", "window=server_control;size=575x400")
dat += "[S.name] <a href='?src=[UID()];send_to=[S.server_id]'> (Transfer)</a><br>"
dat += "<hr><a href='?src=[UID()];main=1'>Main Menu</a>"
user << browse("<title>R&D Server Control</title><hr><meta charset='UTF-8'>[dat]", "window=server_control;size=575x400")
onclose(user, "server_control")
return
+1 -1
View File
@@ -268,7 +268,7 @@
if(world.time > timeout || !reason || (!is_public && !is_authorized(user)) || ..())
// Cancel if they take too long, they dont give a reason, they aint authed, or if they walked away
return
reason = sanitize(copytext(reason, 1, 75)) // very long reasons are bad
reason = sanitize(copytext_char(reason, 1, 75)) // very long reasons are bad
//===orderee identification information===
var/idname = "*None Provided*"
+1 -1
View File
@@ -137,7 +137,7 @@ GLOBAL_LIST_EMPTY(GPS_list)
switch(action)
if("tag")
var/newtag = params["newtag"] || ""
newtag = uppertext(paranoid_sanitize(copytext(newtag, 1, 5)))
newtag = uppertext(paranoid_sanitize(copytext_char(newtag, 1, 5)))
if(!length(newtag) || gpstag == newtag)
return
gpstag = newtag