Merge branch 'master' into upstream-merge-13139

This commit is contained in:
Nadyr
2022-06-23 01:03:05 -04:00
committed by GitHub
162 changed files with 1065 additions and 575 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

@@ -478,23 +478,43 @@
#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.
/**
* Used to get a properly sanitized input. Returns null if cancel is pressed.
*
* Arguments
** user - Target of the input prompt.
** message - The text inside of the prompt.
** title - The window title of the prompt.
** max_length - If you intend to impose a length limit - default is 1024.
** no_trim - Prevents the input from being trimmed 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)) // User pressed cancel
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
/**
* Used to get a properly sanitized input in a larger box. Works very similarly to stripped_input.
*
* Arguments
** user - Target of the input prompt.
** message - The text inside of the prompt.
** title - The window title of the prompt.
** max_length - If you intend to impose a length limit - default is 1024.
** no_trim - Prevents the input from being trimmed if you intend to parse newlines or whitespace.
*/
/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)) // User pressed cancel
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

@@ -66,43 +66,6 @@
if(istype(H) && istype(H.species, /datum/species/xenochimera)) // If you're somehow able to click this while not a chimera, this should prevent weird runtimes. Will need changing if regeneration is ever opened to non-chimera using the same alert.
if(H.revive_ready == REVIVING_DONE) // Sanity check.
H.hatch() // Hatch.
//pAI buttons!!!
if("fold/unfold")
if(ispAI(usr))
var/mob/living/silicon/pai/p = usr
if(p.loc == p.card)
p.fold_out()
else
p.fold_up()
if("choose chassis")
if(ispAI(usr))
var/mob/living/silicon/pai/p = usr
p.choose_chassis()
if("software interface")
if(ispAI(usr))
var/mob/living/silicon/pai/p = usr
p.paiInterface()
if("radio configuration")
if(ispAI(usr))
var/mob/living/silicon/pai/p = usr
p.radio.tgui_interact(p)
if("pda")
if(ispAI(usr))
var/mob/living/silicon/pai/p = usr
p.pda.cmd_pda_open_ui()
if("communicator")
if(ispAI(usr))
var/mob/living/silicon/pai/p = usr
p.communicator.activate()
if("known languages")
if(ispAI(usr))
var/mob/living/silicon/pai/p = usr
p.check_languages()
else
return 0

View File

@@ -99,7 +99,7 @@ GENERAL_PROTECT_DATUM(/datum/managed_browser/feedback_form)
if(href_list["feedback_edit_body"])
// This is deliberately not sanitized here, and is instead checked when hitting the submission button,
// as we want to give the user a chance to fix it without needing to rewrite the whole thing.
feedback_body = tgui_input_text(my_client, "Please write your feedback here.", "Feedback Body", feedback_body, multiline = TRUE)
feedback_body = tgui_input_text(my_client, "Please write your feedback here.", "Feedback Body", feedback_body, multiline = TRUE, prevent_enter = TRUE)
display() // Refresh the window with new information.
return

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, prevent_enter = 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, prevent_enter = 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

@@ -74,7 +74,8 @@
contains = list(
/obj/fiftyspawner/geocarpet,
/obj/fiftyspawner/retrocarpet,
/obj/fiftyspawner/retrocarpet_red
/obj/fiftyspawner/retrocarpet_red,
/obj/fiftyspawner/happycarpet
)
/datum/supply_pack/materials/linoleum

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

@@ -215,7 +215,7 @@ var/global/list/Holiday = list() //Holidays are lists now, so we can have more t
Holiday = list()
var/H = tgui_input_text(src,"What holiday is it today?","Set Holiday")
var/B = tgui_input_text(src,"Now explain what the holiday is about","Set Holiday", multiline = TRUE)
var/B = tgui_input_text(src,"Now explain what the holiday is about","Set Holiday", multiline = TRUE, prevent_enter = TRUE)
Holiday[H] = B

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

@@ -447,7 +447,7 @@ GLOBAL_LIST_BOILERPLATE(allCasters, /obj/machinery/newscaster)
return TRUE
if("set_new_message")
msg = sanitize(tgui_input_text(usr, "Write your Feed story", "Network Channel Handler", multiline = TRUE))
msg = sanitize(tgui_input_text(usr, "Write your Feed story", "Network Channel Handler", multiline = TRUE, prevent_enter = TRUE))
return TRUE
if("set_new_title")

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

@@ -424,7 +424,7 @@
selected_tab = params["switch_tab"]
if("edit")
var/n = tgui_input_text(usr, "Please enter message", name, notehtml, multiline = TRUE)
var/n = tgui_input_text(usr, "Please enter message", name, notehtml, multiline = TRUE, prevent_enter = TRUE)
n = sanitizeSafe(n, extra = 0)
if(n)
note = html_decode(n)

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 += {"
@@ -328,7 +354,7 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
if(2)
radio.ToggleReception()
if(href_list["setlaws"])
var/newlaws = sanitize(tgui_input_text(usr, "Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws, multiline = TRUE))
var/newlaws = sanitize(tgui_input_text(usr, "Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws, multiline = TRUE, prevent_enter = TRUE))
if(newlaws)
pai.pai_laws = newlaws
to_chat(pai, "Your supplemental directives have been updated. Your new directives are:")
@@ -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

@@ -40,6 +40,10 @@
name = "stack of red retro carpet"
type_to_spawn = /obj/item/stack/tile/carpet/retro_red
/obj/fiftyspawner/happycarpet
name = "stack of happy carpet"
type_to_spawn = /obj/item/stack/tile/carpet/happy
/obj/fiftyspawner/floor
name = "stack of floor tiles"
type_to_spawn = /obj/item/stack/tile/floor

View File

@@ -149,6 +149,10 @@
icon_state = "tile-carpet-retro-red"
desc = "A piece of carpet with red-ical space patterns. It is the same size as a normal floor tile!"
/obj/item/stack/tile/carpet/happy
icon_state = "tile-carpet-happy"
desc = "A piece of carpet with happy patterns. It is the same size as a normal floor tile!"
/obj/item/stack/tile/carpet/bcarpet //YW EDIT: Commented out to help with upstream merging. Get on this you fucking virgo bois. -yw //CHOMP Comment: Yawn commented out this block, but CHOMP already commented out this stuff so I just removed theirs.
icon_state = "tile-carpet"
/obj/item/stack/tile/carpet/blucarpet

View File

@@ -114,3 +114,7 @@
/obj/item/stack/tile/carpet/retro_red
icon_state = "tile-carpet-retro-red"
desc = "A piece of carpet with red-ical space patterns. It is the same size as a normal floor tile!"
/obj/item/stack/tile/carpet/happy
icon_state = "tile-carpet-happy"
desc = "A piece of carpet with happy patterns. It is the same size as a normal floor tile!"

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

@@ -350,6 +350,12 @@ var/list/flooring_types
build_type = /obj/item/stack/tile/carpet/retro_red
flags = TURF_REMOVE_CROWBAR | TURF_CAN_BURN
/decl/flooring/carpet/happy
name = "happy carpet"
icon_base = "happycarpet"
build_type = /obj/item/stack/tile/carpet/happy
flags = TURF_REMOVE_CROWBAR | TURF_CAN_BURN
/decl/flooring/tiling
name = "floor"
desc = "Scuffed from the passage of countless greyshirts."

View File

@@ -75,6 +75,11 @@
icon_state = "retrocarpet_red"
initial_flooring = /decl/flooring/carpet/retro_red
/turf/simulated/floor/carpet/happy
name = "happy carpet"
icon_state = "happycarpet"
initial_flooring = /decl/flooring/carpet/happy
/turf/simulated/floor/bluegrid
name = "mainframe floor"
icon = 'icons/turf/flooring/circuit.dmi'

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

@@ -617,7 +617,7 @@ var/global/floorIsLava = 0
set desc="Announce your desires to the world"
if(!check_rights(0)) return
var/message = tgui_input_text(usr, "Global message to send:", "Admin Announce", multiline = TRUE)
var/message = tgui_input_text(usr, "Global message to send:", "Admin Announce", multiline = TRUE, prevent_enter = TRUE)
if(message)
if(!check_rights(R_SERVER,0))
message = sanitize(message, 500, extra = 0)
@@ -642,7 +642,7 @@ var/datum/announcement/minor/admin_min_announcer = new
if(sender) //They put a sender
sender = sanitize(sender, 75, extra = 0)
var/message = tgui_input_text(usr, "Message content (max 500):", "Contents", "This is a test of the announcement system.", multiline = TRUE)
var/message = tgui_input_text(usr, "Message content (max 500):", "Contents", "This is a test of the announcement system.", multiline = TRUE, prevent_enter = TRUE)
var/msgverb = tgui_input_text(usr, "Name of verb (Such as 'states', 'says', 'asks', etc):", "Verb", "says")
if(message) //They put a message
message = sanitize(message, 500, extra = 0)
@@ -681,7 +681,7 @@ var/datum/announcement/minor/admin_min_announcer = new
The above will result in those messages playing, with a 5 second gap between each. Maximum of 20 messages allowed.</span>")
var/list/decomposed
var/message = tgui_input_text(usr,"See your chat box for instructions. Keep a copy elsewhere in case it is rejected when you click OK.", "Input Conversation", "", multiline = TRUE)
var/message = tgui_input_text(usr,"See your chat box for instructions. Keep a copy elsewhere in case it is rejected when you click OK.", "Input Conversation", "", multiline = TRUE, prevent_enter = TRUE)
if(!message)
return

View File

@@ -18,7 +18,7 @@
/client/proc/admin_memo_write()
var/savefile/F = new(MEMOFILE)
if(F)
var/memo = sanitize(tgui_input_text(src,"Type your memo\n(Leaving it blank will delete your current memo):","Write Memo",null, multiline = TRUE), extra = 0)
var/memo = sanitize(tgui_input_text(src,"Type your memo\n(Leaving it blank will delete your current memo):","Write Memo",null, multiline = TRUE, prevent_enter = TRUE), extra = 0)
switch(memo)
if(null)
return

View File

@@ -174,7 +174,7 @@ world/New()
if(!found)
to_chat(src, "<b>* An error occured, sorry.</b>")
var/body = tgui_input_text(src.mob, "Enter a body for the news", "Body", multiline = TRUE)
var/body = tgui_input_text(src.mob, "Enter a body for the news", "Body", multiline = TRUE, prevent_enter = TRUE)
if(!body) return
found.body = body

View File

@@ -28,7 +28,7 @@
var/new_body = sanitize(tgui_input_text(src,"Write the body of the news update here. Note: HTML is NOT supported, however paper markup is supported. \n\
Hitting enter will automatically add a line break. \n\
Valid markup includes: \[b\], \[i\], \[u\], \[large\], \[h1\], \[h2\], \[h3\]\ \[*\], \[hr\], \[small\], \[list\], \[table\], \[grid\], \
\[row\], \[cell\], \[logo\], \[sglogo\].","Write News", body, multiline = TRUE), extra = 0)
\[row\], \[cell\], \[logo\], \[sglogo\].","Write News", body, multiline = TRUE, prevent_enter = TRUE), extra = 0)
new_body = paper_markup2html(new_body)

View File

@@ -846,7 +846,7 @@
if (ismob(M))
if(!check_if_greater_rights_than(M.client))
return
var/reason = sanitize(tgui_input_text(usr, "Please enter reason.", multiline = TRUE))
var/reason = sanitize(tgui_input_text(usr, "Please enter reason.", multiline = TRUE, prevent_enter = TRUE))
if(!reason)
return
@@ -1821,7 +1821,7 @@
src.access_news_network()
else if(href_list["ac_set_new_message"])
src.admincaster_feed_message.body = sanitize(tgui_input_text(usr, "Write your Feed story", "Network Channel Handler", "", multiline = TRUE))
src.admincaster_feed_message.body = sanitize(tgui_input_text(usr, "Write your Feed story", "Network Channel Handler", "", multiline = TRUE, prevent_enter = TRUE))
src.access_news_network()
else if(href_list["ac_submit_new_message"])

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

@@ -627,7 +627,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!holder)
return
var/input = sanitize(tgui_input_text(usr, "Please enter anything you want. Anything. Serious.", "What?", "", multiline = TRUE), extra = 0)
var/input = sanitize(tgui_input_text(usr, "Please enter anything you want. Anything. Serious.", "What?", "", multiline = TRUE, prevent_enter = TRUE), extra = 0)
var/customname = sanitizeSafe(tgui_input_text(usr, "Pick a title for the report.", "Title"))
if(!input)
return

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

@@ -140,7 +140,7 @@
return TOPIC_REFRESH
else if(href_list["metadata"])
var/new_metadata = sanitize(tgui_input_text(user, "Enter any information you'd like others to see, such as Roleplay-preferences:", "Game Preference" , html_decode(pref.metadata), multiline = TRUE), extra = 0) //VOREStation Edit
var/new_metadata = sanitize(tgui_input_text(user, "Enter any information you'd like others to see, such as Roleplay-preferences:", "Game Preference" , html_decode(pref.metadata), multiline = TRUE, prevent_enter = TRUE), extra = 0) //VOREStation Edit
if(new_metadata && CanUseTopic(user))
pref.metadata = new_metadata
return TOPIC_REFRESH

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, prevent_enter = 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, prevent_enter = 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, prevent_enter = 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

@@ -59,11 +59,11 @@
switch(href_list["flavor_text"])
if("open")
if("general")
var/msg = sanitize(tgui_input_text(usr,"Give a general description of your character. This will be shown regardless of clothings.","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]]), multiline = TRUE), extra = 0) //VOREStation Edit: separating out OOC notes
var/msg = sanitize(tgui_input_text(usr,"Give a general description of your character. This will be shown regardless of clothings.","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]]), multiline = TRUE, prevent_enter = TRUE), extra = 0) //VOREStation Edit: separating out OOC notes
if(CanUseTopic(user))
pref.flavor_texts[href_list["flavor_text"]] = msg
else
var/msg = sanitize(tgui_input_text(usr,"Set the flavor text for your [href_list["flavor_text"]].","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]]), multiline = TRUE), extra = 0)
var/msg = sanitize(tgui_input_text(usr,"Set the flavor text for your [href_list["flavor_text"]].","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]]), multiline = TRUE, prevent_enter = TRUE), extra = 0)
if(CanUseTopic(user))
pref.flavor_texts[href_list["flavor_text"]] = msg
SetFlavorText(user)
@@ -73,11 +73,11 @@
switch(href_list["flavour_text_robot"])
if("open")
if("Default")
var/msg = sanitize(tgui_input_text(usr,"Set the default flavour text for your robot. It will be used for any module without individual setting.","Flavour Text",html_decode(pref.flavour_texts_robot["Default"]), multiline = TRUE), extra = 0)
var/msg = sanitize(tgui_input_text(usr,"Set the default flavour text for your robot. It will be used for any module without individual setting.","Flavour Text",html_decode(pref.flavour_texts_robot["Default"]), multiline = TRUE, prevent_enter = TRUE), extra = 0)
if(CanUseTopic(user))
pref.flavour_texts_robot[href_list["flavour_text_robot"]] = msg
else
var/msg = sanitize(tgui_input_text(usr,"Set the flavour text for your robot with [href_list["flavour_text_robot"]] module. If you leave this empty, default flavour text will be used for this module.","Flavour Text",html_decode(pref.flavour_texts_robot[href_list["flavour_text_robot"]]), multiline = TRUE), extra = 0)
var/msg = sanitize(tgui_input_text(usr,"Set the flavour text for your robot with [href_list["flavour_text_robot"]] module. If you leave this empty, default flavour text will be used for this module.","Flavour Text",html_decode(pref.flavour_texts_robot[href_list["flavour_text_robot"]]), multiline = TRUE, prevent_enter = TRUE), extra = 0)
if(CanUseTopic(user))
pref.flavour_texts_robot[href_list["flavour_text_robot"]] = msg
SetFlavourTextRobot(user)

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

View File

@@ -42,11 +42,11 @@
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")
t = tgui_input_text(user, "Enter a description for your pAI", "Global Preference", html_decode(candidate.description), multiline = TRUE)
t = tgui_input_text(user, "Enter a description for your pAI", "Global Preference", html_decode(candidate.description), multiline = TRUE, prevent_enter = TRUE)
if(!isnull(t) && CanUseTopic(user))
candidate.description = sanitize(t)
if("role")
@@ -54,7 +54,7 @@
if(!isnull(t) && CanUseTopic(user))
candidate.role = sanitize(t)
if("ooc")
t = tgui_input_text(user, "Enter any OOC comments", "Global Preference", html_decode(candidate.comments), multiline = TRUE)
t = tgui_input_text(user, "Enter any OOC comments", "Global Preference", html_decode(candidate.comments), multiline = TRUE, prevent_enter = TRUE)
if(!isnull(t) && CanUseTopic(user))
candidate.comments = sanitize(t)
return TOPIC_REFRESH

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, prevent_enter = 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

@@ -58,7 +58,7 @@
pref.directory_erptag = new_erptag
return TOPIC_REFRESH
else if(href_list["directory_ad"])
var/msg = sanitize(tgui_input_text(user,"Write your advertisement here!", "Flavor Text", html_decode(pref.directory_ad), multiline = TRUE), extra = 0) //VOREStation Edit: separating out OOC notes
var/msg = sanitize(tgui_input_text(user,"Write your advertisement here!", "Flavor Text", html_decode(pref.directory_ad), multiline = TRUE, prevent_enter = TRUE), extra = 0) //VOREStation Edit: separating out OOC notes
pref.directory_ad = msg
return TOPIC_REFRESH
else if(href_list["toggle_sensor_setting"])

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, prevent_enter = 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)
@@ -978,7 +978,14 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
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

@@ -1,124 +1,63 @@
/mob/living/carbon/human/proc/examine_weight()
if(!show_pudge()) //Some clothing or equipment can hide this.
if(!show_pudge() || !weight_message_visible) //Some clothing or equipment can hide this.
return ""
var/message = ""
var/weight_examine = round(weight)
var/t_He = "It" //capitalised for use at the start of each line.
var/t_he = "it"
var/t_his = "its"
var/t_His = "Its"
var/t_is = "is"
var/t_has = "has"
var/t_heavy = "heavy"
switch(identifying_gender) //Gender is their "real" gender. Identifying_gender is their "chosen" gender.
if(MALE)
t_He = "He"
t_he = "he"
t_His = "His"
t_his = "his"
t_heavy = "bulky"
if(FEMALE)
t_He = "She"
t_he = "she"
t_His = "Her"
t_his = "her"
t_heavy = "curvy"
if(PLURAL)
t_He = "They"
t_he = "they"
t_His = "Their"
t_his = "their"
t_is = "are"
t_has = "have"
if(NEUTER)
t_He = "It"
t_he = "it"
t_His = "Its"
t_his = "its"
if(HERM)
t_He = "Shi"
t_he = "shi"
t_His = "Hir"
t_his = "hir"
t_heavy = "curvy"
switch(weight_examine)
if(0 to 74)
message = "<span class='warning'>[t_He] [t_is] terribly lithe and frail!</span>"
message = weight_messages[1]
if(75 to 99)
message = "[t_He] [t_has] a very slender frame."
message = weight_messages[2]
if(100 to 124)
message = "[t_He] [t_has] a lightweight, athletic build."
message = weight_messages[3]
if(125 to 174)
message = "[t_He] [t_has] a healthy, average body."
message = weight_messages[4]
if(175 to 224)
message = "[t_He] [t_has] a thick, [t_heavy] physique."
message = weight_messages[5]
if(225 to 274)
message = "[t_He] [t_has] a plush, chubby figure."
message = weight_messages[6]
if(275 to 325)
message = "[t_He] [t_has] an especially plump body with a round potbelly and large hips."
message = weight_messages[7]
if(325 to 374)
message = "[t_He] [t_has] a very fat frame with a bulging potbelly, squishy rolls of pudge, very wide hips, and plump set of jiggling thighs."
message = weight_messages[8]
if(375 to 474)
message = "<span class='warning'>[t_He] [t_is] incredibly obese. [t_His] massive potbelly sags over [t_his] waistline while [t_his] fat ass would probably require two chairs to sit down comfortably!</span>"
message = weight_messages[9]
else
message += "<span class='warning'>[t_He] [t_is] so morbidly obese, you wonder how [t_he] can even stand, let alone waddle around the station. [t_He] can't get any fatter without being immobilized.</span>"
message = weight_messages[10]
if(message)
message = "<span class='notice'>[message]</span>"
return message //Credit to Aronai for helping me actually get this working!
/mob/living/carbon/human/proc/examine_nutrition()
if(!show_pudge()) //Some clothing or equipment can hide this.
if(!show_pudge() || !nutrition_message_visible) //Some clothing or equipment can hide this.
return ""
if(nutrition_hidden) // Chomp Edit
return ""
var/message = ""
var/nutrition_examine = round(nutrition)
var/t_He = "It" //capitalised for use at the start of each line.
var/t_His = "Its"
var/t_his = "its"
var/t_is = "is"
var/t_has = "has"
switch(identifying_gender)
if(MALE)
t_He = "He"
t_his = "his"
t_His = "His"
if(FEMALE)
t_He = "She"
t_his = "her"
t_His = "Her"
if(PLURAL)
t_He = "They"
t_his = "their"
t_His = "Their"
t_is = "are"
t_has = "have"
if(NEUTER)
t_He = "It"
t_his = "its"
t_His = "Its"
if(HERM)
t_He = "Shi"
t_his = "hir"
t_His = "Hir"
switch(nutrition_examine)
if(0 to 49)
message = "<span class='warning'>[t_He] [t_is] starving! You can hear [t_his] stomach snarling from across the room!</span>"
message = nutrition_messages[1]
if(50 to 99)
message = "<span class='warning'>[t_He] [t_is] extremely hungry. A deep growl occasionally rumbles from [t_his] empty stomach.</span>"
message = nutrition_messages[2]
if(100 to 499)
return message //Well that's pretty normal, really.
message = nutrition_messages[3]
if(500 to 999) // Fat.
message = "[t_He] [t_has] a stuffed belly, bloated fat and round from eating too much."
message = nutrition_messages[4]
if(1000 to 1399)
message = "[t_He] [t_has] a rotund, thick gut. It bulges from their body obscenely, close to sagging under its own weight."
message = nutrition_messages[5]
if(1400 to 1934) // One person fully digested.
message = "<span class='warning'>[t_He] [t_is] sporting a large, round, sagging stomach. It contains at least their body weight worth of glorping slush.</span>"
message = nutrition_messages[6]
if(1935 to 3004) // Two people.
message = "<span class='warning'>[t_He] [t_is] engorged with a huge stomach that sags and wobbles as they move. [t_He] must have consumed at least twice their body weight. It looks incredibly soft.</span>"
message = nutrition_messages[7]
if(3005 to 4074) // Three people.
message = "<span class='warning'>[t_His] stomach is firmly packed with digesting slop. [t_He] must have eaten at least a few times worth their body weight! It looks hard for them to stand, and [t_his] gut jiggles when they move.</span>"
if(4075 to INFINITY) // Four or more people.
message = "<span class='warning'>[t_He] [t_is] so absolutely stuffed that you aren't sure how it's possible to move. [t_He] can't seem to swell any bigger. The surface of [t_his] belly looks sorely strained!</span>"
message = nutrition_messages[8]
if(4075 to 5124) // Four people.
message = nutrition_messages[9]
if(5125 to INFINITY) // More.
message = nutrition_messages[10]
if(message)
message = "<span class='notice'>[message]</span>"
return message
//For OmniHUD records access for appropriate models

View File

@@ -439,7 +439,7 @@
for (var/datum/data/record/R in data_core.security)
if (R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"security"))
var/t1 = sanitize(tgui_input_text(usr, "Add Comment:", "Sec. records", null, null, multiline = TRUE))
var/t1 = sanitize(tgui_input_text(usr, "Add Comment:", "Sec. records", null, null, multiline = TRUE, prevent_enter = TRUE))
if ( !(t1) || usr.stat || usr.restrained() || !(hasHUD(usr,"security")) )
return
var/counter = 1
@@ -556,7 +556,7 @@
for (var/datum/data/record/R in data_core.medical)
if (R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"medical"))
var/t1 = sanitize(tgui_input_text(usr, "Add Comment:", "Med. records", null, null, multiline = TRUE))
var/t1 = sanitize(tgui_input_text(usr, "Add Comment:", "Med. records", null, null, multiline = TRUE, prevent_enter = TRUE))
if ( !(t1) || usr.stat || usr.restrained() || !(hasHUD(usr,"medical")) )
return
var/counter = 1
@@ -588,11 +588,11 @@
src << browse(null, "window=flavor_changes")
return
if("general")
var/msg = sanitize(tgui_input_text(usr,"Update the general description of your character. This will be shown regardless of clothing.","Flavor Text",html_decode(flavor_texts[href_list["flavor_change"]]), multiline = TRUE), extra = 0) //VOREStation Edit: separating out OOC notes
var/msg = sanitize(tgui_input_text(usr,"Update the general description of your character. This will be shown regardless of clothing.","Flavor Text",html_decode(flavor_texts[href_list["flavor_change"]]), multiline = TRUE, prevent_enter = TRUE), extra = 0) //VOREStation Edit: separating out OOC notes
flavor_texts[href_list["flavor_change"]] = msg
return
else
var/msg = sanitize(tgui_input_text(usr,"Update the flavor text for your [href_list["flavor_change"]].","Flavor Text",html_decode(flavor_texts[href_list["flavor_change"]]), multiline = TRUE), extra = 0)
var/msg = sanitize(tgui_input_text(usr,"Update the flavor text for your [href_list["flavor_change"]].","Flavor Text",html_decode(flavor_texts[href_list["flavor_change"]]), multiline = TRUE, prevent_enter = TRUE), extra = 0)
flavor_texts[href_list["flavor_change"]] = msg
set_flavor()
return

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

@@ -27,7 +27,7 @@
set desc = "Sets OOC notes about yourself or your RP preferences or status."
set category = "OOC"
var/new_metadata = sanitize(tgui_input_text(usr, "Enter any information you'd like others to see, such as Roleplay-preferences. This will not be saved permanently, only for this round.", "Game Preference" , html_decode(ooc_notes), multiline = TRUE), extra = 0)
var/new_metadata = sanitize(tgui_input_text(usr, "Enter any information you'd like others to see, such as Roleplay-preferences. This will not be saved permanently, only for this round.", "Game Preference" , html_decode(ooc_notes), , prevent_enter = TRUE), extra = 0)
if(new_metadata && CanUseTopic(usr))
ooc_notes = new_metadata
to_chat(usr, "OOC notes updated.")

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.
@@ -84,8 +84,7 @@
var/obj/item/device/pda/ai/pai/pda = null
var/secHUD = 0 // Toggles whether the Security HUD is active or not
var/medHUD = 0 // Toggles whether the Medical HUD is active or not
var/paiHUD = 0 // Toggles whether the AR HUD is active or not
var/medical_cannotfind = 0
var/datum/data/record/medicalActive1 // Datacore record declarations for record software
@@ -112,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
@@ -135,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()
@@ -144,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)
@@ -404,11 +402,13 @@
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]"
@@ -441,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
@@ -493,36 +497,3 @@
src.master = null
src.master_dna = null
to_chat(src, "<font color=green>You feel unbound.</font>")
//FLUSH RAM, it sounded cool at first tbh now im not so sure
//Externally now called Factory Reset.
/mob/living/silicon/pai/verb/flush_ram()
set name = "Factory Reset"
set category = "pAI Commands"
set desc = "Uninstalls all software and reinstalls default."
software = null
software = default_pai_software.Copy()
ram = 100 //Reset since we just admin yeet the software and reloaded defaults.
// Various software-specific vars
secHUD = 0 // Toggles whether the Security HUD is active or not
medHUD = 0 // Toggles whether the Medical HUD is active or not
medical_cannotfind = 0
security_cannotfind = 0
translator_on = 0 // keeps track of the translator module
//MEDHUD
src.plane_holder.set_vis(VIS_CH_STATUS, medHUD)
src.plane_holder.set_vis(VIS_CH_HEALTH, medHUD)
//SECHUD
src.plane_holder.set_vis(VIS_CH_ID, secHUD)
src.plane_holder.set_vis(VIS_CH_WANTED, secHUD)
src.plane_holder.set_vis(VIS_CH_IMPTRACK, secHUD)
src.plane_holder.set_vis(VIS_CH_IMPLOYAL, secHUD)
src.plane_holder.set_vis(VIS_CH_IMPCHEM, secHUD)
//Translator
src.remove_language(LANGUAGE_UNATHI)
src.remove_language(LANGUAGE_SIIK)
src.remove_language(LANGUAGE_AKHANI)
src.remove_language(LANGUAGE_SKRELLIAN)
src.remove_language(LANGUAGE_ZADDAT)
src.remove_language(LANGUAGE_SCHECHI)

View File

@@ -1,6 +1,74 @@
/mob/living/silicon/pai
var/obj/screen/pai/pai_fold_display = null
/obj/screen/pai
icon = 'icons/mob/pai_hud.dmi'
var/base_state
/obj/screen/pai/Click_vr(location, control, params)
if(!usr) return 1
if(!ispAI(usr)) return 1
var/mob/living/silicon/pai/p = usr
switch(name)
if("fold/unfold")
if(p.loc == p.card)
p.fold_out()
else
p.fold_up()
if("choose chassis")
p.choose_chassis()
if("software interface")
p.paiInterface()
if("radio configuration")
p.radio.tgui_interact(p)
if("pda")
p.pda.cmd_pda_open_ui()
if("communicator")
p.communicator.activate()
if("known languages")
p.check_languages()
if("software toggle")
p.refresh_software_status()
if(p.hud_used.inventory_shown)
p.hud_used.inventory_shown = 0
p.client.screen -= p.hud_used.other
else
p.hud_used.inventory_shown = 1
p.client.screen += p.hud_used.other
if("directives")
p.directives()
if("crew manifest")
p.crew_manifest()
if("universal translator")
p.translator()
if("medical records")
p.med_records()
if("security records")
p.sec_records()
if("remote signaler")
p.remote_signal()
if("atmosphere sensor")
p.atmos_sensor()
if("door jack")
p.door_jack()
if("ar hud")
p.ar_hud()
/obj/screen/pai/pai_fold_display
name = "fold/unfold"
icon = 'icons/mob/pai_hud.dmi'
@@ -26,7 +94,7 @@
HUD.hotkeybuttons = hotkeybuttons
HUD.hud_elements = hud_elements
var/obj/screen/using
var/obj/screen/pai/using
//Small intent quarters
@@ -91,66 +159,6 @@
using.alpha = ui_alpha
HUD.hotkeybuttons += using
//Choose chassis button
using = new /obj/screen()
using.name = "choose chassis"
using.icon = ui_style
using.icon_state = "choose_chassis"
using.screen_loc = ui_movi
using.color = ui_color
using.alpha = ui_alpha
hud_elements |= using
//Software interface button
using = new /obj/screen()
using.name = "software interface"
using.icon = ui_style
using.icon_state = "software_interface"
using.screen_loc = ui_acti
using.color = ui_color
using.alpha = ui_alpha
hud_elements |= using
//Radio configuration button
using = new /obj/screen()
using.name = "radio configuration"
using.icon = ui_style
using.icon_state = "radio_configuration"
using.screen_loc = ui_acti
using.color = ui_color
using.alpha = ui_alpha
hud_elements |= using
//PDA button
using = new /obj/screen()
using.name = "pda"
using.icon = ui_style
using.icon_state = "pda"
using.screen_loc = ui_pai_comms
using.color = ui_color
using.alpha = ui_alpha
hud_elements |= using
//Communicator button
using = new /obj/screen()
using.name = "communicator"
using.icon = ui_style
using.icon_state = "communicator"
using.screen_loc = ui_pai_comms
using.color = ui_color
using.alpha = ui_alpha
hud_elements |= using
//Language button
using = new /obj/screen()
using.name = "known languages"
using.icon = ui_style
using.icon_state = "language"
using.screen_loc = ui_acti
using.color = ui_color
using.alpha = ui_alpha
hud_elements |= using
//Pull button
pullin = new /obj/screen()
pullin.icon = ui_style
@@ -183,6 +191,139 @@
pai_fold_display.icon_state = "folded"
HUD.hud_elements |= pai_fold_display
//Choose chassis button
using = new /obj/screen/pai()
using.name = "choose chassis"
using.icon_state = "choose_chassis"
using.screen_loc = ui_movi
using.color = ui_color
using.alpha = ui_alpha
hud_elements |= using
//Software interface button
using = new /obj/screen/pai()
using.name = "software interface"
using.icon_state = "software_interface"
using.screen_loc = ui_acti
using.color = ui_color
using.alpha = ui_alpha
hud_elements |= using
//Radio configuration button
using = new /obj/screen/pai()
using.name = "radio configuration"
using.icon_state = "radio_configuration"
using.screen_loc = ui_acti
using.color = ui_color
using.alpha = ui_alpha
hud_elements |= using
//PDA button
using = new /obj/screen/pai()
using.name = "pda"
using.icon_state = "pda"
using.screen_loc = ui_pai_comms
using.color = ui_color
using.alpha = ui_alpha
hud_elements |= using
//Communicator button
using = new /obj/screen/pai()
using.name = "communicator"
using.icon_state = "communicator"
using.screen_loc = ui_pai_comms
using.color = ui_color
using.alpha = ui_alpha
hud_elements |= using
//Language button
using = new /obj/screen/pai()
using.name = "known languages"
using.icon_state = "language"
using.screen_loc = ui_acti
using.color = ui_color
using.alpha = ui_alpha
hud_elements |= using
using = new /obj/screen/pai()
using.name = "software toggle"
using.icon_state = "software"
using.screen_loc = ui_inventory
using.color = ui_color
using.alpha = ui_alpha
hud_elements |= using
using = new /obj/screen/pai()
using.name = "directives"
using.icon_state = "directives"
using.screen_loc = "WEST:6,SOUTH:18"
using.color = ui_color
using.alpha = ui_alpha
other |= using
using = new /obj/screen/pai()
using.name = "crew manifest"
using.icon_state = "manifest"
using.screen_loc = "WEST:6,SOUTH+1:2"
using.color = ui_color
using.alpha = ui_alpha
other |= using
using = new /obj/screen/pai()
using.name = "medical records"
using.base_state = "med_records"
using.screen_loc = "WEST:6,SOUTH+1:18"
using.color = ui_color
using.alpha = ui_alpha
other |= using
using = new /obj/screen/pai()
using.name = "security records"
using.base_state = "sec_records"
using.screen_loc = "WEST:6,SOUTH+2:2"
using.color = ui_color
using.alpha = ui_alpha
other |= using
using = new /obj/screen/pai()
using.name = "atmosphere sensor"
using.base_state = "atmos_sensor"
using.screen_loc = "WEST:6,SOUTH+2:18"
using.color = ui_color
using.alpha = ui_alpha
other |= using
using = new /obj/screen/pai()
using.name = "remote signaler"
using.base_state = "signaller"
using.screen_loc = "WEST:6,SOUTH+3:2"
using.color = ui_color
using.alpha = ui_alpha
other |= using
using = new /obj/screen/pai()
using.name = "universal translator"
using.base_state = "translator"
using.screen_loc = "WEST:6,SOUTH+3:18"
using.color = ui_color
using.alpha = ui_alpha
other |= using
using = new /obj/screen/pai()
using.name = "door jack"
using.base_state = "door_jack"
using.screen_loc = "WEST:6,SOUTH+4:2"
using.color = ui_color
using.alpha = ui_alpha
other |= using
using = new /obj/screen/pai()
using.name = "ar hud"
using.base_state = "ar_hud"
using.screen_loc = "WEST:6,SOUTH+4:18"
using.color = ui_color
using.alpha = ui_alpha
other |= using
if(client)
client.screen = list()
@@ -190,6 +331,9 @@
client.screen += adding + hotkeybuttons
client.screen += client.void
HUD.inventory_shown = 0
/mob/living/silicon/pai/handle_regular_hud_updates()
. = ..()
if(healths)

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(
@@ -42,11 +43,18 @@
"car",
"typeone"
)
//These vars keep track of whether you have the related software, used for easily updating the UI
var/soft_ut = FALSE //universal translator
var/soft_mr = FALSE //medical records
var/soft_sr = FALSE //security records
var/soft_dj = FALSE //door jack
var/soft_as = FALSE //atmosphere sensor
var/soft_si = FALSE //signaler
var/soft_ar = FALSE //ar hud
/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
@@ -147,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!")
@@ -182,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)
@@ -363,3 +372,176 @@
return 0
gender = new_gender_identity
return 1
/mob/living/silicon/pai/verb/pai_hide()
set name = "Hide"
set desc = "Allows to hide beneath tables or certain items. Toggled on or off."
set category = "Abilities"
hide()
if(status_flags & HIDING)
hide_glow = TRUE
else
hide_glow = FALSE
update_icon()
/mob/living/silicon/pai/verb/screen_message(message as text|null)
set category = "pAI Commands"
set name = "Screen Message"
set desc = "Allows you to display a message on your screen. This will show up in the chat of anyone who is holding your card."
if (src.client)
if(client.prefs.muted & MUTE_IC)
to_chat(src, "<span class='warning'>You cannot speak in IC (muted).</span>")
return
if(loc != card)
to_chat(src, "<span class='warning'>Your message won't be visible while unfolded!</span>")
if (!message)
message = tgui_input_text(src, "Enter text you would like to show on your screen.","Screen Message")
message = sanitize_or_reflect(message,src)
if (!message)
return
message = capitalize(message)
if (stat == DEAD)
return
card.screen_msg = message
var/logmsg = "(CARD SCREEN)[message]"
log_say(logmsg,src)
to_chat(src, "<span class='cult'>You print a message to your screen, \"[message]\"</span>")
if(isliving(card.loc))
var/mob/living/L = card.loc
if(L.client)
to_chat(L, "<span class='cult'>[src.name]'s screen prints, \"[message]\"</span>")
else return
else if(isbelly(card.loc))
var/obj/belly/b = card.loc
if(b.owner.client)
to_chat(b.owner, "<span class='cult'>[src.name]'s screen prints, \"[message]\"</span>")
else return
else if(istype(card.loc, /obj/item/device/pda))
var/obj/item/device/pda/p = card.loc
if(isliving(p.loc))
var/mob/living/L = p.loc
if(L.client)
to_chat(L, "<span class='cult'>[src.name]'s screen prints, \"[message]\"</span>")
else return
else if(isbelly(p.loc))
var/obj/belly/b = card.loc
if(b.owner.client)
to_chat(b.owner, "<span class='cult'>[src.name]'s screen prints, \"[message]\"</span>")
else return
else return
else return
to_chat(src, "<span class='notice'>Your message was relayed.</span>")
for (var/mob/G in player_list)
if (istype(G, /mob/new_player))
continue
else if(isobserver(G) && G.is_preference_enabled(/datum/client_preference/ghost_ears))
if(is_preference_enabled(/datum/client_preference/whisubtle_vis) || G.client.holder)
to_chat(G, "<span class='cult'>[src.name]'s screen prints, \"[message]\"</span>")
/mob/living/silicon/pai/proc/touch_window(soft_name) //This lets us touch TGUI procs and windows that may be nested behind other TGUI procs and windows
for(var/thing in software) //so we can access our software without having to open up the software interface TGUI window
var/datum/pai_software/S = software[thing]
if(istype(S, /datum/pai_software) && S.name == soft_name)
if(S.toggle)
S.toggle(src)
to_chat(src, "<span class='notice'>You toggled [S.name].</span>")
refresh_software_status()
else
S.tgui_interact(src)
refresh_software_status()
return
for(var/thing in pai_software_by_key)
var/datum/pai_software/our_soft = pai_software_by_key[thing]
if(our_soft.name == soft_name)
if(!(ram >= our_soft.ram_cost))
to_chat(src, "<span class='warning'>Insufficient RAM for download. (Cost [our_soft.ram_cost] : [ram] Remaining)</span>")
return
if(tgui_alert(src, "Do you want to download [our_soft.name]? It costs [our_soft.ram_cost], and you have [ram] remaining.", "Download [our_soft.name]", list("Yes", "No")) == "Yes")
ram -= our_soft.ram_cost
software[our_soft.id] = our_soft
to_chat(src, "<span class='notice'>You downloaded [our_soft.name]. ([ram] RAM remaining.)</span>")
refresh_software_status()
/mob/living/silicon/pai/proc/refresh_software_status() //This manages the pAI software status buttons icon states based on if you have them and if they are enabled
for(var/thing in software) //this only gets called when you click one of the relevent buttons, rather than all the time!
var/datum/pai_software/soft = software[thing]
if(istype(soft,/datum/pai_software/med_records))
soft_mr = TRUE
if(istype(soft,/datum/pai_software/sec_records))
soft_sr = TRUE
if(istype(soft,/datum/pai_software/door_jack))
soft_dj = TRUE
if(istype(soft,/datum/pai_software/atmosphere_sensor))
soft_as = TRUE
if(istype(soft,/datum/pai_software/pai_hud))
soft_ar = TRUE
if(istype(soft,/datum/pai_software/translator))
soft_ut = TRUE
if(istype(soft,/datum/pai_software/signaller))
soft_si = TRUE
for(var/obj/screen/pai/button in hud_used.other)
if(button.name == "medical records")
if(soft_mr)
button.icon_state = "[button.base_state]"
else
button.icon_state = "[button.base_state]_o"
if(button.name == "security records")
if(soft_sr)
button.icon_state = "[button.base_state]"
else
button.icon_state = "[button.base_state]_o"
if(button.name == "door jack")
if(soft_dj)
button.icon_state = "[button.base_state]"
else
button.icon_state = "[button.base_state]_o"
if(button.name == "atmosphere sensor")
if(soft_as)
button.icon_state = "[button.base_state]"
else
button.icon_state = "[button.base_state]_o"
if(button.name == "remote signaler")
if(soft_si)
button.icon_state = "[button.base_state]"
else
button.icon_state = "[button.base_state]_o"
if(button.name == "universal translator")
if(soft_ut && translator_on)
button.icon_state = "[button.base_state]"
else
button.icon_state = "[button.base_state]_o"
if(button.name == "ar hud")
if(soft_ar && paiHUD)
button.icon_state = "[button.base_state]"
else
button.icon_state = "[button.base_state]_o"
//Procs for using the various UI buttons for your softwares
/mob/living/silicon/pai/proc/directives()
touch_window("Directives")
/mob/living/silicon/pai/proc/crew_manifest()
touch_window("Crew Manifest")
/mob/living/silicon/pai/proc/med_records()
touch_window("Medical Records")
/mob/living/silicon/pai/proc/sec_records()
touch_window("Security Records")
/mob/living/silicon/pai/proc/remote_signal()
touch_window("Remote Signaler")
/mob/living/silicon/pai/proc/atmos_sensor()
touch_window("Atmosphere Sensor")
/mob/living/silicon/pai/proc/translator()
touch_window("Universal Translator")
/mob/living/silicon/pai/proc/door_jack()
touch_window("Door Jack")
/mob/living/silicon/pai/proc/ar_hud()
touch_window("AR HUD")

View File

@@ -69,11 +69,11 @@ 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")
t = tgui_input_text(usr, "Enter a description for your pAI", "pAI Description", candidate.description, multiline = TRUE)
t = tgui_input_text(usr, "Enter a description for your pAI", "pAI Description", candidate.description, multiline = TRUE, prevent_enter = TRUE)
if(t)
candidate.description = sanitize(t)
if("role")
@@ -81,7 +81,7 @@ var/datum/paiController/paiController // Global handler for pAI candidates
if(t)
candidate.role = sanitize(t)
if("ooc")
t = tgui_input_text(usr, "Enter any OOC comments", "pAI OOC Comments", candidate.comments, multiline = TRUE)
t = tgui_input_text(usr, "Enter any OOC comments", "pAI OOC Comments", candidate.comments, multiline = TRUE, prevent_enter = TRUE)
if(t)
candidate.comments = sanitize(t)
if("save")

View File

@@ -369,34 +369,24 @@
return data
/datum/pai_software/sec_hud
name = "Security HUD"
ram_cost = 20
id = "sec_hud"
/datum/pai_software/pai_hud
name = "AR HUD"
ram_cost = 30
id = "ar_hud"
/datum/pai_software/sec_hud/toggle(mob/living/silicon/pai/user)
user.secHUD = !user.secHUD
user.plane_holder.set_vis(VIS_CH_ID, user.secHUD)
user.plane_holder.set_vis(VIS_CH_WANTED, user.secHUD)
user.plane_holder.set_vis(VIS_CH_IMPTRACK, user.secHUD)
user.plane_holder.set_vis(VIS_CH_IMPLOYAL, user.secHUD)
user.plane_holder.set_vis(VIS_CH_IMPCHEM, user.secHUD)
/datum/pai_software/pai_hud/toggle(mob/living/silicon/pai/user)
user.paiHUD = !user.paiHUD
user.plane_holder.set_vis(VIS_CH_ID,user.paiHUD)
user.plane_holder.set_vis(VIS_CH_WANTED,user.paiHUD)
user.plane_holder.set_vis(VIS_CH_IMPTRACK,user.paiHUD)
user.plane_holder.set_vis(VIS_CH_IMPCHEM,user.paiHUD)
user.plane_holder.set_vis(VIS_CH_STATUS_R,user.paiHUD)
user.plane_holder.set_vis(VIS_CH_HEALTH_VR,user.paiHUD)
user.plane_holder.set_vis(VIS_CH_BACKUP,user.paiHUD) //backup stuff from silicon_vr is here now
user.plane_holder.set_vis(VIS_AUGMENTED,user.paiHUD)
/datum/pai_software/sec_hud/is_active(mob/living/silicon/pai/user)
return user.secHUD
/datum/pai_software/med_hud
name = "Medical HUD"
ram_cost = 20
id = "med_hud"
/datum/pai_software/med_hud/toggle(mob/living/silicon/pai/user)
user.medHUD = !user.medHUD
user.plane_holder.set_vis(VIS_CH_STATUS, user.medHUD)
user.plane_holder.set_vis(VIS_CH_HEALTH, user.medHUD)
/datum/pai_software/med_hud/is_active(mob/living/silicon/pai/user)
return user.medHUD
/datum/pai_software/pai_hud/is_active(mob/living/silicon/pai/user)
return user.paiHUD
/datum/pai_software/translator
name = "Universal Translator"

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

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