TGUI GPS & Mining Vendor & Ore Processing Console

This commit is contained in:
ShadowLarkens
2020-08-16 16:04:28 -07:00
parent 510162d2d5
commit 5bbd5334b6
9 changed files with 529 additions and 149 deletions

View File

@@ -453,4 +453,22 @@ proc/TextPreview(var/string,var/len=40)
. += .(rest)
#define gender2text(gender) capitalize(gender)
#define gender2text(gender) capitalize(gender)
/// Used to get a properly sanitized input, of max_length
/// no_trim is self explanatory but it prevents the input from being trimed if you intend to parse newlines or whitespace.
/proc/stripped_input(mob/user, message = "", title = "", default = "", max_length=MAX_MESSAGE_LEN, no_trim=FALSE)
var/name = input(user, message, title, default) as text|null
if(no_trim)
return copytext(html_encode(name), 1, max_length)
else
return trim(html_encode(name), max_length) //trim is "outside" because html_encode can expand single symbols into multiple symbols (such as turning < into &lt;)
// Used to get a properly sanitized multiline input, of max_length
/proc/stripped_multiline_input(mob/user, message = "", title = "", default = "", max_length=MAX_MESSAGE_LEN, no_trim=FALSE)
var/name = input(user, message, title, default) as message|null
if(no_trim)
return copytext(html_encode(name), 1, max_length)
else
return trim(html_encode(name), max_length)