unicode support port wip

This commit is contained in:
Ghommie
2020-01-31 05:32:00 +01:00
parent 55a0e4e55d
commit 188f726ffd
115 changed files with 818 additions and 828 deletions

View File

@@ -171,7 +171,8 @@
key_name = copytext(str_val, 1, key_pos)
if(lowercase)
key_name = lowertext(key_name)
key_value = copytext(str_val, key_pos + 1)
if(key_pos)
key_value = copytext(str_val, key_pos + length(str_val[key_pos]))
var/new_key
var/new_value
var/continue_check_value

View File

@@ -109,13 +109,13 @@
if(!L)
continue
var/firstchar = copytext(L, 1, 2)
var/firstchar = L[1]
if(firstchar == "#")
continue
var/lockthis = firstchar == "@"
if(lockthis)
L = copytext(L, 2)
L = copytext(L, length(firstchar) + 1)
var/pos = findtext(L, " ")
var/entry = null
@@ -123,7 +123,7 @@
if(pos)
entry = lowertext(copytext(L, 1, pos))
value = copytext(L, pos + 1)
value = copytext(L, pos + length(L[pos]))
else
entry = lowertext(L)
@@ -269,7 +269,7 @@
t = trim(t)
if(length(t) == 0)
continue
else if(copytext(t, 1, 2) == "#")
else if(t[1] == "#")
continue
var/pos = findtext(t, " ")
@@ -278,7 +278,7 @@
if(pos)
command = lowertext(copytext(t, 1, pos))
data = copytext(t, pos + 1)
data = copytext(t, pos + length(t[pos]))
else
command = lowertext(t)

View File

@@ -39,34 +39,34 @@ SUBSYSTEM_DEF(pai)
switch(option)
if("name")
t = input("Enter a name for your pAI", "pAI Name", candidate.name) as text
t = reject_bad_name(stripped_input(usr, "Enter a name for your pAI", "pAI Name", candidate.name, MAX_NAME_LEN), TRUE)
if(t)
candidate.name = copytext(sanitize(t),1,MAX_NAME_LEN)
candidate.name = t
if("desc")
t = input("Enter a description for your pAI", "pAI Description", candidate.description) as message
t = stripped_multiline_input(usr, "Enter a description for your pAI", "pAI Description", candidate.description, MAX_MESSAGE_LEN)
if(t)
candidate.description = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
candidate.description = t
if("role")
t = input("Enter a role for your pAI", "pAI Role", candidate.role) as text
t = stripped_input(usr, "Enter a role for your pAI", "pAI Role", candidate.role, MAX_MESSAGE_LEN)
if(t)
candidate.role = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
candidate.role = t
if("ooc")
t = input("Enter any OOC comments", "pAI OOC Comments", candidate.comments) as message
t = stripped_multiline_input(usr, "Enter any OOC comments", "pAI OOC Comments", candidate.comments, MAX_MESSAGE_LEN)
if(t)
candidate.comments = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
candidate.comments = t
if("save")
candidate.savefile_save(usr)
if("load")
candidate.savefile_load(usr)
//In case people have saved unsanitized stuff.
if(candidate.name)
candidate.name = copytext(sanitize(candidate.name),1,MAX_NAME_LEN)
candidate.name = copytext_char(sanitize(candidate.name),1,MAX_NAME_LEN)
if(candidate.description)
candidate.description = copytext(sanitize(candidate.description),1,MAX_MESSAGE_LEN)
candidate.description = copytext_char(sanitize(candidate.description),1,MAX_MESSAGE_LEN)
if(candidate.role)
candidate.role = copytext(sanitize(candidate.role),1,MAX_MESSAGE_LEN)
candidate.role = copytext_char(sanitize(candidate.role),1,MAX_MESSAGE_LEN)
if(candidate.comments)
candidate.comments = copytext(sanitize(candidate.comments),1,MAX_MESSAGE_LEN)
candidate.comments = copytext_char(sanitize(candidate.comments),1,MAX_MESSAGE_LEN)
if("submit")
if(isobserver(usr))

View File

@@ -46,6 +46,6 @@ PROCESSING_SUBSYSTEM_DEF(networks)
var/hex = md5(string)
if(!hex)
return //errored
. = "[copytext(hex, 1, 9)]" //16 ^ 8 possibilities I think.
. = "[copytext_char(hex, 1, 9)]" //16 ^ 8 possibilities I think.
if(interfaces_by_id[.])
return resolve_collisions? make_address("[num2text(rand(HID_RESTRICTED_END, 999999999), 12)]"):null