diff --git a/code/controllers/subsystem/voting.dm b/code/controllers/subsystem/voting.dm index b10042486f9..9fb28c1f174 100644 --- a/code/controllers/subsystem/voting.dm +++ b/code/controllers/subsystem/voting.dm @@ -149,10 +149,10 @@ var/datum/subsystem/vote/SSvote if("restart") choices.Add("Restart Round","Continue Playing") if("gamemode") choices.Add(config.votable_modes) if("custom") - question = html_encode(input(usr,"What is the vote for?") as text|null) + question = stripped_input(usr,"What is the vote for?") if(!question) return 0 for(var/i=1,i<=10,i++) - var/option = capitalize(html_encode(input(usr,"Please enter an option or hit cancel to finish") as text|null)) + var/option = capitalize(stripped_input(usr,"Please enter an option or hit cancel to finish")) if(!option || mode || !usr.client) break choices.Add(option) else return 0 diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index 368a3e69c93..e04adb83d04 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -85,6 +85,7 @@ var/list/eng = list() var/list/med = list() var/list/sci = list() + var/list/sup = list() var/list/civ = list() var/list/bot = list() var/list/misc = list() @@ -121,6 +122,9 @@ if(rank in science_positions) sci[name] = rank department = 1 + if(rank in supply_positions) + sup[name] = rank + department = 1 if(rank in civilian_positions) civ[name] = rank department = 1 @@ -154,6 +158,11 @@ for(name in sci) dat += "[name][sci[name]]" even = !even + if(sup.len > 0) + dat += "Supply" + for(name in sup) + dat += "[name][sup[name]]" + even = !even if(civ.len > 0) dat += "Civilian" for(name in civ) diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index c072fc6ae39..522fdb10ceb 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -466,7 +466,7 @@ body usr << "This can only be used on instances of type /mob" return - var/new_name = copytext(sanitize(input(usr,"What would you like to name this mob?","Input a name",M.real_name) as text|null),1,MAX_NAME_LEN) + var/new_name = stripped_input(usr,"What would you like to name this mob?","Input a name",M.real_name,MAX_NAME_LEN) if( !new_name || !M ) return message_admins("Admin [key_name_admin(usr)] renamed [key_name_admin(M)] to [new_name].") diff --git a/code/datums/mind.dm b/code/datums/mind.dm index af8be78dce7..9f1c9b517ed 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -634,7 +634,7 @@ new_objective.target_amount = target_number if ("custom") - var/expl = copytext(sanitize(input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null),1,MAX_MESSAGE_LEN) + var/expl = stripped_input(usr, "Custom objective:", "Objective", objective ? objective.explanation_text : "") if (!expl) return new_objective = new /datum/objective new_objective.owner = src diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 523ccd0d4f9..c02b72338b0 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -345,7 +345,7 @@ datum/objective/steal/proc/select_target() //For admins setting objectives manua var/tmp_obj = new custom_target var/custom_name = tmp_obj:name qdel(tmp_obj) - custom_name = copytext(sanitize(input("Enter target name:", "Objective target", custom_name) as text|null),1,MAX_MESSAGE_LEN) + custom_name = stripped_input("Enter target name:", "Objective target", custom_name) if (!custom_name) return steal_target = custom_target explanation_text = "Steal [custom_name]." diff --git a/code/game/gamemodes/sandbox/airlock_maker.dm b/code/game/gamemodes/sandbox/airlock_maker.dm index 3fb4cd2c788..7a8f7beb7c7 100644 --- a/code/game/gamemodes/sandbox/airlock_maker.dm +++ b/code/game/gamemodes/sandbox/airlock_maker.dm @@ -75,7 +75,7 @@ datum/airlock_maker/Topic(var/href,var/list/href_list) return if("rename" in href_list) - var/newname = input(usr,"New airlock name:","Name the airlock",doorname) as null|text + var/newname = stripped_input(usr,"New airlock name:","Name the airlock",doorname) if(newname) doorname = newname if("access" in href_list) diff --git a/code/game/jobs/job/civilian.dm b/code/game/jobs/job/civilian.dm index 40289a5e0ec..836dca7e32e 100644 --- a/code/game/jobs/job/civilian.dm +++ b/code/game/jobs/job/civilian.dm @@ -110,92 +110,6 @@ Botanist H.equip_to_slot_or_del(new /obj/item/clothing/suit/apron(H), slot_wear_suit) H.equip_to_slot_or_del(new /obj/item/device/analyzer/plant_analyzer(H), slot_s_store) -/* -Quartermaster -*/ -/datum/job/qm - title = "Quartermaster" - flag = QUARTERMASTER - department_head = list("Head of Personnel") - department_flag = CIVILIAN - faction = "Station" - total_positions = 1 - spawn_positions = 1 - supervisors = "the head of personnel" - selection_color = "#dddddd" - - default_pda = /obj/item/device/pda/quartermaster - default_headset = /obj/item/device/radio/headset/headset_cargo - - access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mint, access_mining, access_mining_station, access_mineral_storeroom) - minimal_access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mint, access_mining, access_mining_station) - -/datum/job/qm/equip_items(var/mob/living/carbon/human/H) - H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/cargo(H), slot_w_uniform) - H.equip_to_slot_or_del(new /obj/item/clothing/shoes/sneakers/brown(H), slot_shoes) - H.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(H), slot_glasses) - H.equip_to_slot_or_del(new /obj/item/weapon/clipboard(H), slot_l_hand) - -/* -Cargo Technician -*/ -/datum/job/cargo_tech - title = "Cargo Technician" - flag = CARGOTECH - department_head = list("Head of Personnel") - department_flag = CIVILIAN - faction = "Station" - total_positions = 3 - spawn_positions = 2 - supervisors = "the quartermaster and the head of personnel" - selection_color = "#dddddd" - - default_pda = /obj/item/device/pda/cargo - default_headset = /obj/item/device/radio/headset/headset_cargo - - access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mint, access_mining, access_mining_station) - minimal_access = list(access_maint_tunnels, access_cargo, access_cargo_bot, access_mailsorting) - -/datum/job/cargo_tech/equip_items(var/mob/living/carbon/human/H) - H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/cargotech(H), slot_w_uniform) - H.equip_to_slot_or_del(new /obj/item/clothing/shoes/sneakers/black(H), slot_shoes) - -/* -Shaft Miner -*/ -/datum/job/mining - title = "Shaft Miner" - flag = MINER - department_head = list("Head of Personnel") - department_flag = CIVILIAN - faction = "Station" - total_positions = 3 - spawn_positions = 3 - supervisors = "the quartermaster and the head of personnel" - selection_color = "#dddddd" - - default_pda = /obj/item/device/pda/shaftminer - default_headset = /obj/item/device/radio/headset/headset_cargo - default_backpack = /obj/item/weapon/storage/backpack/industrial - default_satchel = /obj/item/weapon/storage/backpack/satchel_eng - default_storagebox = /obj/item/weapon/storage/box/engineer - - access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mint, access_mining, access_mining_station, access_mineral_storeroom) - minimal_access = list(access_mining, access_mint, access_mining_station, access_mailsorting, access_mineral_storeroom) - -/datum/job/mining/equip_items(var/mob/living/carbon/human/H) - H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/miner(H), slot_w_uniform) - H.equip_to_slot_or_del(new /obj/item/clothing/shoes/sneakers/black(H), slot_shoes) - - if(H.backbag == 1) - H.equip_to_slot_or_del(new /obj/item/weapon/crowbar(H), slot_l_hand) - H.equip_to_slot_or_del(new /obj/item/weapon/storage/bag/ore(H), slot_l_store) - H.equip_to_slot_or_del(new /obj/item/weapon/mining_voucher(H), slot_r_store) - else - H.equip_to_slot_or_del(new /obj/item/weapon/crowbar(H), slot_in_backpack) - H.equip_to_slot_or_del(new /obj/item/weapon/storage/bag/ore(H), slot_in_backpack) - H.equip_to_slot_or_del(new /obj/item/weapon/mining_voucher(H), slot_in_backpack) - /* Clown */ diff --git a/code/game/jobs/job/supply.dm b/code/game/jobs/job/supply.dm new file mode 100644 index 00000000000..38710b0738e --- /dev/null +++ b/code/game/jobs/job/supply.dm @@ -0,0 +1,85 @@ +/* +Quartermaster +*/ +/datum/job/qm + title = "Quartermaster" + flag = QUARTERMASTER + department_head = list("Head of Personnel") + department_flag = CIVILIAN + faction = "Station" + total_positions = 1 + spawn_positions = 1 + supervisors = "the head of personnel" + selection_color = "#dddddd" + + default_pda = /obj/item/device/pda/quartermaster + default_headset = /obj/item/device/radio/headset/headset_cargo + + access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mint, access_mining, access_mining_station, access_mineral_storeroom) + minimal_access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mint, access_mining, access_mining_station) + +/datum/job/qm/equip_items(var/mob/living/carbon/human/H) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/cargo(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/sneakers/brown(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(H), slot_glasses) + H.equip_to_slot_or_del(new /obj/item/weapon/clipboard(H), slot_l_hand) + +/* +Cargo Technician +*/ +/datum/job/cargo_tech + title = "Cargo Technician" + flag = CARGOTECH + department_head = list("Head of Personnel") + department_flag = CIVILIAN + faction = "Station" + total_positions = 3 + spawn_positions = 2 + supervisors = "the quartermaster and the head of personnel" + selection_color = "#dddddd" + + default_pda = /obj/item/device/pda/cargo + default_headset = /obj/item/device/radio/headset/headset_cargo + + access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mint, access_mining, access_mining_station) + minimal_access = list(access_maint_tunnels, access_cargo, access_cargo_bot, access_mailsorting) + +/datum/job/cargo_tech/equip_items(var/mob/living/carbon/human/H) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/cargotech(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/sneakers/black(H), slot_shoes) + +/* +Shaft Miner +*/ +/datum/job/mining + title = "Shaft Miner" + flag = MINER + department_head = list("Head of Personnel") + department_flag = CIVILIAN + faction = "Station" + total_positions = 3 + spawn_positions = 3 + supervisors = "the quartermaster and the head of personnel" + selection_color = "#dddddd" + + default_pda = /obj/item/device/pda/shaftminer + default_headset = /obj/item/device/radio/headset/headset_cargo + default_backpack = /obj/item/weapon/storage/backpack/industrial + default_satchel = /obj/item/weapon/storage/backpack/satchel_eng + default_storagebox = /obj/item/weapon/storage/box/engineer + + access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mint, access_mining, access_mining_station, access_mineral_storeroom) + minimal_access = list(access_mining, access_mint, access_mining_station, access_mailsorting, access_mineral_storeroom) + +/datum/job/mining/equip_items(var/mob/living/carbon/human/H) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/miner(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/sneakers/black(H), slot_shoes) + + if(H.backbag == 1) + H.equip_to_slot_or_del(new /obj/item/weapon/crowbar(H), slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/bag/ore(H), slot_l_store) + H.equip_to_slot_or_del(new /obj/item/weapon/mining_voucher(H), slot_r_store) + else + H.equip_to_slot_or_del(new /obj/item/weapon/crowbar(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/bag/ore(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/mining_voucher(H), slot_in_backpack) diff --git a/code/game/jobs/jobs.dm b/code/game/jobs/jobs.dm index 4b185dfd7fc..f5e4112a7c5 100644 --- a/code/game/jobs/jobs.dm +++ b/code/game/jobs/jobs.dm @@ -86,16 +86,20 @@ var/list/science_positions = list( ) -var/list/civilian_positions = list( +var/list/supply_positions = list( "Head of Personnel", + "Quartermaster", + "Cargo Technician", + "Shaft Miner", +) + + +var/list/civilian_positions = list( "Bartender", "Botanist", "Cook", "Janitor", "Librarian", - "Quartermaster", - "Cargo Technician", - "Shaft Miner", "Lawyer", "Chaplain", "Clown", diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm index 7ee8a0a8bda..914046a5649 100644 --- a/code/game/machinery/bots/mulebot.dm +++ b/code/game/machinery/bots/mulebot.dm @@ -324,7 +324,7 @@ obj/machinery/bot/mulebot/bot_reset() if("setid") refresh=0 - var/new_id = copytext(sanitize(input("Enter new bot ID", "Mulebot [suffix ? "([suffix])" : ""]", suffix) as text|null),1,MAX_NAME_LEN) + var/new_id = stripped_input(usr, "Enter new bot ID", "Mulebot [suffix ? "([suffix])" : ""]", suffix, MAX_NAME_LEN) refresh=1 if(new_id) suffix = new_id @@ -333,7 +333,7 @@ obj/machinery/bot/mulebot/bot_reset() if("sethome") refresh=0 - var/new_home = input("Enter new home tag", "Mulebot [suffix ? "([suffix])" : ""]", home_destination) as text|null + var/new_home = stripped_input(usr, "Enter new home tag", "Mulebot [suffix ? "([suffix])" : ""]", home_destination) refresh=1 if(new_home) home_destination = new_home diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index a35235d51a1..d673cf214a5 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -467,7 +467,7 @@ src.active2.fields[text("com_[]", href_list["del_c"])] = "Deleted" else if (href_list["search"]) - var/t1 = input("Search String: (Name, DNA, or ID)", "Med. records", null, null) as text + var/t1 = stripped_input(usr, "Search String: (Name, DNA, or ID)", "Med. records") if ((!( t1 ) || usr.stat || !( src.authenticated ) || usr.restrained() || ((!in_range(src, usr)) && (!istype(usr, /mob/living/silicon))))) return src.active1 = null diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm index 56e48b07b65..c96d9a79714 100644 --- a/code/game/machinery/computer/message.dm +++ b/code/game/machinery/computer/message.dm @@ -417,7 +417,7 @@ //Select Your Name if("Sender") - customsender = input(usr, "Please enter the sender's name.") as text|null + customsender = stripped_input(usr, "Please enter the sender's name.") //Select Receiver if("Recepient") @@ -430,12 +430,11 @@ //Enter custom job if("RecJob") - customjob = input(usr, "Please enter the sender's job.") as text|null + customjob = stripped_input(usr, "Please enter the sender's job.") //Enter message if("Message") - custommessage = input(usr, "Please enter your message.") as text|null - custommessage = copytext(sanitize(custommessage), 1, MAX_MESSAGE_LEN) + custommessage = stripped_input(usr, "Please enter your message.") //Send message if("Send") diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 5fe0b91cc05..6b4d124790f 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -514,7 +514,7 @@ What a mess.*/ switch(href_list["field"]) if("name") if (istype(active1, /datum/data/record) || istype(active2, /datum/data/record)) - var/t1 = input("Please input name:", "Secure. records", active1.fields["name"], null) as text + var/t1 = stripped_input(usr, "Please input name:", "Secure. records", active1.fields["name"], null) if ((!( t1 ) || !length(trim(t1)) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon)))) || active1 != a1) return if(istype(active1, /datum/data/record)) diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index b2ee6d682c3..917f519e5b7 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -204,12 +204,12 @@ Transponder Codes: