Merge branch 'master' into upstream-merge-13142

This commit is contained in:
Nadyr
2022-06-22 23:27:07 -04:00
committed by GitHub
119 changed files with 285 additions and 213 deletions

View File

@@ -351,7 +351,7 @@
. += "<a href='?priv_msg=\ref[C]'>"
if(C && C.holder && C.holder.fakekey)
. += "Administrator"
. += C.holder.rank // CHOMPEdit: Stealth mode displays staff rank in PM Messages
else
. += key

View File

@@ -481,20 +481,23 @@
/// 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
var/user_input = input(user, message, title, default) as text|null
if(isnull(user_input))
return
if(no_trim)
return copytext(html_encode(name), 1, max_length)
return copytext(html_encode(user_input), 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;)
return trim(html_encode(user_input), 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
var/user_input = input(user, message, title, default) as message|null
if(isnull(user_input))
return
if(no_trim)
return copytext(html_encode(name), 1, max_length)
return copytext(html_encode(user_input), 1, max_length)
else
return trim(html_encode(name), max_length)
return trim(html_encode(user_input), max_length)
//Adds 'char' ahead of 'text' until there are 'count' characters total
/proc/add_leading(text, count, char = " ")

View File

@@ -1,32 +1,22 @@
/* Note from Carnie:
The way datum/mind stuff works has been changed a lot.
Minds now represent IC characters rather than following a client around constantly.
Guidelines for using minds properly:
- Never mind.transfer_to(ghost). The var/current and var/original of a mind must always be of type mob/living!
ghost.mind is however used as a reference to the ghost's corpse
- When creating a new mob for an existing IC character (e.g. cloning a dead guy or borging a brain of a human)
the existing mind of the old mob should be transfered to the new mob like so:
mind.transfer_to(new_mob)
- You must not assign key= or ckey= after transfer_to() since the transfer_to transfers the client for you.
By setting key or ckey explicitly after transfering the mind with transfer_to you will cause bugs like DCing
the player.
- IMPORTANT NOTE 2, if you want a player to become a ghost, use mob.ghostize() It does all the hard work for you.
- When creating a new mob which will be a new IC character (e.g. putting a shade in a construct or randomly selecting
a ghost to become a xeno during an event). Simply assign the key or ckey like you've always done.
new_mob.key = key
The Login proc will handle making a new mob for that mobtype (including setting up stuff like mind.name). Simple!
However if you want that mind to have any special properties like being a traitor etc you will have to do that
yourself.
*/
/datum/mind
@@ -190,7 +180,7 @@
assigned_role = new_role
else if (href_list["memory_edit"])
var/new_memo = sanitize(tgui_input_text("Write new memory", "Memory", memory, multiline = TRUE))
var/new_memo = sanitize(tgui_input_text(usr, "Write new memory", "Memory", memory, multiline = TRUE))
if (isnull(new_memo)) return
memory = new_memo
@@ -198,7 +188,7 @@
var/datum/mind/mind = locate(href_list["amb_edit"])
if(!mind)
return
var/new_ambition = tgui_input_text("Enter a new ambition", "Memory", mind.ambitions, multiline = TRUE)
var/new_ambition = tgui_input_text(usr, "Enter a new ambition", "Memory", mind.ambitions, multiline = TRUE)
if(isnull(new_ambition))
return
if(mind)
@@ -296,7 +286,7 @@
if(objective&&objective.type==text2path("/datum/objective/[new_obj_type]"))
def_num = objective.target_amount
var/target_number = tgui_input_number("Input target number:", "Objective", def_num)
var/target_number = tgui_input_number(usr, "Input target number:", "Objective", def_num)
if (isnull(target_number))//Ordinarily, you wouldn't need isnull. In this case, the value may already exist.
return
@@ -314,7 +304,7 @@
new_objective.target_amount = target_number
if ("custom")
var/expl = sanitize(tgui_input_text("Custom objective:", "Objective", objective ? objective.explanation_text : ""))
var/expl = sanitize(tgui_input_text(usr, "Custom objective:", "Objective", objective ? objective.explanation_text : ""))
if (!expl) return
new_objective = new /datum/objective
new_objective.owner = src
@@ -410,7 +400,7 @@
// var/obj/item/device/uplink/hidden/suplink = find_syndicate_uplink() No longer needed, uses stored in mind
var/crystals
crystals = tcrystals
crystals = tgui_input_number("Amount of telecrystals for [key]", crystals)
crystals = tgui_input_number(usr, "Amount of telecrystals for [key]", crystals)
if (!isnull(crystals))
tcrystals = crystals

View File

@@ -118,7 +118,7 @@
/datum/antagonist/proc/set_antag_name(var/mob/living/player)
// Choose a name, if any.
var/newname = sanitize(input(player, "You are a [role_text]. Would you like to change your name to something else?", "Name change") as null|text, MAX_NAME_LEN)
var/newname = sanitize(tgui_input_text(player, "You are a [role_text]. Would you like to change your name to something else?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN)
if (newname)
player.real_name = newname
player.name = player.real_name

View File

@@ -97,7 +97,7 @@ var/datum/antagonist/rogue_ai/malf
testing("rogue_ai set_antag_name called on non-silicon mob [player]!")
return
// Choose a name, if any.
var/newname = sanitize(input(player, "You are a [role_text]. Would you like to change your name to something else?", "Name change") as null|text, MAX_NAME_LEN)
var/newname = sanitize(tgui_input_text(player, "You are a [role_text]. Would you like to change your name to something else?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN)
if (newname)
player.SetName(newname)
if(player.mind) player.mind.name = player.name

View File

@@ -22,7 +22,7 @@
to_chat(src, "<span class='notice'>We return our vocal glands to their original location.</span>")
return
var/mimic_voice = sanitize(input(usr, "Enter a name to mimic.", "Mimic Voice", null), MAX_NAME_LEN)
var/mimic_voice = sanitize(tgui_input_text(usr, "Enter a name to mimic.", "Mimic Voice", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(!mimic_voice)
return

View File

@@ -611,7 +611,7 @@ var/list/sacrificed = list()
// returns 0 if the rune is not used. returns 1 if the rune is used.
/obj/effect/rune/proc/communicate()
. = 1 // Default output is 1. If the rune is deleted it will return 1
var/input = input(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", "")//sanitize() below, say() and whisper() have their own
var/input = tgui_input_text(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", "")//sanitize() below, say() and whisper() have their own
if(!input)
if (istype(src))
fizzle()

View File

@@ -38,7 +38,7 @@
/datum/job/chaplain/proc/religion_prompts(mob/living/carbon/human/H, obj/item/weapon/storage/bible/B, obj/item/weapon/card/id/I)
var/religion_name = "Unitarianism"
var/new_religion = sanitize(input(H, "You are the crew services officer. Would you like to change your religion? Default is Unitarianism", "Name change", religion_name), MAX_NAME_LEN)
var/new_religion = sanitize(tgui_input_text(H, "You are the crew services officer. Would you like to change your religion? Default is Unitarianism", "Name change", religion_name, MAX_NAME_LEN), MAX_NAME_LEN)
if(!new_religion)
new_religion = religion_name
@@ -79,12 +79,12 @@
B.name = "The Holy Book of [new_religion]"
var/deity_name = "Hashem"
var/new_deity = sanitize(input(H, "Would you like to change your deity? Default is Hashem", "Name change", deity_name), MAX_NAME_LEN)
var/new_deity = sanitize(tgui_input_text(H, "Would you like to change your deity? Default is Hashem", "Name change", deity_name, MAX_NAME_LEN), MAX_NAME_LEN)
if((length(new_deity) == 0) || (new_deity == "Hashem"))
new_deity = deity_name
var/new_title = sanitize(input(H, "Would you like to change your title?", "Title Change", I.assignment), MAX_NAME_LEN)
var/new_title = sanitize(tgui_input_text(H, "Would you like to change your title?", "Title Change", I.assignment, MAX_NAME_LEN), MAX_NAME_LEN)
var/list/all_jobs = get_job_datums()

View File

@@ -246,7 +246,7 @@
var/dkey = trim(tgui_input_text(usr, "Please enter the current decryption key."))
if(dkey && dkey != "")
if(linkedServer.decryptkey == dkey)
var/newkey = trim(input(usr,"Please enter the new key (3 - 16 characters max):"))
var/newkey = trim(tgui_input_text(usr,"Please enter the new key (3 - 16 characters max):",null,null,16))
if(length(newkey) <= 3)
set_temp("NOTICE: Decryption key too short!", "average")
else if(length(newkey) > 16)

View File

@@ -129,7 +129,7 @@
if(default_deconstruction_screwdriver(user, W))
return
else if(panel_open && istype(W, /obj/item/weapon/pen))
var/t = sanitizeSafe(input(user, "Enter the name for \the [src].", src.name, initial(src.name)), MAX_NAME_LEN)
var/t = sanitizeSafe(tgui_input_text(user, "Enter the name for \the [src].", src.name, initial(src.name), MAX_NAME_LEN), MAX_NAME_LEN)
if(t && in_range(src, user))
name = t
else if(panel_open && istype(W, /obj/item/device/multitool))

View File

@@ -1092,7 +1092,7 @@
return
if(istype(I, /obj/item/weapon/pen)) //you can rename turrets like bots!
var/t = sanitizeSafe(input(user, "Enter new turret name", name, finish_name) as text, MAX_NAME_LEN)
var/t = sanitizeSafe(tgui_input_text(user, "Enter new turret name", name, finish_name, MAX_NAME_LEN), MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, usr) && loc != usr)

View File

@@ -288,7 +288,7 @@
. = TRUE
if("id")
var/newid = copytext(reject_bad_text(input(usr, "Specify the new ID for this machine", src, id) as null|text),1,MAX_MESSAGE_LEN)
var/newid = copytext(reject_bad_text(tgui_input_text(usr, "Specify the new ID for this machine", src, id)),1,MAX_MESSAGE_LEN)
if(newid && canAccess(usr))
id = newid
set_temp("-% New ID assigned: \"[id]\" %-", "average")

View File

@@ -103,7 +103,7 @@
occupant.enter_vr(avatar)
var/newname = sanitize(input(avatar, "Your mind feels foggy. You're certain your name is [occupant.real_name], but it could also be [avatar.name]. Would you like to change it to something else?", "Name change") as null|text, MAX_NAME_LEN)
var/newname = sanitize(tgui_input_text(avatar, "Your mind feels foggy. You're certain your name is [occupant.real_name], but it could also be [avatar.name]. Would you like to change it to something else?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN)
if (newname)
avatar.real_name = newname
@@ -113,7 +113,7 @@
else
// There's only one body per one of these pods, so let's be kind.
var/newname = sanitize(input(avatar, "Your mind feels foggy. You're certain your name is [occupant.real_name], but it feels like it is [avatar.name]. Would you like to change it to something else?", "Name change") as null|text, MAX_NAME_LEN)
var/newname = sanitize(tgui_input_text(avatar, "Your mind feels foggy. You're certain your name is [occupant.real_name], but it feels like it is [avatar.name]. Would you like to change it to something else?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(newname)
avatar.real_name = newname

View File

@@ -250,7 +250,7 @@
occupant.enter_vr(avatar)
// Prompt for username after they've enterred the body.
var/newname = sanitize(input(avatar, "You are entering virtual reality. Your username is currently [src.name]. Would you like to change it to something else?", "Name change") as null|text, MAX_NAME_LEN)
var/newname = sanitize(tgui_input_text(avatar, "You are entering virtual reality. Your username is currently [src.name]. Would you like to change it to something else?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN)
if (newname)
avatar.real_name = newname

View File

@@ -2551,7 +2551,7 @@
return
if (href_list["change_name"])
if(usr != src.occupant) return
var/newname = sanitizeSafe(input(occupant,"Choose new exosuit name","Rename exosuit",initial(name)) as text, MAX_NAME_LEN)
var/newname = sanitizeSafe(tgui_input_text(occupant,"Choose new exosuit name","Rename exosuit",initial(name), MAX_NAME_LEN), MAX_NAME_LEN)
if(newname)
name = newname
else
@@ -2590,7 +2590,7 @@
if(!in_range(src, usr)) return
var/mob/user = top_filter.getMob("user")
if(user)
var/new_pressure = input(user,"Input new output pressure","Pressure setting",internal_tank_valve) as num
var/new_pressure = tgui_input_number(user,"Input new output pressure","Pressure setting",internal_tank_valve)
if(new_pressure)
internal_tank_valve = new_pressure
to_chat(user, "The internal pressure valve has been set to [internal_tank_valve]kPa.")

View File

@@ -148,7 +148,7 @@
to_chat(usr, "<span class='warning'>Error! Please notify administration!</span>")
return
var/list/turf/turfs = res
var/str = sanitizeSafe(input(usr, "New area name:","Blueprint Editing", ""), MAX_NAME_LEN)
var/str = sanitizeSafe(tgui_input_text(usr, "New area name:","Blueprint Editing", "", MAX_NAME_LEN), MAX_NAME_LEN)
if(!str || !length(str)) //cancel
return
if(length(str) > 50)
@@ -207,7 +207,7 @@
/obj/item/blueprints/proc/edit_area()
var/area/A = get_area()
var/prevname = "[A.name]"
var/str = sanitizeSafe(input(usr, "New area name:","Blueprint Editing", prevname), MAX_NAME_LEN)
var/str = sanitizeSafe(tgui_input_text(usr, "New area name:","Blueprint Editing", prevname, MAX_NAME_LEN), MAX_NAME_LEN)
if(!str || !length(str) || str==prevname) //cancel
return
if(length(str) > 50)

View File

@@ -1,3 +1,20 @@
var/global/list/radio_channels_by_freq = list(
num2text(PUB_FREQ) = "Common",
num2text(AI_FREQ) = "AI Private",
num2text(ENT_FREQ) = "Entertainment",
num2text(ERT_FREQ) = "Response Team",
num2text(COMM_FREQ)= "Command",
num2text(ENG_FREQ) = "Engineering",
num2text(MED_FREQ) = "Medical",
num2text(MED_I_FREQ)="Medical(I)",
num2text(SEC_FREQ) = "Security",
num2text(SEC_I_FREQ)="Security(I)",
num2text(SCI_FREQ) = "Science",
num2text(SUP_FREQ) = "Supply",
num2text(SRV_FREQ) = "Service",
num2text(EXP_FREQ) = "Explorer"
)
GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
/obj/item/device/paicard
@@ -11,12 +28,13 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
show_messages = 0
preserve_item = 1
var/obj/item/device/radio/radio
var/obj/item/device/radio/borg/pai/radio
var/looking_for_personality = 0
var/mob/living/silicon/pai/pai
var/image/screen_layer
var/screen_color = "#00ff0d"
var/last_notify = 0
var/screen_msg
/obj/item/device/paicard/relaymove(var/mob/user, var/direction)
if(user.stat || user.stunned)
@@ -41,10 +59,16 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
if(pai != null) //Have a person in them already?
return ..()
var/choice = tgui_alert(user, "You sure you want to inhabit this PAI?", "Confirmation", list("Yes", "No"))
if(choice == "No")
return ..()
if(jobban_isbanned(usr, "pAI"))
to_chat(usr,"<span class='warning'>You cannot join a pAI card when you are banned from playing as a pAI.</span>")
return
var/choice = tgui_alert(user, "You sure you want to inhabit this PAI, or submit yourself to being recruited?", "Confirmation", list("Inhabit", "Recruit", "Cancel"))
if(choice == "Cancel")
return ..()
if(choice == "Recruit")
paiController.recruitWindow(user)
return ..()
choice = tgui_alert(user, "Do you want to load your pAI data?", "Load", list("Yes", "No"))
var/actual_pai_name
var/turf/location = get_turf(src)
@@ -259,6 +283,8 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
</table>
"}
*/
if(screen_msg)
dat += "<b>Message from [pai.name]</b><br>[screen_msg]"
else
if(looking_for_personality)
dat += {"
@@ -444,6 +470,34 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
if(user)
to_chat(user, span_notice("You eject the card from \the [initial(src.name)]."))
///////////////////////////////
//////////pAI Radios//////////
///////////////////////////////
//Thanks heroman!
/obj/item/device/radio/borg/pai
name = "integrated radio"
icon = 'icons/obj/robot_component.dmi' // Cyborgs radio icons should look like the component.
icon_state = "radio"
loudspeaker = FALSE
/obj/item/device/radio/borg/pai/attackby(obj/item/weapon/W as obj, mob/user as mob)
return
/obj/item/device/radio/borg/pai/recalculateChannels()
if(!istype(loc,/obj/item/device/paicard))
return
var/obj/item/device/paicard/card = loc
secure_radio_connections = list()
channels = list()
for(var/internal_chan in internal_channels)
var/ch_name = radio_channels_by_freq[internal_chan]
if(has_channel_access(card.pai, internal_chan))
channels += ch_name
channels[ch_name] = 1
secure_radio_connections[ch_name] = radio_controller.add_object(src, radiochannels[ch_name], RADIO_CHAT)
/obj/item/device/paicard/typeb
name = "personal AI device"
icon = 'icons/obj/paicard.dmi'

View File

@@ -135,7 +135,7 @@ This device records all warnings given and teleport events for admin review in c
to_chat(user, "<span class='warning'>The translocator can't support any more beacons!</span>")
return
var/new_name = html_encode(input(user,"New beacon's name (2-20 char):","[src]") as text|null)
var/new_name = html_encode(tgui_input_text(user,"New beacon's name (2-20 char):","[src]",null,20))
if(!check_menu(user))
return

View File

@@ -40,7 +40,7 @@
var/heldname = "default name"
/obj/item/borg/upgrade/rename/attack_self(mob/user as mob)
heldname = sanitizeSafe(input(user, "Enter new robot name", "Robot Reclassification", heldname), MAX_NAME_LEN)
heldname = sanitizeSafe(tgui_input_text(user, "Enter new robot name", "Robot Reclassification", heldname, MAX_NAME_LEN), MAX_NAME_LEN)
/obj/item/borg/upgrade/rename/action(var/mob/living/silicon/robot/R)
if(..()) return 0

View File

@@ -123,7 +123,7 @@
var/mob/M = usr
if(!M.mind) return 0
var/input = sanitizeSafe(input(usr, "What do you want to name the icon?", ,""), MAX_NAME_LEN)
var/input = sanitizeSafe(tgui_input_text(usr, "What do you want to name the icon?", ,"", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(src && input && !M.stat && in_range(M,src))
name = "icon of " + input

View File

@@ -136,7 +136,7 @@
cell = I
else if(istype(I, /obj/item/weapon/pen) || istype(I, /obj/item/device/flashlight/pen))
var/tmp_label = sanitizeSafe(input(user, "Enter a nickname for [src]", "Nickname", nickname), MAX_NAME_LEN)
var/tmp_label = sanitizeSafe(tgui_input_text(user, "Enter a nickname for [src]", "Nickname", nickname, MAX_NAME_LEN), MAX_NAME_LEN)
if(length(tmp_label) > 50 || length(tmp_label) < 3)
to_chat(user, "<span class='notice'>The nickname must be between 3 and 50 characters.</span>")
else

View File

@@ -240,7 +240,7 @@ AI MODULES
/obj/item/weapon/aiModule/freeform/attack_self(var/mob/user as mob)
..()
var/new_lawpos = input(usr, "Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority (15+)", lawpos) as num
var/new_lawpos = tgui_input_number(usr, "Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority (15+)", lawpos)
if(new_lawpos < MIN_SUPPLIED_LAW_NUMBER) return
lawpos = min(new_lawpos, MAX_SUPPLIED_LAW_NUMBER)
var/newlaw = ""

View File

@@ -13,14 +13,14 @@
/obj/item/weapon/material/gravemarker/attackby(obj/item/weapon/W, mob/user as mob)
if(W.is_screwdriver())
var/carving_1 = sanitizeSafe(input(user, "Who is \the [src.name] for?", "Gravestone Naming", null) as text, MAX_NAME_LEN)
var/carving_1 = sanitizeSafe(tgui_input_text(user, "Who is \the [src.name] for?", "Gravestone Naming", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(carving_1)
user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].")
if(do_after(user, material.hardness * W.toolspeed))
user.visible_message("[user] carves something into \the [src.name].", "You carve your message into \the [src.name].")
grave_name += carving_1
update_icon()
var/carving_2 = sanitizeSafe(input(user, "What message should \the [src.name] have?", "Epitaph Carving", null) as text, MAX_NAME_LEN)
var/carving_2 = sanitizeSafe(tgui_input_text(user, "What message should \the [src.name] have?", "Epitaph Carving", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(carving_2)
user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].")
if(do_after(user, material.hardness * W.toolspeed))

View File

@@ -208,7 +208,7 @@
/obj/item/weapon/storage/pill_bottle/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/pen) || istype(W, /obj/item/device/flashlight/pen))
var/tmp_label = sanitizeSafe(input(user, "Enter a label for [name]", "Label", label_text), MAX_NAME_LEN)
var/tmp_label = sanitizeSafe(tgui_input_text(user, "Enter a label for [name]", "Label", label_text, MAX_NAME_LEN), MAX_NAME_LEN)
if(length(tmp_label) > 50)
to_chat(user, "<span class='notice'>The label can be at most 50 characters long.</span>")
else if(length(tmp_label) > 10)

View File

@@ -155,7 +155,7 @@
bound_height = width * world.icon_size
/obj/structure/door_assembly/proc/rename_door(mob/living/user)
var/t = sanitizeSafe(input(user, "Enter the name for the windoor.", src.name, src.created_name), MAX_NAME_LEN)
var/t = sanitizeSafe(tgui_input_text(user, "Enter the name for the windoor.", src.name, src.created_name, MAX_NAME_LEN), MAX_NAME_LEN)
if(!in_range(src, user) && src.loc != user) return
created_name = t
update_state()

View File

@@ -102,7 +102,7 @@
E.description_antag = "This is a 'disguised' emag, to make your escape from wherever you happen to be trapped."
H.equip_to_appropriate_slot(E)
var/newname = sanitize(input(H, "Your mind feels foggy, and you recall your name might be [H.real_name]. Would you like to change your name?", "Name change") as null|text, MAX_NAME_LEN)
var/newname = sanitize(tgui_input_text(H, "Your mind feels foggy, and you recall your name might be [H.real_name]. Would you like to change your name?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN)
if (newname)
H.real_name = newname
@@ -224,7 +224,7 @@
var/obj/item/C = new newpath(H)
H.equip_to_appropriate_slot(C)
var/newname = sanitize(input(H, "Your mind feels foggy, and you recall your name might be [H.real_name]. Would you like to change your name?", "Name change") as null|text, MAX_NAME_LEN)
var/newname = sanitize(tgui_input_text(H, "Your mind feels foggy, and you recall your name might be [H.real_name]. Would you like to change your name?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN)
if (newname)
H.real_name = newname

View File

@@ -52,14 +52,14 @@
/obj/structure/gravemarker/attackby(obj/item/weapon/W, mob/user as mob)
if(W.is_screwdriver())
var/carving_1 = sanitizeSafe(input(user, "Who is \the [src.name] for?", "Gravestone Naming", null) as text, MAX_NAME_LEN)
var/carving_1 = sanitizeSafe(tgui_input_text(user, "Who is \the [src.name] for?", "Gravestone Naming", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(carving_1)
user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].")
if(do_after(user, material.hardness * W.toolspeed))
user.visible_message("[user] carves something into \the [src.name].", "You carve your message into \the [src.name].")
grave_name += carving_1
update_icon()
var/carving_2 = sanitizeSafe(input(user, "What message should \the [src.name] have?", "Epitaph Carving", null) as text, MAX_NAME_LEN)
var/carving_2 = sanitizeSafe(tgui_input_text(user, "What message should \the [src.name] have?", "Epitaph Carving", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(carving_2)
user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].")
if(do_after(user, material.hardness * W.toolspeed))

View File

@@ -133,7 +133,7 @@
if(user.mind)
user.mind.transfer_to(vox)
spawn(1)
var/newname = sanitizeSafe(input(vox,"Enter a name, or leave blank for the default name.", "Name change","") as text, MAX_NAME_LEN)
var/newname = sanitizeSafe(tgui_input_text(vox,"Enter a name, or leave blank for the default name.", "Name change","", MAX_NAME_LEN), MAX_NAME_LEN)
if(!newname || newname == "")
var/datum/language/L = GLOB.all_languages[vox.species.default_language]
newname = L.get_random_name()

View File

@@ -121,7 +121,7 @@
/obj/structure/morgue/attackby(P as obj, mob/user as mob)
if (istype(P, /obj/item/weapon/pen))
var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text
var/t = tgui_input_text(user, "What would you like the label to be?", text("[]", src.name), null)
if (user.get_active_hand() != P)
return
if ((!in_range(src, usr) && src.loc != user))
@@ -249,7 +249,7 @@ GLOBAL_LIST_BOILERPLATE(all_crematoriums, /obj/structure/morgue/crematorium)
/obj/structure/morgue/crematorium/attackby(P as obj, mob/user as mob)
if (istype(P, /obj/item/weapon/pen))
var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text
var/t = tgui_input_text(user, "What would you like the label to be?", text("[]", src.name), null)
if (user.get_active_hand() != P)
return
if ((!in_range(src, usr) > 1 && src.loc != user))

View File

@@ -59,7 +59,7 @@
var/new_bearing
if(free_rotate)
new_bearing = input(usr, "What bearing do you want to rotate \the [src] to?", "[name]") as num
new_bearing = tgui_input_number(usr, "What bearing do you want to rotate \the [src] to?", "[name]")
new_bearing = round(new_bearing)
if(new_bearing <= -1 || new_bearing > 360)
to_chat(user, "<span class='warning'>Rotating \the [src] [new_bearing] degrees would be a waste of time.</span>")
@@ -176,7 +176,7 @@
var/new_bearing
if(free_rotate)
new_bearing = input(usr, "What bearing do you want to rotate \the [src] to?", "[name]") as num
new_bearing = tgui_input_number(usr, "What bearing do you want to rotate \the [src] to?", "[name]")
new_bearing = round(new_bearing)
if(new_bearing <= -1 || new_bearing > 360)
to_chat(user, "<span class='warning'>Rotating \the [src] [new_bearing] degrees would be a waste of time.</span>")

View File

@@ -70,7 +70,7 @@
return TRUE
/obj/structure/windoor_assembly/proc/rename_door(mob/living/user)
var/t = sanitizeSafe(input(user, "Enter the name for the windoor.", src.name, src.created_name), MAX_NAME_LEN)
var/t = sanitizeSafe(tgui_input_text(user, "Enter the name for the windoor.", src.name, src.created_name, MAX_NAME_LEN), MAX_NAME_LEN)
if(!in_range(src, user) && src.loc != user) return
created_name = t
update_state()

View File

@@ -612,7 +612,7 @@
to_chat(user, "<span class='notice'>\The [src] is linked to \the [buffered_button].</span>")
return TRUE
// Otherwise fall back to asking them
var/t = sanitizeSafe(input(user, "Enter the ID for the window.", src.name, null), MAX_NAME_LEN)
var/t = sanitizeSafe(tgui_input_text(user, "Enter the ID for the window.", src.name, null, MAX_NAME_LEN), MAX_NAME_LEN)
if (!t && user.get_active_hand() != W && in_range(src, user))
src.id = t
to_chat(user, "<span class='notice'>The new ID of \the [src] is [id]</span>")
@@ -667,7 +667,7 @@
var/obj/item/device/multitool/MT = W
if(!id)
// If no ID is set yet (newly built button?) let them select an ID for first-time use!
var/t = sanitizeSafe(input(user, "Enter an ID for \the [src].", src.name, null), MAX_NAME_LEN)
var/t = sanitizeSafe(tgui_input_text(user, "Enter an ID for \the [src].", src.name, null, MAX_NAME_LEN), MAX_NAME_LEN)
if (t && user.get_active_hand() != W && in_range(src, user))
src.id = t
to_chat(user, "<span class='notice'>The new ID of \the [src] is [id]</span>")

View File

@@ -331,7 +331,7 @@
to_chat(vandal, "<span class='warning'>There's too much graffiti here to add more.</span>")
return FALSE
var/message = sanitize(input(usr, "Enter a message to engrave.", "Graffiti") as null|text, trim = TRUE)
var/message = sanitize(tgui_input_text(usr, "Enter a message to engrave.", "Graffiti"), trim = TRUE)
if(!message)
return FALSE

View File

@@ -7,7 +7,7 @@
to_chat(src, "Only administrators may use this command.")
return
var/input = sanitize(input(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", custom_event_msg) as message|null, MAX_PAPER_MESSAGE_LEN, extra = 0)
var/input = sanitize(tgui_input_text(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", custom_event_msg, MAX_PAPER_MESSAGE_LEN, TRUE), MAX_PAPER_MESSAGE_LEN, extra = 0)
if(!input || input == "")
custom_event_msg = null
log_admin("[usr.key] has cleared the custom event text.")

View File

@@ -21,7 +21,7 @@
to_chat(usr, "This can only be used on instances of type /mob")
return
var/new_name = sanitize(input(usr,"What would you like to name this mob?","Input a name",M.real_name) as text|null, MAX_NAME_LEN)
var/new_name = sanitize(tgui_input_text(usr,"What would you like to name this mob?","Input a name",M.real_name,MAX_NAME_LEN), MAX_NAME_LEN)
if( !new_name || !M ) return
message_admins("Admin [key_name_admin(usr)] renamed [key_name_admin(M)] to [new_name].")

View File

@@ -478,7 +478,7 @@
if(usr.incapacitated())
return
if(ishuman(usr) || istype(usr, /mob/living/silicon/robot))
casinoslave_price = tgui_input_number("Select the desired price (1-1000)", "Set Price", null, null, 1000, 1)
casinoslave_price = tgui_input_number(usr, "Select the desired price (1-1000)", "Set Price", null, null, 1000, 1)
if(casinoslave_price>1000 || casinoslave_price<1)
to_chat(user,"<span class='notice'>Invalid price.</span> ")
return

View File

@@ -44,7 +44,7 @@ var/global/list/uplink_locations = list("PDA", "Headset", "None")
return TOPIC_REFRESH
if(href_list["exploitable_record"])
var/exploitmsg = sanitize(input(user,"Set exploitable information about you here.","Exploitable Information", html_decode(pref.exploit_record)) as message|null, MAX_RECORD_LENGTH, extra = 0)
var/exploitmsg = sanitize(tgui_input_text(user,"Set exploitable information about you here.","Exploitable Information", html_decode(pref.exploit_record), MAX_RECORD_LENGTH, TRUE), MAX_RECORD_LENGTH, extra = 0)
if(!isnull(exploitmsg) && !jobban_isbanned(user, "Records") && CanUseTopic(user))
pref.exploit_record = exploitmsg
return TOPIC_REFRESH
@@ -54,7 +54,7 @@ var/global/list/uplink_locations = list("PDA", "Headset", "None")
if(!choice || !CanUseTopic(user))
return TOPIC_NOACTION
if(choice == "Other")
var/raw_choice = sanitize(input(user, "Please enter a faction.", "Character Preference") as text|null, MAX_NAME_LEN)
var/raw_choice = sanitize(tgui_input_text(user, "Please enter a faction.", "Character Preference", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(raw_choice)
pref.antag_faction = raw_choice
else

View File

@@ -71,7 +71,7 @@
if(!choice || !CanUseTopic(user))
return TOPIC_NOACTION
if(choice == "Other")
var/raw_choice = sanitize(input(user, "Please enter a home system.", "Character Preference") as text|null, MAX_NAME_LEN)
var/raw_choice = sanitize(tgui_input_text(user, "Please enter a home system.", "Character Preference", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(raw_choice && CanUseTopic(user))
pref.home_system = raw_choice
else
@@ -83,7 +83,7 @@
if(!choice || !CanUseTopic(user))
return TOPIC_NOACTION
if(choice == "Other")
var/raw_choice = sanitize(input(user, "Please enter your current citizenship.", "Character Preference") as text|null, MAX_NAME_LEN)
var/raw_choice = sanitize(tgui_input_text(user, "Please enter your current citizenship.", "Character Preference", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(raw_choice && CanUseTopic(user))
pref.citizenship = raw_choice
else
@@ -95,7 +95,7 @@
if(!choice || !CanUseTopic(user))
return TOPIC_NOACTION
if(choice == "Other")
var/raw_choice = sanitize(input(user, "Please enter a faction.", "Character Preference") as text|null, MAX_NAME_LEN)
var/raw_choice = sanitize(tgui_input_text(user, "Please enter a faction.", "Character Preference", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(raw_choice)
pref.faction = raw_choice
else
@@ -107,7 +107,7 @@
if(!choice || !CanUseTopic(user))
return TOPIC_NOACTION
if(choice == "Other")
var/raw_choice = sanitize(input(user, "Please enter a religon.", "Character Preference") as text|null, MAX_NAME_LEN)
var/raw_choice = sanitize(tgui_input_text(user, "Please enter a religon.", "Character Preference", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(raw_choice)
pref.religion = sanitize(raw_choice)
else
@@ -115,19 +115,19 @@
return TOPIC_REFRESH
else if(href_list["set_medical_records"])
var/new_medical = sanitize(input(user,"Enter medical information here.","Character Preference", html_decode(pref.med_record)) as message|null, MAX_RECORD_LENGTH, extra = 0)
var/new_medical = sanitize(tgui_input_text(user,"Enter medical information here.","Character Preference", html_decode(pref.med_record), MAX_RECORD_LENGTH, TRUE), MAX_RECORD_LENGTH, extra = 0)
if(!isnull(new_medical) && !jobban_isbanned(user, "Records") && CanUseTopic(user))
pref.med_record = new_medical
return TOPIC_REFRESH
else if(href_list["set_general_records"])
var/new_general = sanitize(input(user,"Enter employment information here.","Character Preference", html_decode(pref.gen_record)) as message|null, MAX_RECORD_LENGTH, extra = 0)
var/new_general = sanitize(tgui_input_text(user,"Enter employment information here.","Character Preference", html_decode(pref.gen_record), MAX_RECORD_LENGTH, TRUE), MAX_RECORD_LENGTH, extra = 0)
if(!isnull(new_general) && !jobban_isbanned(user, "Records") && CanUseTopic(user))
pref.gen_record = new_general
return TOPIC_REFRESH
else if(href_list["set_security_records"])
var/sec_medical = sanitize(input(user,"Enter security information here.","Character Preference", html_decode(pref.sec_record)) as message|null, MAX_RECORD_LENGTH, extra = 0)
var/sec_medical = sanitize(tgui_input_text(user,"Enter security information here.","Character Preference", html_decode(pref.sec_record), MAX_RECORD_LENGTH, TRUE), MAX_RECORD_LENGTH, extra = 0)
if(!isnull(sec_medical) && !jobban_isbanned(user, "Records") && CanUseTopic(user))
pref.sec_record = sec_medical
return TOPIC_REFRESH

View File

@@ -100,7 +100,7 @@
return TOPIC_REFRESH
else if(href_list["select_client_fps"])
var/fps_new = tgui_input_number(user, "Input Client FPS (1-200, 0 uses server FPS)", "Global Preference", pref.client_fps, 200, 1)
var/fps_new = tgui_input_number(user, "Input Client FPS (1-200, 0 uses server FPS)", "Global Preference", pref.client_fps, 200, 0)
if(isnull(fps_new) || !CanUseTopic(user)) return TOPIC_NOACTION
if(fps_new < 0 || fps_new > MAX_CLIENT_FPS) return TOPIC_NOACTION
pref.client_fps = fps_new
@@ -155,4 +155,4 @@
return ..()
/datum/category_item/player_setup_item/player_global/ui/proc/can_select_ooc_color(var/mob/user)
return config.allow_admin_ooccolor && check_rights(R_ADMIN|R_EVENT|R_FUN, 0, user)
return config.allow_admin_ooccolor && check_rights(R_ADMIN|R_EVENT|R_FUN, 0, user)

View File

@@ -42,7 +42,7 @@
var/t
switch(href_list["option"])
if("name")
t = sanitizeName(input(user, "Enter a name for your pAI", "Global Preference", candidate.name) as text|null, MAX_NAME_LEN, 1)
t = sanitizeName(tgui_input_text(user, "Enter a name for your pAI", "Global Preference", candidate.name, MAX_NAME_LEN), MAX_NAME_LEN, 1)
if(t && CanUseTopic(user))
candidate.name = t
if("desc")

View File

@@ -172,7 +172,7 @@ var/datum/gear_tweak/custom_name/gear_tweak_free_name = new()
return
if(valid_custom_names)
return tgui_input_list(user, "Choose an item name.", "Character Preference", valid_custom_names, metadata)
var/san_input = sanitize(input(user, "Choose the item's name. Leave it blank to use the default name.", "Item Name", metadata) as text|null, MAX_LNAME_LEN, extra = 0)
var/san_input = sanitize(tgui_input_text(user, "Choose the item's name. Leave it blank to use the default name.", "Item Name", metadata, MAX_LNAME_LEN), MAX_LNAME_LEN, extra = 0)
return san_input ? san_input : get_default()
/datum/gear_tweak/custom_name/tweak_item(var/obj/item/I, var/metadata)
@@ -204,7 +204,7 @@ var/datum/gear_tweak/custom_desc/gear_tweak_free_desc = new()
return
if(valid_custom_desc)
return tgui_input_list(user, "Choose an item description.", "Character Preference",valid_custom_desc, metadata)
var/san_input = sanitize(input(user, "Choose the item's description. Leave it blank to use the default description.", "Item Description", metadata) as message|null, extra = 0)
var/san_input = sanitize(tgui_input_text(user, "Choose the item's description. Leave it blank to use the default description.", "Item Description", metadata, multiline = TRUE), extra = 0)
return san_input ? san_input : get_default()
/datum/gear_tweak/custom_desc/tweak_item(var/obj/item/I, var/metadata)

View File

@@ -5,7 +5,7 @@
return ""
/datum/gear_tweak/collar_tag/get_metadata(var/user, var/metadata)
return sanitize( input(user, "Choose the tag text", "Character Preference", metadata) as text , MAX_NAME_LEN )
return sanitize( tgui_input_text(user, "Choose the tag text", "Character Preference", metadata, MAX_NAME_LEN), MAX_NAME_LEN )
/datum/gear_tweak/collar_tag/tweak_item(var/obj/item/clothing/accessory/collar/C, var/metadata)
if(metadata == "")

View File

@@ -223,8 +223,8 @@
return TOPIC_NOACTION
else if(href_list["custom_species"])
var/raw_choice = sanitize(input(user, "Input your custom species name:",
"Character Preference", pref.custom_species) as null|text, MAX_NAME_LEN)
var/raw_choice = sanitize(tgui_input_text(user, "Input your custom species name:",
"Character Preference", pref.custom_species, MAX_NAME_LEN), MAX_NAME_LEN)
if (CanUseTopic(user))
pref.custom_species = raw_choice
return TOPIC_REFRESH
@@ -275,25 +275,25 @@
return TOPIC_REFRESH
else if(href_list["custom_say"])
var/say_choice = sanitize(input(usr, "This word or phrase will appear instead of 'says': [pref.real_name] says, \"Hi.\"", "Custom Say", pref.custom_say) as null|text, 12)
var/say_choice = sanitize(tgui_input_text(usr, "This word or phrase will appear instead of 'says': [pref.real_name] says, \"Hi.\"", "Custom Say", pref.custom_say, 12), 12)
if(say_choice)
pref.custom_say = say_choice
return TOPIC_REFRESH
else if(href_list["custom_whisper"])
var/whisper_choice = sanitize(input(usr, "This word or phrase will appear instead of 'whispers': [pref.real_name] whispers, \"Hi...\"", "Custom Whisper", pref.custom_whisper) as null|text, 12)
var/whisper_choice = sanitize(tgui_input_text(usr, "This word or phrase will appear instead of 'whispers': [pref.real_name] whispers, \"Hi...\"", "Custom Whisper", pref.custom_whisper, 12), 12)
if(whisper_choice)
pref.custom_whisper = whisper_choice
return TOPIC_REFRESH
else if(href_list["custom_ask"])
var/ask_choice = sanitize(input(usr, "This word or phrase will appear instead of 'asks': [pref.real_name] asks, \"Hi?\"", "Custom Ask", pref.custom_ask) as null|text, 12)
var/ask_choice = sanitize(tgui_input_text(usr, "This word or phrase will appear instead of 'asks': [pref.real_name] asks, \"Hi?\"", "Custom Ask", pref.custom_ask, 12), 12)
if(ask_choice)
pref.custom_ask = ask_choice
return TOPIC_REFRESH
else if(href_list["custom_exclaim"])
var/exclaim_choice = sanitize(input(usr, "This word or phrase will appear instead of 'exclaims', 'shouts' or 'yells': [pref.real_name] exclaims, \"Hi!\"", "Custom Exclaim", pref.custom_exclaim) as null|text, 12)
var/exclaim_choice = sanitize(tgui_input_text(usr, "This word or phrase will appear instead of 'exclaims', 'shouts' or 'yells': [pref.real_name] exclaims, \"Hi!\"", "Custom Exclaim", pref.custom_exclaim, 12), 12)
if(exclaim_choice)
pref.custom_exclaim = exclaim_choice
return TOPIC_REFRESH

View File

@@ -151,7 +151,7 @@ GLOBAL_DATUM(character_directory, /datum/character_directory)
return
var/current_ad = usr.client.prefs.directory_ad
var/new_ad = sanitize(input(usr, "Change your character ad", "Character Ad", current_ad) as message|null, extra = 0)
var/new_ad = sanitize(tgui_input_text(usr, "Change your character ad", "Character Ad", current_ad, multiline = TRUE), extra = 0)
if(isnull(new_ad))
return
usr.client.prefs.directory_ad = new_ad

View File

@@ -187,7 +187,7 @@
var/new_frequency = sanitize_frequency(frequency + text2num(href_list["freq"]))
set_frequency(new_frequency)
if(href_list["tag"])
var/str = copytext(reject_bad_text(input(usr,"Tag text?","Set tag","")),1,MAX_NAME_LEN)
var/str = copytext(reject_bad_text(tgui_input_text(usr,"Tag text?","Set tag","",MAX_NAME_LEN)),1,MAX_NAME_LEN)
if(!str || !length(str))
to_chat(usr,"<span class='notice'>[name]'s tag set to be blank.</span>")
name = initial(name)
@@ -319,7 +319,7 @@
return
to_chat(user,"<span class='notice'>You adjust the [name]'s tag.</span>")
var/str = copytext(reject_bad_text(input(user,"Tag text?","Set tag","")),1,MAX_NAME_LEN)
var/str = copytext(reject_bad_text(tgui_input_text(user,"Tag text?","Set tag","",MAX_NAME_LEN)),1,MAX_NAME_LEN)
if(!str || !length(str))
to_chat(user,"<span class='notice'>[name]'s tag set to be blank.</span>")
@@ -356,7 +356,7 @@
if(!(istype(user.get_active_hand(),I)) || !(istype(user.get_inactive_hand(),src)) || (user.stat))
return
var/str = copytext(reject_bad_text(input(user,"Tag text?","Set tag","")),1,MAX_NAME_LEN)
var/str = copytext(reject_bad_text(tgui_input_text(user,"Tag text?","Set tag","",MAX_NAME_LEN)),1,MAX_NAME_LEN)
if(!str || !length(str))
if(!writtenon)

View File

@@ -54,7 +54,7 @@
if(act == "custom")
if(!message)
message = sanitize_or_reflect(input(src,"Choose an emote to display.") as text|null, src) //VOREStation Edit - Reflect too long messages, within reason
message = sanitize_or_reflect(tgui_input_text(src,"Choose an emote to display."), src) //VOREStation Edit - Reflect too long messages, within reason
if(!message)
return
if (!m_type)
@@ -165,7 +165,7 @@
var/input
if(!message)
input = sanitize(input(src,"Choose an emote to display.") as text|null)
input = sanitize(tgui_input_text(src,"Choose an emote to display."))
else
input = message

View File

@@ -188,7 +188,7 @@
if(P.name != "Blank Card")
to_chat(user,"<span class = 'notice'>You cannot write on that card.</span>")
return
var/cardtext = sanitize(input(user, "What do you wish to write on the card?", "Card Editing") as text|null, MAX_PAPER_MESSAGE_LEN)
var/cardtext = sanitize(tgui_input_text(user, "What do you wish to write on the card?", "Card Editing", null, MAX_PAPER_MESSAGE_LEN), MAX_PAPER_MESSAGE_LEN)
if(!cardtext)
return
P.name = cardtext

View File

@@ -93,7 +93,7 @@ var/list/ghost_traps
// Allows people to set their own name. May or may not need to be removed for posibrains if people are dumbasses.
/datum/ghosttrap/proc/set_new_name(var/mob/target)
var/newname = sanitizeSafe(input(target,"Enter a name, or leave blank for the default name.", "Name change","") as text, MAX_NAME_LEN)
var/newname = sanitizeSafe(tgui_input_text(target,"Enter a name, or leave blank for the default name.", "Name change","", MAX_NAME_LEN), MAX_NAME_LEN)
if (newname != "")
target.real_name = newname
target.name = target.real_name

View File

@@ -176,7 +176,7 @@
if(!check_interactivity(M))
return
var/input = sanitizeSafe(input(usr, "What do you want to name this?", "Rename", src.name) as null|text, MAX_NAME_LEN)
var/input = sanitizeSafe(tgui_input_text(usr, "What do you want to name this?", "Rename", src.name, MAX_NAME_LEN), MAX_NAME_LEN)
if(src && input)
to_chat(M, "<span class='notice'>The machine now has a label reading '[input]'.</span>")
name = input

View File

@@ -68,7 +68,7 @@ a creative player the means to solve many problems. Circuits are held inside an
if(!check_interactivity(M))
return
var/input = sanitizeSafe(input(usr, "What do you want to name the circuit?", "Rename", src.name) as null|text, MAX_NAME_LEN)
var/input = sanitizeSafe(tgui_input_text(usr, "What do you want to name the circuit?", "Rename", src.name, MAX_NAME_LEN), MAX_NAME_LEN)
if(src && input && assembly.check_interactivity(M))
to_chat(M, "<span class='notice'>The circuit '[src.name]' is now labeled '[input]'.</span>")
displayed_name = input

View File

@@ -159,7 +159,7 @@ list[](
to_chat(user, "<span class='notice'>You input [new_data] into the pin.</span>")
return new_data
if("number")
new_data = input(usr, "Now type in a number.","[src] number writing", isnum(default) ? default : null) as null|num
new_data = tgui_input_number(usr, "Now type in a number.","[src] number writing", isnum(default) ? default : null)
if(isnum(new_data) && holder.check_interactivity(user) )
to_chat(user, "<span class='notice'>You input [new_data] into the pin.</span>")
return new_data

View File

@@ -3,7 +3,7 @@
name = "char pin"
/datum/integrated_io/char/ask_for_pin_data(mob/user)
var/new_data = input(usr, "Please type in one character.","[src] char writing") as null|text
var/new_data = tgui_input_text(usr, "Please type in one character.","[src] char writing")
if(holder.check_interactivity(user) )
to_chat(user, "<span class='notice'>You input [new_data ? "new_data" : "NULL"] into the pin.</span>")
write_data_to_pin(new_data)

View File

@@ -3,7 +3,7 @@
name = "dir pin"
/datum/integrated_io/dir/ask_for_pin_data(mob/user)
var/new_data = input(usr, "Please type in a valid dir number. \
var/new_data = tgui_input_number(usr, "Please type in a valid dir number. \
Valid dirs are;\n\
North/Fore = [NORTH],\n\
South/Aft = [SOUTH],\n\
@@ -14,7 +14,7 @@
Southeast = [SOUTHEAST],\n\
Southwest = [SOUTHWEST],\n\
Up = [UP],\n\
Down = [DOWN]","[src] dir writing") as null|num
Down = [DOWN]","[src] dir writing")
if(isnum(new_data) && holder.check_interactivity(user) )
to_chat(user, "<span class='notice'>You input [new_data] into the pin.</span>")
write_data_to_pin(new_data)

View File

@@ -4,7 +4,7 @@
// data = 0
/datum/integrated_io/number/ask_for_pin_data(mob/user)
var/new_data = input(usr, "Please type in a number.","[src] number writing") as null|num
var/new_data = tgui_input_number(usr, "Please type in a number.","[src] number writing")
if(isnum(new_data) && holder.check_interactivity(user) )
to_chat(user, "<span class='notice'>You input [new_data] into the pin.</span>")
write_data_to_pin(new_data)

View File

@@ -129,7 +129,7 @@
to_chat(user, "<span class='notice'>You set \the [src]'s memory to \"[new_data]\".</span>")
if("number")
accepting_refs = 0
new_data = input(usr, "Now type in a number.","[src] number writing") as null|num
new_data = tgui_input_number(usr, "Now type in a number.","[src] number writing")
if(isnum(new_data) && CanInteract(user, GLOB.tgui_physical_state))
data_to_write = new_data
to_chat(user, "<span class='notice'>You set \the [src]'s memory to [new_data].</span>")

View File

@@ -53,7 +53,7 @@
power_draw_per_use = 4
/obj/item/integrated_circuit/input/numberpad/ask_for_input(mob/user)
var/new_input = input(user, "Enter a number, please.","Number pad", get_pin_data(IC_OUTPUT, 1)) as null|num
var/new_input = tgui_input_number(user, "Enter a number, please.","Number pad", get_pin_data(IC_OUTPUT, 1))
if(isnum(new_input) && CanInteract(user, GLOB.tgui_physical_state))
set_pin_data(IC_OUTPUT, 1, new_input)
push_data()

View File

@@ -33,7 +33,7 @@
O.loc = src
update_icon()
else if(istype(O, /obj/item/weapon/pen))
var/newname = sanitizeSafe(input(usr, "What would you like to title this bookshelf?"), MAX_NAME_LEN)
var/newname = sanitizeSafe(tgui_input_text(usr, "What would you like to title this bookshelf?", null, null, MAX_NAME_LEN), MAX_NAME_LEN)
if(!newname)
return
else

View File

@@ -371,7 +371,7 @@
if(href_list["editbook"])
buffer_book = sanitizeSafe(tgui_input_text(usr, "Enter the book's title:"))
if(href_list["editmob"])
buffer_mob = sanitize(input(usr, "Enter the recipient's name:") as text|null, MAX_NAME_LEN)
buffer_mob = sanitize(tgui_input_text(usr, "Enter the recipient's name:", null, null, MAX_NAME_LEN), MAX_NAME_LEN)
if(href_list["checkout"])
var/datum/borrowbook/b = new /datum/borrowbook
b.bookname = sanitizeSafe(buffer_book)
@@ -386,7 +386,7 @@
var/obj/item/weapon/book/b = locate(href_list["delbook"])
inventory.Remove(b)
if(href_list["setauthor"])
var/newauthor = sanitize(input(usr, "Enter the author's name: ") as text|null)
var/newauthor = sanitize(tgui_input_text(usr, "Enter the author's name: "))
if(newauthor)
scanner.cache.author = newauthor
if(href_list["setcategory"])
@@ -458,7 +458,7 @@
qdel(query) //CHOMPEdit TGSQL
if(href_list["orderbyid"])
var/orderid = input(usr, "Enter your order:") as num|null
var/orderid = tgui_input_number(usr, "Enter your order:")
if(orderid)
if(isnum(orderid))
var/nhref = "src=\ref[src];targetid=[orderid]"

View File

@@ -163,4 +163,4 @@
desc = "A handmade blindfold that covers the eyes, preventing sight."
/obj/item/clothing/accessory/collar/craftable/attack_self(mob/living/user as mob)
given_name = sanitizeSafe(input(usr, "What would you like to label the collar?", "Collar Labelling", null) as text, MAX_NAME_LEN)
given_name = sanitizeSafe(tgui_input_text(usr, "What would you like to label the collar?", "Collar Labelling", null, MAX_NAME_LEN), MAX_NAME_LEN)

View File

@@ -173,7 +173,7 @@
/obj/machinery/mining/drill/attackby(obj/item/O as obj, mob/user as mob)
if(!active)
if(istype(O, /obj/item/device/multitool))
var/newtag = text2num(sanitizeSafe(input(user, "Enter new ID number or leave empty to cancel.", "Assign ID number") as text, 4))
var/newtag = text2num(sanitizeSafe(tgui_input_text(user, "Enter new ID number or leave empty to cancel.", "Assign ID number", null, 4), 4))
if(newtag)
name = "[initial(name)] #[newtag]"
to_chat(user, "<span class='notice'>You changed the drill ID to: [newtag]</span>")

View File

@@ -763,7 +763,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
var/max_length = 50
var/message = sanitize(input(usr, "Write a message. It cannot be longer than [max_length] characters.","Blood writing", ""))
var/message = sanitize(tgui_input_text(usr, "Write a message. It cannot be longer than [max_length] characters.","Blood writing", "", max_length))
if (message)
@@ -977,8 +977,15 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set category = "Ghost"
set name = "Blank pAI alert"
set desc = "Flash an indicator light on available blank pAI devices for a smidgen of hope."
if(jobban_isbanned(usr, "pAI"))
to_chat(usr,"<span class='warning'>You cannot alert pAI cards when you are banned from playing as a pAI.</span>")
return
if(usr.client.prefs?.be_special & BE_PAI)
var/choice = tgui_alert(usr, "Would you like to submit yourself to the recruitment list too?", "Confirmation", list("No", "Yes"))
if(choice == "Yes")
paiController.recruitWindow(usr)
var/count = 0
for(var/obj/item/device/paicard/p in GLOB.all_pai_cards)
var/obj/item/device/paicard/PP = p

View File

@@ -23,7 +23,7 @@
var/input
if(!message)
input = sanitize_or_reflect(input(src, "Choose an emote to display.") as text|null, src) //VOREStation Edit - Reflect too long messages, within reason
input = sanitize_or_reflect(tgui_input_text(src, "Choose an emote to display."), src) //VOREStation Edit - Reflect too long messages, within reason
else
input = message

View File

@@ -67,7 +67,7 @@
/obj/item/weapon/secbot_assembly/ed209_assembly/slime/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) // Here in the event it's added into a PoI or some such. Standard construction relies on the standard ED up until taser.
if(istype(W, /obj/item/weapon/pen))
var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, usr) && src.loc != usr)

View File

@@ -264,7 +264,7 @@
qdel(src)
else if(istype(W, /obj/item/weapon/pen))
var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, usr) && src.loc != usr)

View File

@@ -87,7 +87,7 @@
..()
if(istype(W, /obj/item/weapon/pen))
var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, usr) && src.loc != usr)

View File

@@ -121,7 +121,7 @@
..()
if(istype(W, /obj/item/weapon/pen))
var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, usr) && src.loc != usr)

View File

@@ -409,7 +409,7 @@
qdel(src)
else if(istype(W, /obj/item/weapon/pen))
var/t = input(user, "Enter new robot name", name, created_name) as text
var/t = tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN)
t = sanitize(t, MAX_NAME_LEN)
if(!t)
return

View File

@@ -382,7 +382,7 @@
user.drop_from_inventory(src)
qdel(src)
else if (istype(W, /obj/item/weapon/pen))
var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, user) && loc != user)
@@ -412,7 +412,7 @@
user.drop_from_inventory(src)
qdel(src)
else if(istype(W, /obj/item/weapon/pen))
var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, user) && loc != user)

View File

@@ -536,7 +536,7 @@
/obj/item/weapon/firstaid_arm_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
if(istype(W, /obj/item/weapon/pen))
var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, usr) && loc != usr)

View File

@@ -473,7 +473,7 @@
qdel(src)
else if(istype(W, /obj/item/weapon/pen))
var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, user) && loc != user)

View File

@@ -36,7 +36,7 @@
if(mind)
mind.transfer_to(adult)
if (can_namepick_as_adult)
var/newname = sanitize(input(adult, "You have become an adult. Choose a name for yourself.", "Adult Name") as null|text, MAX_NAME_LEN)
var/newname = sanitize(tgui_input_text(adult, "You have become an adult. Choose a name for yourself.", "Adult Name", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(!newname)
adult.fully_replace_character_name(name, "[src.adult_name] ([instance_num])")

View File

@@ -14,7 +14,7 @@
return
if(status_flags & HIDING)
reveal("<span class='notice'>You have stopped hiding.</span>")
reveal(FALSE, "<span class='notice'>You have stopped hiding.</span>")
else
status_flags |= HIDING
layer = HIDING_LAYER //Just above cables with their 2.44

View File

@@ -22,7 +22,7 @@
var/list/software = list()
var/userDNA // The DNA string of our assigned user
var/obj/item/device/paicard/card // The card we inhabit
var/obj/item/device/radio/radio // Our primary radio
var/obj/item/device/radio/borg/pai/radio // Our primary radio
var/obj/item/device/communicator/integrated/communicator // Our integrated communicator.
var/chassis = "pai-repairbot" // A record of your chosen chassis.
@@ -111,7 +111,7 @@
communicator = new(src)
if(card)
if(!card.radio)
card.radio = new /obj/item/device/radio(src.card)
card.radio = new /obj/item/device/radio/borg/pai(src.card)
radio = card.radio
//Default languages without universal translator software
@@ -134,7 +134,7 @@
var/datum/data/pda/app/messenger/M = pda.find_program(/datum/data/pda/app/messenger)
if(M)
M.toff = TRUE
M.toff = FALSE
..()
/mob/living/silicon/pai/Login()
@@ -143,7 +143,6 @@
if (client.prefs)
ooc_notes = client.prefs.metadata
// this function shows the information about being silenced as a pAI in the Status panel
/mob/living/silicon/pai/proc/show_silenced()
if(src.silence_time)
@@ -402,12 +401,14 @@
M.drop_from_inventory(H)
H.loc = get_turf(src)
src.loc = get_turf(H)
// Move us into the card and move the card to the ground.
src.loc = card
card.loc = get_turf(card)
src.forceMove(card)
card.forceMove(card.loc)
if(isbelly(loc)) //If in tumby, when fold up, card go into tumby
var/obj/belly/B = loc
src.forceMove(card)
card.forceMove(B)
else //Otherwise go on floor
src.forceMove(card)
card.forceMove(get_turf(card))
canmove = 1
resting = 0
icon_state = "[chassis]"
@@ -440,11 +441,15 @@
idcard.access |= ID.access
to_chat(user, "<span class='notice'>You add the access from the [W] to [src].</span>")
to_chat(src, "<span class='notice'>\The [user] swipes the [W] over you. You copy the access codes.</span>")
if(radio)
radio.recalculateChannels()
return
if("Remove Access")
idcard.access = list()
to_chat(user, "<span class='notice'>You remove the access from [src].</span>")
to_chat(src, "<span class='warning'>\The [user] swipes the [W] over you, removing access codes from you.</span>")
if(radio)
radio.recalculateChannels()
return
if("Cancel")
return

View File

@@ -3,6 +3,7 @@
icon = 'icons/mob/pai_vr.dmi'
softfall = TRUE
var/eye_glow = TRUE
var/hide_glow = FALSE
var/image/eye_layer = null // Holds the eye overlay.
var/eye_color = "#00ff0d"
var/global/list/wide_chassis = list(
@@ -54,7 +55,6 @@
/mob/living/silicon/pai/Initialize()
. = ..()
verbs |= /mob/living/proc/hide
verbs |= /mob/proc/dominate_predator
verbs |= /mob/living/proc/dominate_prey
verbs |= /mob/living/proc/set_size
@@ -155,10 +155,11 @@
set category = "pAI Commands"
set name = "Toggle Eye Glow"
if(chassis in allows_eye_color)
if(eye_glow)
if(eye_glow && !hide_glow)
eye_glow = FALSE
else
eye_glow = TRUE
hide_glow = FALSE
update_icon()
else
to_chat(src, "Your selected chassis cannot modify its eye glow!")
@@ -190,7 +191,7 @@
eye_layer = image(icon, "[icon_state]-eyes")
eye_layer.appearance_flags = appearance_flags
eye_layer.color = eye_color
if(eye_glow)
if(eye_glow && !hide_glow)
eye_layer.plane = PLANE_LIGHTING_ABOVE
add_overlay(eye_layer)
@@ -370,9 +371,6 @@
if(!new_gender_identity)
return 0
gender = new_gender_identity
<<<<<<< HEAD
return 1
=======
return 1
/mob/living/silicon/pai/verb/pai_hide()
@@ -546,5 +544,4 @@
touch_window("Door Jack")
/mob/living/silicon/pai/proc/ar_hud()
touch_window("AR HUD")
>>>>>>> 950b23cc87... Merge pull request #13142 from Very-Soft/morepaiinterface
touch_window("AR HUD")

View File

@@ -69,7 +69,7 @@ var/datum/paiController/paiController // Global handler for pAI candidates
switch(option)
if("name")
t = sanitizeSafe(input(usr, "Enter a name for your pAI", "pAI Name", candidate.name) as text, MAX_NAME_LEN)
t = sanitizeSafe(tgui_input_text(usr, "Enter a name for your pAI", "pAI Name", candidate.name, MAX_NAME_LEN), MAX_NAME_LEN)
if(t)
candidate.name = t
if("desc")

View File

@@ -358,7 +358,7 @@
spawn(0)
var/newname
newname = sanitizeSafe(input(src,"You are a robot. Enter a name, or leave blank for the default name.", "Name change","") as text, MAX_NAME_LEN)
newname = sanitizeSafe(tgui_input_text(src,"You are a robot. Enter a name, or leave blank for the default name.", "Name change","", MAX_NAME_LEN), MAX_NAME_LEN)
if (newname)
custom_name = newname
sprite_name = newname

View File

@@ -300,7 +300,7 @@
/obj/item/weapon/pen/robopen/proc/RenamePaper(mob/user, obj/item/weapon/paper/paper)
if ( !user || !paper )
return
var/n_name = sanitizeSafe(input(user, "What would you like to label the paper?", "Paper Labelling", null) as text, 32)
var/n_name = sanitizeSafe(tgui_input_text(user, "What would you like to label the paper?", "Paper Labelling", null, 32), 32)
if ( !user || !paper )
return

View File

@@ -257,7 +257,7 @@ var/list/_cat_default_emotes = list(
if(named)
to_chat(user, "<span class='notice'>\The [name] already has a name!</span>")
else
var/tmp_name = sanitizeSafe(input(user, "Give \the [name] a name", "Name"), MAX_NAME_LEN)
var/tmp_name = sanitizeSafe(tgui_input_text(user, "Give \the [name] a name", "Name", null, MAX_NAME_LEN), MAX_NAME_LEN)
if(length(tmp_name) > 50)
to_chat(user, "<span class='notice'>The name can be at most 50 characters long.</span>")
else

View File

@@ -19,7 +19,7 @@
to_chat(src, "<span class='userdanger'>You've already set your name. Ask an admin to toggle \"nameset\" to 0 if you really must.</span>")
return
var/newname
newname = sanitizeSafe(input(src,"Set your name. You only get to do this once. Max 52 chars.", "Name set","") as text, MAX_NAME_LEN)
newname = sanitizeSafe(tgui_input_text(src,"Set your name. You only get to do this once. Max 52 chars.", "Name set","", MAX_NAME_LEN), MAX_NAME_LEN)
if (newname)
name = newname
voice_name = newname
@@ -30,7 +30,7 @@
set desc = "Set your description."
set category = "Abilities"
var/newdesc
newdesc = sanitizeSafe(input(src,"Set your description. Max 4096 chars.", "Description set","") as text, MAX_MESSAGE_LEN)
newdesc = sanitizeSafe(tgui_input_text(src,"Set your description. Max 4096 chars.", "Description set",""), MAX_MESSAGE_LEN)
if(newdesc)
desc = newdesc

View File

@@ -80,7 +80,7 @@
set desc = "Changes your name."
set src = usr
var/new_name = sanitizeSafe(input(src, "Who would you like to be now?", "Communicator", src.client.prefs.real_name) as text, MAX_NAME_LEN)
var/new_name = sanitizeSafe(tgui_input_text(src, "Who would you like to be now?", "Communicator", src.client.prefs.real_name, MAX_NAME_LEN), MAX_NAME_LEN)
if(new_name)
if(comm)
comm.visible_message("<span class='notice'>[bicon(comm)] [src.name] has left, and now you see [new_name].</span>")

View File

@@ -293,7 +293,7 @@
set src in usr
if(usr != src)
to_chat(usr, "No.")
var/msg = sanitize(input(usr,"Set the flavor text in your 'examine' verb.","Flavor Text",html_decode(flavor_text)) as message|null, extra = 0) //VOREStation Edit: separating out OOC notes
var/msg = sanitize(tgui_input_text(usr,"Set the flavor text in your 'examine' verb.","Flavor Text",html_decode(flavor_text), multiline = TRUE), extra = 0) //VOREStation Edit: separating out OOC notes
if(msg != null)
flavor_text = msg

View File

@@ -142,6 +142,12 @@
color_blend_mode = ICON_MULTIPLY
body_parts = list(BP_R_ARM,BP_L_ARM,BP_R_HAND,BP_L_HAND,BP_R_LEG,BP_L_LEG,BP_R_FOOT,BP_L_FOOT)
/datum/sprite_accessory/marking/ch/sylveonheadribbons1
name = "Sylveon Head Ribbons"
icon_state = "sylveon-bowribbons1"
color_blend_mode = ICON_MULTIPLY
body_parts = list(BP_HEAD)
guilmonhead
name = "Guilmon head"
icon_state = "guilmon_head"

View File

@@ -41,7 +41,6 @@
set_typing_indicator(TRUE)
var/message = tgui_input_text(usr, "Type your message:", "Say")
message = readd_quotes(message)
set_typing_indicator(FALSE)
if(message)
@@ -53,7 +52,6 @@
set_typing_indicator(TRUE)
var/message = tgui_input_text(usr, "Type your message:", "Emote", multiline = TRUE)
message = readd_quotes(message)
set_typing_indicator(FALSE)
if(message)
@@ -65,7 +63,6 @@
set hidden = 1
var/message = tgui_input_text(usr, "Type your message:", "Whisper")
message = readd_quotes(message)
if(message)
whisper(message)
@@ -75,7 +72,5 @@
set hidden = 1
var/message = tgui_input_text(usr, "Type your message:", "Subtle", multiline = TRUE)
message = readd_quotes(message)
if(message)
me_verb_subtle(message)
me_verb_subtle(message)

View File

@@ -63,7 +63,7 @@
var/oldtext = html_decode(F.stored_data)
oldtext = replacetext(oldtext, "\[br\]", "\n")
var/newtext = sanitize(replacetext(input(usr, "Editing file [open_file]. You may use most tags used in paper formatting:", "Text Editor", oldtext) as message|null, "\n", "\[br\]"), MAX_TEXTFILE_LENGTH)
var/newtext = sanitize(replacetext(tgui_input_text(usr, "Editing file [open_file]. You may use most tags used in paper formatting:", "Text Editor", oldtext, MAX_TEXTFILE_LENGTH, TRUE), "\n", "\[br\]"), MAX_TEXTFILE_LENGTH)
if(!newtext)
return

View File

@@ -166,7 +166,7 @@
var/oldtext = html_decode(loaded_data)
oldtext = replacetext(oldtext, "\[br\]", "\n")
var/newtext = sanitize(replacetext(input(usr, "Editing file '[open_file]'. You may use most tags used in paper formatting:", "Text Editor", oldtext) as message|null, "\n", "\[br\]"), MAX_TEXTFILE_LENGTH)
var/newtext = sanitize(replacetext(tgui_input_text(usr, "Editing file '[open_file]'. You may use most tags used in paper formatting:", "Text Editor", oldtext, MAX_TEXTFILE_LENGTH, TRUE), "\n", "\[br\]"), MAX_TEXTFILE_LENGTH)
if(!newtext)
return
loaded_data = newtext

View File

@@ -92,7 +92,7 @@
if(!current_account)
return TRUE
var/newpass = sanitize(input(usr,"Enter new password for account [current_account.login]", "Password"), 100)
var/newpass = sanitize(tgui_input_text(usr,"Enter new password for account [current_account.login]", "Password", null, 100), 100)
if(!newpass)
return TRUE
current_account.password = newpass
@@ -120,7 +120,7 @@
var/newdomain = sanitize(tgui_input_list(usr,"Pick domain:", "Domain name", using_map.usable_email_tlds))
if(!newdomain)
return TRUE
var/newlogin = sanitize(input(usr,"Pick account name (@[newdomain]):", "Account name"), 100)
var/newlogin = sanitize(tgui_input_text(usr,"Pick account name (@[newdomain]):", "Account name", null, 100), 100)
if(!newlogin)
return TRUE

View File

@@ -16,7 +16,7 @@
/obj/structure/ladder_assembly/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/pen))
var/t = sanitizeSafe(input(user, "Enter the name for the ladder.", "Ladder Name", src.created_name), MAX_NAME_LEN)
var/t = sanitizeSafe(tgui_input_text(user, "Enter the name for the ladder.", "Ladder Name", src.created_name, MAX_NAME_LEN), MAX_NAME_LEN)
if(in_range(src, user))
created_name = t
return

View File

@@ -671,7 +671,7 @@ You can also set the stat of a NIF to NIF_TEMPFAIL without any issues to disable
to_chat(src,"<span class='warning'>You don't have a NIF, not sure why this was here.</span>")
return
var/new_flavor = sanitize(input(src,"Describe how your NIF alters your appearance, like glowy eyes or metal plate on your head, etc. Be sensible. Clear this for no examine text. 128ch max.","Describe NIF", nif.examine_msg) as null|text, max_length = 128)
var/new_flavor = sanitize(tgui_input_text(src,"Describe how your NIF alters your appearance, like glowy eyes or metal plate on your head, etc. Be sensible. Clear this for no examine text. 128ch max.","Describe NIF", nif.examine_msg, 128), max_length = 128)
//They clicked cancel or meanwhile lost their NIF
if(!nif || isnull(new_flavor))
return //No changes

View File

@@ -125,10 +125,10 @@
switch(choice)
if("Design Inside")
var/new_flavor = input(nif.human, "Type what the prey sees after being 'caught'. This will be \
var/new_flavor = tgui_input_text(nif.human, "Type what the prey sees after being 'caught'. This will be \
printed after an intro ending with: \"Around you, you see...\" to the prey. If you already \
have prey, this will be printed to them after \"Your surroundings change to...\". Limit 2048 char.", \
"VR Environment", html_decode(inside_flavor)) as message
"VR Environment", html_decode(inside_flavor), MAX_MESSAGE_LEN*2, TRUE)
new_flavor = sanitize(new_flavor, MAX_MESSAGE_LEN*2)
inside_flavor = new_flavor
nif.notify("Updating VR environment...")

View File

@@ -69,7 +69,7 @@
to_chat(user, "<span class='notice'>You put the [W] into \the [src].</span>")
update_icon()
else if(istype(W, /obj/item/weapon/pen))
var/n_name = sanitizeSafe(input(usr, "What would you like to label the folder?", "Folder Labelling", null) as text, MAX_NAME_LEN)
var/n_name = sanitizeSafe(tgui_input_text(usr, "What would you like to label the folder?", "Folder Labelling", null, MAX_NAME_LEN), MAX_NAME_LEN)
if((loc == usr && usr.stat == 0))
name = "folder[(n_name ? text("- '[n_name]'") : null)]"
return

View File

@@ -73,7 +73,7 @@
if(mode)
to_chat(user, SPAN_NOTICE("You turn on \the [src]."))
//Now let them chose the text.
var/str = sanitizeSafe(input(user,"Label text?","Set label",""), MAX_NAME_LEN)
var/str = sanitizeSafe(tgui_input_text(user,"Label text?","Set label","",MAX_NAME_LEN), MAX_NAME_LEN)
if(!str || !length(str))
to_chat(user, SPAN_WARNING("Invalid text."))
return

View File

@@ -179,7 +179,7 @@
if((CLUMSY in usr.mutations) && prob(50))
to_chat(usr, "<span class='warning'>You cut yourself on the paper.</span>")
return
var/n_name = sanitizeSafe(input(usr, "What would you like to label the paper?", "Paper Labelling", null) as text, MAX_NAME_LEN)
var/n_name = sanitizeSafe(tgui_input_text(usr, "What would you like to label the paper?", "Paper Labelling", null, MAX_NAME_LEN), MAX_NAME_LEN)
// We check loc one level up, so we can rename in clipboards and such. See also: /obj/item/weapon/photo/rename()
if((loc == usr || loc.loc && loc.loc == usr) && usr.stat == 0 && n_name)
@@ -448,7 +448,7 @@
to_chat(usr, "<span class='info'>There isn't enough space left on \the [src] to write anything.</span>")
return
var/raw = input(usr, "Enter what you want to write:", "Write") as null|message
var/raw = tgui_input_text(usr, "Enter what you want to write:", "Write", multiline = TRUE)
if(!raw)
return

View File

@@ -192,7 +192,7 @@
set category = "Object"
set src in usr
var/n_name = sanitizeSafe(input(usr, "What would you like to label the bundle?", "Bundle Labelling", null) as text, MAX_NAME_LEN)
var/n_name = sanitizeSafe(tgui_input_text(usr, "What would you like to label the bundle?", "Bundle Labelling", null, MAX_NAME_LEN), MAX_NAME_LEN)
if((loc == usr || loc.loc && loc.loc == usr) && usr.stat == 0)
name = "[(n_name ? text("[n_name]") : "paper")]"
add_fingerprint(usr)

View File

@@ -34,7 +34,7 @@
if(writing_space <= 0)
to_chat(user, SPAN_WARNING("There is no room left on \the [src]."))
return
var/text = sanitizeSafe(input(usr, "What would you like to write?") as text, writing_space)
var/text = sanitizeSafe(tgui_input_text(usr, "What would you like to write?", null, null, writing_space), writing_space)
if(!text || thing.loc != user || (!Adjacent(user) && loc != user) || user.incapacitated())
return
user.visible_message("<b>\The [user]</b> jots a note down on \the [src].")

View File

@@ -47,7 +47,7 @@ var/global/photo_count = 0
/obj/item/weapon/photo/attackby(obj/item/weapon/P as obj, mob/user as mob)
if(istype(P, /obj/item/weapon/pen))
var/txt = sanitize(input(user, "What would you like to write on the back?", "Photo Writing", null) as text, 128)
var/txt = sanitize(tgui_input_text(user, "What would you like to write on the back?", "Photo Writing", null, 128), 128)
if(loc == user && user.stat == 0)
scribble = txt
..()
@@ -75,7 +75,7 @@ var/global/photo_count = 0
set category = "Object"
set src in usr
var/n_name = sanitizeSafe(input(usr, "What would you like to label the photo?", "Photo Labelling", null) as text, MAX_NAME_LEN)
var/n_name = sanitizeSafe(tgui_input_text(usr, "What would you like to label the photo?", "Photo Labelling", null, MAX_NAME_LEN), MAX_NAME_LEN)
//loc.loc check is for making possible renaming photos in clipboards
if(( (loc == usr || (loc.loc && loc.loc == usr)) && usr.stat == 0))
name = "[(n_name ? text("[n_name]") : "photo")]"

View File

@@ -55,7 +55,7 @@
to_chat(user, SPAN_WARNING("You are banned from leaving persistent information across rounds."))
return
var/_message = sanitize(input(usr, "Enter an additional message to engrave.", "Graffiti") as null|text, trim = TRUE)
var/_message = sanitize(tgui_input_text(usr, "Enter an additional message to engrave.", "Graffiti"), trim = TRUE)
if(_message && loc && user && !user.incapacitated() && user.Adjacent(loc) && thing.loc == user)
user.visible_message("<span class='warning'>\The [user] begins carving something into \the [loc].</span>")
if(do_after(user, max(20, length(_message)), src) && loc)

View File

@@ -37,7 +37,7 @@
return
var/tmp_label = ""
var/label_text = sanitizeSafe(input(user, "Inscribe some text into \the [initial(BB.name)]","Inscription",tmp_label), MAX_NAME_LEN)
var/label_text = sanitizeSafe(tgui_input_text(user, "Inscribe some text into \the [initial(BB.name)]","Inscription",tmp_label,MAX_NAME_LEN), MAX_NAME_LEN)
if(length(label_text) > 20)
to_chat(user, "<font color='red'>The inscription can be at most 20 characters long.</font>")
else if(!label_text)

View File

@@ -56,7 +56,7 @@
/obj/item/weapon/reagent_containers/blood/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/pen) || istype(W, /obj/item/device/flashlight/pen))
var/tmp_label = sanitizeSafe(input(user, "Enter a label for [name]", "Label", label_text), MAX_NAME_LEN)
var/tmp_label = sanitizeSafe(tgui_input_text(user, "Enter a label for [name]", "Label", label_text, MAX_NAME_LEN), MAX_NAME_LEN)
if(length(tmp_label) > 50)
to_chat(user, "<span class='notice'>The label can be at most 50 characters long.</span>")
else if(length(tmp_label) > 10)

View File

@@ -124,7 +124,7 @@
/obj/item/weapon/reagent_containers/glass/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/pen) || istype(W, /obj/item/device/flashlight/pen))
var/tmp_label = sanitizeSafe(input(user, "Enter a label for [name]", "Label", label_text), MAX_NAME_LEN)
var/tmp_label = sanitizeSafe(tgui_input_text(user, "Enter a label for [name]", "Label", label_text, MAX_NAME_LEN), MAX_NAME_LEN)
if(length(tmp_label) > 50)
to_chat(user, "<span class='notice'>The label can be at most 50 characters long.</span>")
else if(length(tmp_label) > 10)

View File

@@ -42,7 +42,7 @@
else if(istype(W, /obj/item/weapon/pen))
switch(tgui_alert(usr, "What would you like to alter?","Select Alteration",list("Title","Description","Cancel")))
if("Title")
var/str = sanitizeSafe(input(usr,"Label text?","Set label",""), MAX_NAME_LEN)
var/str = sanitizeSafe(tgui_input_text(usr,"Label text?","Set label","", MAX_NAME_LEN), MAX_NAME_LEN)
if(!str || !length(str))
to_chat(user, "<span class='warning'> Invalid text.</span>")
return
@@ -153,7 +153,7 @@
else if(istype(W, /obj/item/weapon/pen))
switch(tgui_alert(usr, "What would you like to alter?","Select Alteration",list("Title","Description","Cancel")))
if("Title")
var/str = sanitizeSafe(input(usr,"Label text?","Set label",""), MAX_NAME_LEN)
var/str = sanitizeSafe(tgui_input_text(usr,"Label text?","Set label","", MAX_NAME_LEN), MAX_NAME_LEN)
if(!str || !length(str))
to_chat(user, "<span class='warning'> Invalid text.</span>")
return

Some files were not shown because too many files have changed in this diff Show More