diff --git a/code/ATMOSPHERICS/components/omni_devices/filter.dm b/code/ATMOSPHERICS/components/omni_devices/filter.dm index 00e2f9d5dc..dae4648790 100644 --- a/code/ATMOSPHERICS/components/omni_devices/filter.dm +++ b/code/ATMOSPHERICS/components/omni_devices/filter.dm @@ -181,7 +181,9 @@ if("switch_filter") if(!configuring || use_power) return - var/new_filter = input(usr,"Select filter mode:","Change filter",params["mode"]) in list("None", "Oxygen", "Nitrogen", "Carbon Dioxide", "Phoron", "Nitrous Oxide") + var/new_filter = tgui_input_list(usr, "Select filter mode:", "Change filter", list("None", "Oxygen", "Nitrogen", "Carbon Dioxide", "Phoron", "Nitrous Oxide")) + if(!new_filter) + return switch_filter(dir_flag(params["dir"]), mode_return_switch(new_filter)) . = TRUE diff --git a/code/ZAS/Diagnostic.dm b/code/ZAS/Diagnostic.dm index 7166b42dc6..fba2456802 100644 --- a/code/ZAS/Diagnostic.dm +++ b/code/ZAS/Diagnostic.dm @@ -50,7 +50,7 @@ "Down" = DOWN,\ #endif "N/A" = null) - var/direction = input("What direction do you wish to test?","Set direction") as null|anything in direction_list + var/direction = tgui_input_list(usr, "What direction do you wish to test?","Set direction", direction_list) if(!direction) return diff --git a/code/ZAS/Variable Settings.dm b/code/ZAS/Variable Settings.dm index f88e4816af..067fc6d1d8 100644 --- a/code/ZAS/Variable Settings.dm +++ b/code/ZAS/Variable Settings.dm @@ -96,7 +96,6 @@ var/global/vs_control/vsc = new settings -= "plc" /vs_control/proc/ChangeSettingsDialog(mob/user,list/L) - //var/which = input(user,"Choose a setting:") in L var/dat = "" for(var/ch in L) if(findtextEx(ch,"_RANDOM") || findtextEx(ch,"_DESC") || findtextEx(ch,"_METHOD") || findtextEx(ch,"_NAME")) continue @@ -150,7 +149,7 @@ var/global/vs_control/vsc = new if("Numeric") newvar = input(user,"Enter a number:","Settings",newvar) as num if("Bit Flag") - var/flag = input(user,"Toggle which bit?","Settings") in bitflags + var/flag = tgui_input_list(user,"Toggle which bit?","Settings", bitflags) flag = text2num(flag) if(newvar & flag) newvar &= ~flag @@ -194,7 +193,7 @@ var/global/vs_control/vsc = new /vs_control/proc/SetDefault(var/mob/user) var/list/setting_choices = list("Phoron - Standard", "Phoron - Low Hazard", "Phoron - High Hazard", "Phoron - Oh Shit!",\ "ZAS - Normal", "ZAS - Forgiving", "ZAS - Dangerous", "ZAS - Hellish", "ZAS/Phoron - Initial") - var/def = input(user, "Which of these presets should be used?") as null|anything in setting_choices + var/def = tgui_input_list(user, "Which of these presets should be used?", "Setting Choice", setting_choices) if(!def) return switch(def) diff --git a/code/__defines/misc.dm b/code/__defines/misc.dm index 7d35de8a18..3b2b1ad966 100644 --- a/code/__defines/misc.dm +++ b/code/__defines/misc.dm @@ -467,4 +467,19 @@ GLOBAL_LIST_INIT(all_volume_channels, list( #define DOCK_ATTEMPT_TIMEOUT 200 //how long in ticks we wait before assuming the docking controller is broken or blown up. #define SMES_TGUI_INPUT 1 +<<<<<<< HEAD #define SMES_TGUI_OUTPUT 2 +||||||| parent of f9e9aafd1d... Merge pull request #10756 from VOREStation/Arokha/fixes2 +#define SMES_TGUI_OUTPUT 2 +======= +#define SMES_TGUI_OUTPUT 2 + +#define TRAIT_SORT_NORMAL 1 +#define TRAIT_SORT_BODYTYPE 2 +#define TRAIT_SORT_SPECIES 3 + +#define SPECIES_SORT_NORMAL 1 +#define SPECIES_SORT_WHITELISTED 2 +#define SPECIES_SORT_RESTRICTED 3 +#define SPECIES_SORT_CUSTOM 4 +>>>>>>> f9e9aafd1d... Merge pull request #10756 from VOREStation/Arokha/fixes2 diff --git a/code/_global_vars/lists/species.dm b/code/_global_vars/lists/species.dm index f35568b07a..817f504f7f 100644 --- a/code/_global_vars/lists/species.dm +++ b/code/_global_vars/lists/species.dm @@ -1,10 +1,9 @@ //Languages/species/whitelist. GLOBAL_LIST_EMPTY_TYPED(all_species, /datum/species) +GLOBAL_LIST_EMPTY_TYPED(whitelisted_species, /datum/species) // Species that require a whitelist check. +GLOBAL_LIST_EMPTY_TYPED(playable_species, /datum/species) // A list of ALL playable species, whitelisted, latejoin or otherwise. + GLOBAL_LIST_EMPTY_TYPED(all_languages, /datum/language) GLOBAL_LIST_INIT(language_name_conflicts, list()) GLOBAL_LIST_INIT(language_keys, list()) // Table of say codes for all languages GLOBAL_LIST_INIT(language_key_conflicts, list()) -GLOBAL_LIST_INIT(whitelisted_species, list(SPECIES_HUMAN)) // Species that require a whitelist check. -// VOREStation edit - include custom species -GLOBAL_LIST_INIT(playable_species, list(SPECIES_HUMAN, SPECIES_CUSTOM)) // A list of ALL playable species, whitelisted, latejoin or otherwise. -// VOREStation edit end \ No newline at end of file diff --git a/code/_helpers/_lists.dm b/code/_helpers/_lists.dm index 0d1a46b2ea..d71897c466 100644 --- a/code/_helpers/_lists.dm +++ b/code/_helpers/_lists.dm @@ -306,12 +306,6 @@ This actually tests if they have the same entries and values. for(var/i=1, iVV window") @@ -68,7 +68,7 @@ names += componentsubtypes names += "---Elements---" names += sortTim(subtypesof(/datum/element), /proc/cmp_typepaths_asc) - var/result = input(usr, "Choose a component/element to add","better know what ur fuckin doin pal") as null|anything in names + var/result = input(usr, "Choose a component/element to add:", "Add Component/Element", names) if(!usr || !result || result == "---Components---" || result == "---Elements---") return if(QDELETED(src)) diff --git a/code/datums/ghost_query.dm b/code/datums/ghost_query.dm index f3a84d533d..d40ef7bab8 100644 --- a/code/datums/ghost_query.dm +++ b/code/datums/ghost_query.dm @@ -11,18 +11,13 @@ var/wait_time = 60 SECONDS // How long to wait until returning the list of candidates. var/cutoff_number = 0 // If above 0, when candidates list reaches this number, further potential candidates are rejected. +/// Begin the ghost asking /datum/ghost_query/proc/query() // First, ask all the ghosts who want to be asked. - for(var/mob/observer/dead/D in player_list) - if(!D.MayRespawn()) - continue // They can't respawn for whatever reason. - if(D.client) - if(be_special_flag && !(D.client.prefs.be_special & be_special_flag) ) - continue // They don't want to see the prompt. - for(var/ban in check_bans) - if(jobban_isbanned(D, ban)) - continue // They're banned from this role. - ask_question(D.client) + for(var/mob/observer/dead/D as anything in observer_mob_list) + if(evaluate_candidate(D)) + ask_question(D) + // Then wait awhile. while(!finished) sleep(1 SECOND) @@ -31,36 +26,73 @@ finished = TRUE // Prune the list after the wait, incase any candidates logged out. - for(var/mob/observer/dead/D in candidates) - if(!D.client || !D.key) - candidates.Remove(D) + for(var/mob/observer/dead/D as anything in candidates) + if(!evaluate_candidate(D)) + candidates -= D // Now we're done. finished = TRUE return candidates -/datum/ghost_query/proc/ask_question(var/client/C) - spawn(0) - if(!C) - return - window_flash(C) - if(query_sound) - SEND_SOUND(C, sound(query_sound)) - var/response = alert(C, question, "[role_name] request", "Yes", "No", "Never for this round") - if(response == "Yes") - response = alert(C, "Are you sure you want to play as a [role_name]?", "[role_name] request", "Yes", "No") // Protection from a misclick. - if(!C || !src) - return - if(response == "Yes") - if(finished || (cutoff_number && candidates.len >= cutoff_number) ) - to_chat(C, "Unfortunately, you were not fast enough, and there are no more available roles. Sorry.") - return - candidates.Add(C.mob) - if(cutoff_number && candidates.len >= cutoff_number) - finished = TRUE // Finish now if we're full. - else if(response == "Never for this round") +/// Test a candidate for allowance to join as this +/datum/ghost_query/proc/evaluate_candidate(mob/observer/dead/candidate) + if(!istype(candidate)) + return FALSE // Changed mobs or something who knows + if(!candidate.client) + return FALSE // No client to ask + if(!candidate.MayRespawn()) + return FALSE // They can't respawn for whatever reason. + if(be_special_flag && !(candidate.client.prefs.be_special & be_special_flag) ) + return FALSE // They don't want to see the prompt. + for(var/ban in check_bans) + if(jobban_isbanned(candidate, ban)) + return FALSE // They're banned from this role. + + return TRUE + +/// Send async alerts and ask for responses. Expects you to have tested D for client and type already +/datum/ghost_query/proc/ask_question(var/mob/observer/dead/D) + var/client/C = D.client + window_flash(C) + + if(query_sound) + SEND_SOUND(C, sound(query_sound)) + + tgui_alert_async(D, question, "[role_name] request", list("Yes", "No", "Never for this round"), CALLBACK(src, .proc/get_reply), wait_time SECONDS) + +/// Process an async alert response +/datum/ghost_query/proc/get_reply(response) + var/mob/observer/dead/D = usr + if(!D?.client) + return + + // Unhandled are "No" and "Nevermind" responses, which should just do nothing + + // This response is always fine, doesn't warrant retesting + switch(response) + if("Never for this round") if(be_special_flag) - C.prefs.be_special ^= be_special_flag + D.client.prefs.be_special ^= be_special_flag + to_chat(D, "You will not be prompted to join similar roles to [role_name] for the rest of this round. Note: If you save your character now, it will save this permanently.") + else + to_chat(D, "This type of ghost-joinable role doesn't have a role type flag associated with it, so I can't prevent future requests, sorry. Bug a dev!") + if("Yes") + if(!evaluate_candidate(D)) // Failed revalidation + to_chat(D, "Unfortunately, you no longer qualify for this role. Sorry.") + else if(finished) // Already finished candidate list + to_chat(D, "Unfortunately, you were not fast enough, and there are no more available roles. Sorry.") + else // Prompt a second time + tgui_alert_async(D, "Are you sure you want to play as a [role_name]?", "[role_name] request", list("I'm Sure", "Nevermind"), CALLBACK(src, .proc/get_reply), wait_time SECONDS) + + if("I'm Sure") + if(!evaluate_candidate(D)) // Failed revalidation + to_chat(D, "Unfortunately, you no longer qualify for this role. Sorry.") + else if(finished) // Already finished candidate list + to_chat(D, "Unfortunately, you were not fast enough, and there are no more available roles. Sorry.") + else // Accept their nomination + candidates.Add(D) + if(cutoff_number && candidates.len >= cutoff_number) + finished = TRUE // Finish now if we're full. // Normal things. /datum/ghost_query/promethean diff --git a/code/datums/locations/locations.dm b/code/datums/locations/locations.dm index 0081318eb0..a9cf9294fb 100644 --- a/code/datums/locations/locations.dm +++ b/code/datums/locations/locations.dm @@ -30,47 +30,11 @@ var/global/datum/locations/milky_way/all_locations = new() /proc/choose_location_datum(client/user) var/datum/locations/choice = all_locations while(length(choice.contents) > 0) //For some reason it wouldn't let me do contents.len even when I defined it as a list. - var/specific = alert(user, "The location currently selected is [choice.name]. More specific options exist, would you like to pick a more specific location?", - "Choose location", "Yes", "No") + var/specific = tgui_alert(user, "The location currently selected is [choice.name]. More specific options exist, would you like to pick a more specific location?", "Choose location", list("Yes", "No")) if(specific == "Yes" && length(choice.contents) > 0) - choice = input(user, "Please choose a location.","Locations") as null|anything in choice.contents + choice = tgui_input_list(user, "Please choose a location.", "Locations", choice.contents) else break to_chat(user,choice.name) to_chat(user,choice.desc) return choice - -// var/datum/locations/choice = input(user, "Please choose a location.","Locations") as null|anything in all_locations -// if(choice && choice.contents.len > 0) - - -/* -/datum/locations/proc/show_contents() -// to_world("[src]\n[desc]") - for(var/datum/locations/a in contents) - to_world("[a]\n[a.parent ? "Located in [a.parent]\n" : ""][a.desc]") - a.show_contents() - to_world("\n") - -/datum/locations/proc/count_locations() - var/i = 0 - for(var/datum/locations/a in contents) - i = i + a.count_locations() - return i - -/client/verb/show_locations() - set name = "Show Locations" - set category = "Debug" - locations.show_contents() - -/client/verb/debug_locations() - set name = "Debug Locations" - set category = "Debug" - debug_variables(locations) - -/client/verb/count_locations() - set name = "Count Locations" - set category = "Debug" - var/location_number = locations.count_locations() - to_world(location_number) -*/ diff --git a/code/datums/managed_browsers/feedback_form.dm b/code/datums/managed_browsers/feedback_form.dm index 00755c7624..b380018bea 100644 --- a/code/datums/managed_browsers/feedback_form.dm +++ b/code/datums/managed_browsers/feedback_form.dm @@ -112,7 +112,7 @@ GENERAL_PROTECT_DATUM(/datum/managed_browser/feedback_form) return if(href_list["feedback_choose_topic"]) - feedback_topic = input(my_client, "Choose the topic you want to submit your feedback under.", "Feedback Topic", feedback_topic) in config.sqlite_feedback_topics + feedback_topic = tgui_input_list(my_client, "Choose the topic you want to submit your feedback under.", "Feedback Topic", config.sqlite_feedback_topics) display() return @@ -129,7 +129,7 @@ GENERAL_PROTECT_DATUM(/datum/managed_browser/feedback_form) to_chat(my_client, span("warning", "It appears you didn't write anything, or it was invalid.")) return - if(alert(my_client, "Are you sure you want to submit your feedback?", "Confirm Submission", "No", "Yes") == "Yes") + if(tgui_alert(my_client, "Are you sure you want to submit your feedback?", "Confirm Submission", list("No", "Yes")) == "Yes") var/author_text = my_client.ckey if(can_be_private() && feedback_hide_author) author_text = md5(my_client.ckey + SSsqlite.get_feedback_pepper()) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index de91fd48ab..a35c23cd6b 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -122,7 +122,7 @@ /datum/mind/proc/edit_memory() if(!ticker || !ticker.mode) - alert("Not before round-start!", "Alert") + tgui_alert_async(usr, "Not before round-start!", "Alert") return var/out = "[name][(current&&(current.real_name!=name))?" (as [current.real_name])":""]
" @@ -220,7 +220,8 @@ if(!def_value)//If it's a custom objective, it will be an empty string. def_value = "custom" - var/new_obj_type = input("Select objective type:", "Objective type", def_value) as null|anything in list("assassinate", "debrain", "protect", "prevent", "harm", "brig", "hijack", "escape", "survive", "steal", "download", "mercenary", "capture", "absorb", "custom") + var/list/choices = list("assassinate", "debrain", "protect", "prevent", "harm", "brig", "hijack", "escape", "survive", "steal", "download", "mercenary", "capture", "absorb", "custom") + var/new_obj_type = tgui_input_list(usr, "Select objective type:", "Objective type", choices, def_value) if (!new_obj_type) return var/datum/objective/new_objective = null @@ -242,7 +243,7 @@ if (objective&&(objective.type in objective_list) && objective.target) def_target = objective.target.current - var/new_target = input("Select target:", "Objective target", def_target) as null|anything in possible_targets + var/new_target = tgui_input_list(usr, "Select target:", "Objective target", possible_targets, def_target) if (!new_target) return var/objective_path = text2path("/datum/objective/[new_obj_type]") diff --git a/code/datums/uplink/announcements.dm b/code/datums/uplink/announcements.dm index e85541a55d..f1db67a647 100644 --- a/code/datums/uplink/announcements.dm +++ b/code/datums/uplink/announcements.dm @@ -16,10 +16,10 @@ item_cost = 20 /datum/uplink_item/abstract/announcements/fake_centcom/extra_args(var/mob/user) - var/title = sanitize(input("Enter your announcement title.", "Announcement Title") as null|text) + var/title = sanitize(input(usr, "Enter your announcement title.", "Announcement Title") as null|text) if(!title) return - var/message = sanitize(input("Enter your announcement message.", "Announcement Title") as null|text) + var/message = sanitize(input(usr, "Enter your announcement message.", "Announcement Title") as null|text) if(!message) return return list("title" = title, "message" = message) diff --git a/code/defines/obj.dm b/code/defines/obj.dm index 3a7517507d..e6228ab2e2 100644 --- a/code/defines/obj.dm +++ b/code/defines/obj.dm @@ -8,12 +8,9 @@ return attack_hand(user) /obj/structure/signpost/attack_hand(mob/user as mob) - switch(alert("Travel back to ss13?",,"Yes","No")) - if("Yes") - if(user.z != src.z) return - user.forceMove(pick(latejoin)) - if("No") - return + if(tgui_alert(user, "Travel back to ss13?","Return?",list("Yes","No")) == "Yes") + if(user.z != src.z) return + user.forceMove(pick(latejoin)) /obj/effect/mark var/mark = "" diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index ac8176e910..5e4692557b 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -257,7 +257,7 @@ for (var/obj/machinery/camera/C in cameras) friendly_cameras.Add(C.c_tag) - var/target = input("Select the camera to observe", null) as null|anything in friendly_cameras + var/target = tgui_input_list(usr, "Select the camera to observe", "Select Camera", friendly_cameras) if (!target) return for (var/obj/machinery/camera/C in cameras) diff --git a/code/game/antagonist/antagonist_factions.dm b/code/game/antagonist/antagonist_factions.dm index 15191897ce..6e18b57a3b 100644 --- a/code/game/antagonist/antagonist_factions.dm +++ b/code/game/antagonist/antagonist_factions.dm @@ -34,7 +34,7 @@ message_admins("[src]([src.ckey]) attempted to convert [player.current].") player.rev_cooldown = world.time+100 - var/choice = alert(player.current,"Asked by [src]: Do you want to join the [faction.faction_descriptor]?","Join the [faction.faction_descriptor]?","No!","Yes!") + var/choice = tgui_alert(player.current, "Asked by [src]: Do you want to join the [faction.faction_descriptor]?", "Join the [faction.faction_descriptor]?", list("No!","Yes!")) if(choice == "Yes!" && faction.add_antagonist_mind(player, 0, faction.faction_role_text, faction.faction_welcome)) to_chat(src, "\The [player.current] joins the [faction.faction_descriptor]!") return diff --git a/code/game/antagonist/station/highlander.dm b/code/game/antagonist/station/highlander.dm index 708f047a57..9b54383278 100644 --- a/code/game/antagonist/station/highlander.dm +++ b/code/game/antagonist/station/highlander.dm @@ -56,7 +56,7 @@ var/datum/antagonist/highlander/highlanders /proc/only_one() if(!ticker) - alert("The game hasn't started yet!") + tgui_alert_async(usr,"The game hasn't started yet!") return for(var/mob/living/carbon/human/H in player_list) diff --git a/code/game/base_turf.dm b/code/game/base_turf.dm index 92bf5c9f8d..3f78c6fba4 100644 --- a/code/game/base_turf.dm +++ b/code/game/base_turf.dm @@ -19,11 +19,11 @@ if(!holder) return - var/choice = input("Which Z-level do you wish to set the base turf for?") as num|null + var/choice = input(usr, "Which Z-level do you wish to set the base turf for?") as num|null if(!choice) return - var/new_base_path = input("Please select a turf path (cancel to reset to /turf/space).") as null|anything in typesof(/turf) + var/new_base_path = tgui_input_list(usr, "Please select a turf path (cancel to reset to /turf/space).", "Set Base Turf", typesof(/turf)) if(!new_base_path) new_base_path = /turf/space using_map.base_turf_by_z["[choice]"] = new_base_path diff --git a/code/game/gamemodes/changeling/changeling_powers.dm b/code/game/gamemodes/changeling/changeling_powers.dm index f6d6695b19..54b1b4c1e0 100644 --- a/code/game/gamemodes/changeling/changeling_powers.dm +++ b/code/game/gamemodes/changeling/changeling_powers.dm @@ -221,7 +221,7 @@ var/global/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","E var/list/victims = list() for(var/mob/living/carbon/C in oview(changeling.sting_range)) victims += C - var/mob/living/carbon/T = input(src, "Who will we sting?") as null|anything in victims + var/mob/living/carbon/T = tgui_input_list(src, "Who will we sting?", "Sting!", victims) if(!T) return diff --git a/code/game/gamemodes/changeling/powers/fake_death.dm b/code/game/gamemodes/changeling/powers/fake_death.dm index 65fce3cecf..daa0b9e246 100644 --- a/code/game/gamemodes/changeling/powers/fake_death.dm +++ b/code/game/gamemodes/changeling/powers/fake_death.dm @@ -22,7 +22,7 @@ to_chat(src, "We have no genomes, not even our own, and cannot regenerate.") return 0 - if(!C.stat && alert("Are we sure we wish to regenerate? We will appear to be dead while doing so.","Revival","Yes","No") == "No") + if(!C.stat && tgui_alert(src, "Are we sure we wish to regenerate? We will appear to be dead while doing so.","Revival",list("Yes","No")) == "No") return to_chat(C, "We will attempt to regenerate our form.") diff --git a/code/game/gamemodes/changeling/powers/hivemind.dm b/code/game/gamemodes/changeling/powers/hivemind.dm index 105de8f4f5..d07542875a 100644 --- a/code/game/gamemodes/changeling/powers/hivemind.dm +++ b/code/game/gamemodes/changeling/powers/hivemind.dm @@ -37,7 +37,7 @@ var/list/datum/dna/hivemind_bank = list() to_chat(src, "The airwaves already have all of our DNA.") return - var/S = input("Select a DNA to channel: ", "Channel DNA", null) as null|anything in names + var/S = tgui_input_list(src, "Select a DNA to channel:", "Channel DNA", names) if(!S) return var/datum/absorbed_dna/chosen_dna = changeling.GetDNA(S) @@ -67,7 +67,7 @@ var/list/datum/dna/hivemind_bank = list() to_chat(src, "There's no new DNA to absorb from the air.") return - var/S = input("Select a DNA absorb from the air: ", "Absorb DNA", null) as null|anything in names + var/S = tgui_input_list(src, "Select a DNA to absorb:", "Absorb DNA", names) if(!S) return var/datum/absorbed_dna/chosen_dna = names[S] if(!chosen_dna) diff --git a/code/game/gamemodes/changeling/powers/lesser_form.dm b/code/game/gamemodes/changeling/powers/lesser_form.dm index ef82337d52..aa70756344 100644 --- a/code/game/gamemodes/changeling/powers/lesser_form.dm +++ b/code/game/gamemodes/changeling/powers/lesser_form.dm @@ -46,7 +46,7 @@ for(var/datum/dna/DNA in changeling.absorbed_dna) names += "[DNA.real_name]" - var/S = input("Select the target DNA: ", "Target DNA", null) as null|anything in names + var/S = tgui_input_list(src, "Select the target DNA:", "Target DNA", names) if(!S) return var/datum/dna/chosen_dna = changeling.GetDNA(S) diff --git a/code/game/gamemodes/changeling/powers/transform.dm b/code/game/gamemodes/changeling/powers/transform.dm index 6dd16061a1..535efbcac1 100644 --- a/code/game/gamemodes/changeling/powers/transform.dm +++ b/code/game/gamemodes/changeling/powers/transform.dm @@ -21,7 +21,7 @@ for(var/datum/absorbed_dna/DNA in changeling.absorbed_dna) names += "[DNA.name]" - var/S = input("Select the target DNA: ", "Target DNA", null) as null|anything in names + var/S = tgui_input_list(src, "Select the target DNA:", "Target DNA", names) if(!S) return var/datum/absorbed_dna/chosen_dna = changeling.GetDNA(S) diff --git a/code/game/gamemodes/changeling/powers/transform_sting.dm b/code/game/gamemodes/changeling/powers/transform_sting.dm index 1f6bc7b93d..f831f9eb17 100644 --- a/code/game/gamemodes/changeling/powers/transform_sting.dm +++ b/code/game/gamemodes/changeling/powers/transform_sting.dm @@ -16,13 +16,11 @@ if(!changeling) return 0 - - var/list/names = list() for(var/datum/dna/DNA in changeling.absorbed_dna) names += "[DNA.real_name]" - var/S = input("Select the target DNA: ", "Target DNA", null) as null|anything in names + var/S = tgui_input_list(src, "Select the target DNA:", "Target DNA", names) if(!S) return diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm index 4b095d2cd1..5a33a1d49a 100644 --- a/code/game/gamemodes/cult/ritual.dm +++ b/code/game/gamemodes/cult/ritual.dm @@ -330,10 +330,10 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa"," return if (C>=26 + runedec + cult.current_antagonists.len) //including the useless rune at the secret room, shouldn't count against the limit of 25 runes - Urist - alert("The cloth of reality can't take that much of a strain. Remove some runes first!") + tgui_alert_async(user, "The cloth of reality can't take that much of a strain. Remove some runes first!") return else - switch(alert("You open the tome",,"Read it","Scribe a rune", "Cancel")) + switch(tgui_alert(user, "You open the tome", "Tome", list("Read it","Scribe a rune","Cancel"))) if("Cancel") return if("Read it") @@ -448,7 +448,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa"," if (!istype(user.loc,/turf)) to_chat(user, "You do not have enough space to write a proper rune.") var/list/runes = list("teleport", "itemport", "tome", "armor", "convert", "tear in reality", "emp", "drain", "seer", "raise", "obscure", "reveal", "astral journey", "manifest", "imbue talisman", "sacrifice", "wall", "freedom", "cultsummon", "deafen", "blind", "bloodboil", "communicate", "stun") - r = input("Choose a rune to scribe", "Rune Scribing") in runes //not cancellable. + r = input(usr, "Choose a rune to scribe", "Rune Scribing") in runes // Remains input() for extreme blocking var/obj/effect/rune/R = new /obj/effect/rune if(istype(user, /mob/living/carbon/human)) var/mob/living/carbon/human/H = user @@ -461,7 +461,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa"," var/list/words = list("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri") var/beacon if(usr) - beacon = input("Select the last rune", "Rune Scribing") in words + beacon = input(usr, "Select the last rune", "Rune Scribing") in words // Remains input() for extreme blocking R.word1=cultwords["travel"] R.word2=cultwords["self"] R.word3=beacon @@ -471,7 +471,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa"," var/list/words = list("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri") var/beacon if(usr) - beacon = input("Select the last rune", "Rune Scribing") in words + beacon = input(usr, "Select the last rune", "Rune Scribing") in words // Remains input() for extreme blocking R.word1=cultwords["travel"] R.word2=cultwords["other"] R.word3=beacon diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 7526cecad5..fac7066de4 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -172,7 +172,7 @@ var/list/sacrificed = list() to_chat(target, "And you were able to force it out of your mind. You now know the truth, there's something horrible out there, stop it and its minions at all costs.") else spawn() - var/choice = alert(target,"Do you want to join the cult?","Submit to Nar'Sie","Resist","Submit") + var/choice = tgui_alert(target,"Do you want to join the cult?","Submit to Nar'Sie",list("Resist","Submit")) waiting_for_input[target] = 0 if(choice == "Submit") //choosing 'Resist' does nothing of course. cult.add_antagonist(target.mind) @@ -826,7 +826,7 @@ var/list/sacrificed = list() users+=C var/dam = round(15 / users.len) if(users.len>=3) - var/mob/living/carbon/cultist = input("Choose the one who you want to free", "Followers of Geometer") as null|anything in (cultists - users) + var/mob/living/carbon/cultist = tgui_input_list(user, "Choose the one who you want to free", "Followers of Geometer", (cultists - users)) if(!cultist) return fizzle() if (cultist == user) //just to be sure. @@ -872,7 +872,7 @@ var/list/sacrificed = list() if(iscultist(C) && !C.stat) users += C if(users.len>=3) - var/mob/living/carbon/cultist = input("Choose the one who you want to summon", "Followers of Geometer") as null|anything in (cultists - user) + var/mob/living/carbon/cultist = tgui_input_list(user, "Choose the one who you want to summon", "Followers of Geometer", (cultists - user)) if(!cultist) return fizzle() if (cultist == user) //just to be sure. diff --git a/code/game/gamemodes/cult/soulstone.dm b/code/game/gamemodes/cult/soulstone.dm index 9c430d124c..3fbeb13a7f 100644 --- a/code/game/gamemodes/cult/soulstone.dm +++ b/code/game/gamemodes/cult/soulstone.dm @@ -183,7 +183,7 @@ if(!A) to_chat(U, "Capture failed!: The soul stone is empty! Go kill someone!") return; - var/construct_class = input(U, "Please choose which type of construct you wish to create.") as null|anything in possible_constructs + var/construct_class = tgui_input_list(U, "Please choose which type of construct you wish to create.", "Construct Type", possible_constructs) switch(construct_class) if("Juggernaut") var/mob/living/simple_mob/construct/juggernaut/Z = new /mob/living/simple_mob/construct/juggernaut (get_turf(T.loc)) diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index a7559052bc..7201142678 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -59,23 +59,23 @@ var/global/list/additional_antag_types = list() var/choice = "" switch(href_list["set"]) if("shuttle_delay") - choice = input("Enter a new shuttle delay multiplier") as num + choice = input(usr, "Enter a new shuttle delay multiplier") as num if(!choice || choice < 1 || choice > 20) return shuttle_delay = choice if("antag_scaling") - choice = input("Enter a new antagonist cap scaling coefficient.") as num + choice = input(usr, "Enter a new antagonist cap scaling coefficient.") as num if(isnull(choice) || choice < 0 || choice > 100) return antag_scaling_coeff = choice if("event_modifier_moderate") - choice = input("Enter a new moderate event time modifier.") as num + choice = input(usr, "Enter a new moderate event time modifier.") as num if(isnull(choice) || choice < 0 || choice > 100) return event_delay_mod_moderate = choice refresh_event_modifiers() if("event_modifier_severe") - choice = input("Enter a new moderate event time modifier.") as num + choice = input(usr, "Enter a new moderate event time modifier.") as num if(isnull(choice) || choice < 0 || choice > 100) return event_delay_mod_major = choice @@ -99,7 +99,7 @@ var/global/list/additional_antag_types = list() additional_antag_types -= antag.id message_admins("Admin [key_name_admin(usr)] removed [antag.role_text] template from game mode.") else if(href_list["add_antag_type"]) - var/choice = input("Which type do you wish to add?") as null|anything in all_antag_types + var/choice = tgui_input_list(usr, "Which type do you wish to add?", "Select Antag Type", all_antag_types) if(!choice) return var/datum/antagonist/antag = all_antag_types[choice] diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/HARDWARE.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/HARDWARE.dm index c9b76400d9..df2d223c6e 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/HARDWARE.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/HARDWARE.dm @@ -23,7 +23,7 @@ user.bombing_core = 0 return - var/choice = alert("Really destroy core?", "Core self-destruct", "YES", "NO") + var/choice = tgui_alert(user, "Really destroy core?", "Core self-destruct", list("YES", "NO")) if(choice != "YES") return @@ -82,7 +82,7 @@ user.bombing_station = 0 return - var/choice = alert("Really destroy station?", "Station self-destruct", "YES", "NO") + var/choice = tgui_alert(user, "Really destroy station?", "Station self-destruct", list("YES", "NO")) if(choice != "YES") return if(!ability_prechecks(user, 0, 0)) diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/HELPERS.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/HELPERS.dm index 8c27df2732..677801f2c1 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/HELPERS.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/HELPERS.dm @@ -23,9 +23,8 @@ for(var/datum/malf_hardware/H in hardware_list) possible_choices += H.name - possible_choices += "CANCEL" - var/choice = input("Select desired hardware. You may only choose one hardware piece!: ") in possible_choices - if(choice == "CANCEL") + var/choice = tgui_input_list(user, "Select desired hardware. You may only choose one hardware piece!: ", "Hardware Choice", possible_choices) + if(!choice) return var/note = null @@ -47,7 +46,7 @@ error("Hardware without description: [C]") return - var/confirmation = alert("[note] - Is this what you want?", "Hardware selection", "Yes", "No") + var/confirmation = tgui_alert(user, "[note] - Is this what you want?", "Hardware selection", list("Yes", "No")) if(confirmation != "Yes") to_chat(user, "Selection cancelled. Use command again to select") return @@ -85,7 +84,7 @@ return var/datum/malf_research/res = user.research - var/datum/malf_research_ability/tar = input("Select your next research target") in res.available_abilities + var/datum/malf_research_ability/tar = tgui_input_list(user, "Select your next research target", "Select Research", res.available_abilities) if(!tar) return res.focus = tar diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_interdiction.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_interdiction.dm index aeb2439eeb..e4db9a662d 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_interdiction.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_interdiction.dm @@ -47,7 +47,7 @@ if(!ability_prechecks(user, price)) return - if (alert(user, "Really recall the shuttle?", "Recall Shuttle: ", "Yes", "No") != "Yes") + if (tgui_alert(user, "Really recall the shuttle?", "Recall Shuttle: ", list(list("Yes", "No"))) != "Yes") return if(!ability_pay(user, price)) @@ -95,14 +95,16 @@ return - var/targetname = input("Select unlock target: ") in robot_names + var/targetname = tgui_input_list(user, "Select unlock target:", "Unlock Target", robot_names) + if(!targetname) + return for(var/mob/living/silicon/robot/R in robots) if(targetname == R.name) target = R break if(target) - if(alert(user, "Really try to unlock cyborg [target.name]?", "Unlock Cyborg", "Yes", "No") != "Yes") + if(tgui_alert(user, "Really try to unlock cyborg [target.name]?", "Unlock Cyborg", list("Yes", "No")) != "Yes") return if(!ability_pay(user, price)) return @@ -153,7 +155,7 @@ return if(target) - if(alert(user, "Really try to hack cyborg [target.name]?", "Hack Cyborg", "Yes", "No") != "Yes") + if(tgui_alert(user, "Really try to hack cyborg [target.name]?", "Hack Cyborg", list("Yes", "No")) != "Yes") return if(!ability_pay(user, price)) return @@ -213,7 +215,7 @@ return if(target) - if(alert(user, "Really try to hack AI [target.name]?", "Hack AI", "Yes", "No") != "Yes") + if(tgui_alert(user, "Really try to hack AI [target.name]?", "Hack AI", list("Yes", "No")) != "Yes") return if(!ability_pay(user, price)) return @@ -248,7 +250,7 @@ to_chat(target, "SYSTEM LOG: User: Admin - Connection Lost. Changes Reverted.") return to_chat(user, "Hack succeeded. The AI is now under your exclusive control.") - to_chat(target, "SYSTEM LOG: System re¡3RT5§^#COMU@(#$)TED)@$") + to_chat(target, "SYSTEM LOG: System re�3RT5�^#COMU@(#$)TED)@$") for(var/i = 0, i < 5, i++) var/temptxt = pick("1101000100101001010001001001",\ "0101000100100100000100010010",\ diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_manipulation.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_manipulation.dm index 9d9bed799a..40023f2cbe 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_manipulation.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_manipulation.dm @@ -71,7 +71,7 @@ if(!ability_prechecks(user, price)) return - var/action = input("Select required action: ") in list("Reset", "Add X-Ray", "Add Motion Sensor", "Add EMP Shielding") + var/action = tgui_input_list(user, "Select required action:", "Hack Camera", list("Reset", "Add X-Ray", "Add Motion Sensor", "Add EMP Shielding")) if(!action || !target) return diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm index 03f7474380..d8229e1562 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm @@ -93,8 +93,8 @@ if(!ability_prechecks(user, price)) return - var/title = input("Select message title: ") - var/text = input("Select message text: ") + var/title = input(usr, "Select message title: ") + var/text = input(usr, "Select message text: ") if(!title || !text || !ability_pay(user, price)) to_chat(user, "Hack Aborted") return @@ -120,8 +120,8 @@ if(!ability_prechecks(user, price)) return - var/alert_target = input("Select new alert level:") in list("green", "yellow", "violet", "orange", "blue", "red", "delta", "CANCEL") - if(!alert_target || !ability_pay(user, price) || alert_target == "CANCEL") + var/alert_target = tgui_input_list(user, "Select new alert level:", "Alert Level", list("green", "yellow", "violet", "orange", "blue", "red", "delta")) + if(!alert_target || !ability_pay(user, price)) to_chat(user, "Hack Aborted") return @@ -140,7 +140,7 @@ set desc = "500 CPU - Begins hacking station's primary firewall, quickly overtaking remaining APC systems. When completed grants access to station's self-destruct mechanism. Network administrators will probably notice this." var/price = 500 var/mob/living/silicon/ai/user = usr - if (alert(user, "Begin system override? This cannot be stopped once started. The network administrators will probably notice this.", "System Override:", "Yes", "No") != "Yes") + if (tgui_alert(user, "Begin system override? This cannot be stopped once started. The network administrators will probably notice this.", "System Override:", list("Yes", "No")) != "Yes") return if (!ability_prechecks(user, price) || !ability_pay(user, price) || user.system_override) if(user.system_override) diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm index 62406c3877..22cf1f7290 100644 --- a/code/game/gamemodes/nuclear/pinpointer.dm +++ b/code/game/gamemodes/nuclear/pinpointer.dm @@ -120,7 +120,7 @@ target=null location = null - switch(alert("Please select the mode you want to put the pinpointer in.", "Pinpointer Mode Select", "Location", "Disk Recovery", "Other Signature")) + switch(tgui_alert(usr, "Please select the mode you want to put the pinpointer in.", "Pinpointer Mode Select", list("Location", "Disk Recovery", "Other Signature"))) if("Location") mode = 1 @@ -145,12 +145,12 @@ if("Other Signature") mode = 2 - switch(alert("Search for item signature or DNA fragment?" , "Signature Mode Select" , "" , "Item" , "DNA")) + switch(tgui_alert(usr, "Search for item signature or DNA fragment?", "Signature Mode Select", list("Item", "DNA"))) if("Item") var/datum/objective/steal/itemlist itemlist = itemlist - var/targetitem = input("Select item to search for.", "Item Mode Select","") as null|anything in itemlist.possible_items + var/targetitem = tgui_input_list(usr, "Select item to search for.", "Item Mode Select", itemlist.possible_items) if(!targetitem) return target=locate(itemlist.possible_items[targetitem]) @@ -160,7 +160,7 @@ to_chat(usr, "You set the pinpointer to locate [targetitem]") if("DNA") - var/DNAstring = input("Input DNA string to search for." , "Please Enter String." , "") + var/DNAstring = input(usr, "Input DNA string to search for." , "Please Enter String." , "") if(!DNAstring) return for(var/mob/living/carbon/M in mob_list) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index d0c6e73573..326824ca77 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -473,15 +473,15 @@ var/global/list/all_objectives = list() /datum/objective/steal/proc/select_target() var/list/possible_items_all = possible_items+possible_items_special+"custom" - var/new_target = input("Select target:", "Objective target", steal_target) as null|anything in possible_items_all + var/new_target = tgui_input_list(usr, "Select target:", "Objective target", possible_items_all) if (!new_target) return if (new_target == "custom") - var/obj/item/custom_target = input("Select type:","Type") as null|anything in typesof(/obj/item) + var/obj/item/custom_target = tgui_input_list(usr, "Select type:", "Type", typesof(/obj/item)) if (!custom_target) return var/tmp_obj = new custom_target var/custom_name = tmp_obj:name qdel(tmp_obj) - custom_name = sanitize(input("Enter target name:", "Objective target", custom_name) as text|null) + custom_name = sanitize(input(usr, "Enter target name:", "Objective target", custom_name) as text|null) if (!custom_name) return target_name = custom_name steal_target = custom_target diff --git a/code/game/gamemodes/sandbox/h_sandbox.dm b/code/game/gamemodes/sandbox/h_sandbox.dm index 76bceb2982..08340f5a76 100644 --- a/code/game/gamemodes/sandbox/h_sandbox.dm +++ b/code/game/gamemodes/sandbox/h_sandbox.dm @@ -99,15 +99,15 @@ mob hsb.req_access = list() var/accesses = get_all_accesses() for(var/A in accesses) - if(alert(usr, "Will this airlock require [get_access_desc(A)] access?", "Sandbox:", "Yes", "No") == "Yes") + if(tgui_alert(usr, "Will this airlock require [get_access_desc(A)] access?", "Sandbox:", list("Yes", "No")) == "Yes") LAZYADD(hsb.req_access, A) hsb.loc = usr.loc to_chat(usr, "Sandbox: Created an airlock.") if("hsbcanister") var/list/hsbcanisters = typesof(/obj/machinery/portable_atmospherics/canister/) - /obj/machinery/portable_atmospherics/canister/ - var/hsbcanister = input(usr, "Choose a canister to spawn.", "Sandbox:") in hsbcanisters + "Cancel" - if(!(hsbcanister == "Cancel")) + var/hsbcanister = tgui_input_list(usr, "Choose a canister to spawn:", "Sandbox", hsbcanisters) + if(hsbcanister) new hsbcanister(usr.loc) if("hsbfueltank") //var/obj/hsb = new/obj/weldfueltank @@ -144,6 +144,6 @@ mob continue selectable += O - var/hsbitem = input(usr, "Choose an object to spawn.", "Sandbox:") in selectable + "Cancel" - if(hsbitem != "Cancel") + var/hsbitem = tgui_input_list(usr, "Choose an object to spawn:", "Sandbox", selectable) + if(hsbitem) new hsbitem(usr.loc) diff --git a/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm b/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm index 82138988b5..a15fcd5b35 100644 --- a/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm +++ b/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm @@ -31,7 +31,9 @@ to_chat(user, "\The [src] has ran out of uses, and is now useless to you!") return else - var/area_wanted = input(user, "Area to teleport to", "Teleportation") in teleportlocs + var/area_wanted = tgui_input_list(user, "Area to teleport to", "Teleportation", teleportlocs) + if(!area_wanted) + return var/area/A = teleportlocs[area_wanted] if(!A) return diff --git a/code/game/gamemodes/technomancer/spells/audible_deception.dm b/code/game/gamemodes/technomancer/spells/audible_deception.dm index fc67ba1ee3..ebd8974305 100644 --- a/code/game/gamemodes/technomancer/spells/audible_deception.dm +++ b/code/game/gamemodes/technomancer/spells/audible_deception.dm @@ -68,7 +68,7 @@ var/list/sound_options = available_sounds if(check_for_scepter()) sound_options["!!AIR HORN!!"] = 'sound/items/AirHorn.ogg' - var/new_sound = input("Select the sound you want to make.","Sounds") as null|anything in sound_options + var/new_sound = tgui_input_list(usr, "Select the sound you want to make.", "Sounds", sound_options) if(new_sound) selected_sound = sound_options[new_sound] diff --git a/code/game/gamemodes/technomancer/spells/control.dm b/code/game/gamemodes/technomancer/spells/control.dm index 0e0cf5eb20..3ca26b3b04 100644 --- a/code/game/gamemodes/technomancer/spells/control.dm +++ b/code/game/gamemodes/technomancer/spells/control.dm @@ -88,8 +88,7 @@ /obj/item/weapon/spell/control/on_use_cast(mob/living/user) if(controlled_mobs.len != 0) - var/choice = alert(user,"Would you like to release control of the entities you are controlling? They won't be friendly \ - to you anymore if you do this, so be careful.","Release Control?","No","Yes") + var/choice = tgui_alert(user,"Would you like to release control of the entities you are controlling? They won't be friendly to you anymore if you do this, so be careful.","Release Control?",list("No","Yes")) if(choice == "Yes") for(var/mob/living/L in controlled_mobs) deselect(L) diff --git a/code/game/gamemodes/technomancer/spells/illusion.dm b/code/game/gamemodes/technomancer/spells/illusion.dm index 5d626f7c47..dcadf53ffb 100644 --- a/code/game/gamemodes/technomancer/spells/illusion.dm +++ b/code/game/gamemodes/technomancer/spells/illusion.dm @@ -44,7 +44,7 @@ /obj/item/weapon/spell/illusion/on_use_cast(mob/user) if(illusion) - var/choice = alert(user, "Would you like to have \the [illusion] speak, or do an emote?", "Illusion", "Speak","Emote","Cancel") + var/choice = tgui_alert(user, "Would you like to have \the [illusion] speak, or do an emote?", "Illusion", list("Speak","Emote","Cancel")) switch(choice) if("Cancel") return diff --git a/code/game/gamemodes/technomancer/spells/summon/summon.dm b/code/game/gamemodes/technomancer/spells/summon/summon.dm index c7c94c0869..3f39f7d960 100644 --- a/code/game/gamemodes/technomancer/spells/summon/summon.dm +++ b/code/game/gamemodes/technomancer/spells/summon/summon.dm @@ -34,7 +34,7 @@ /obj/item/weapon/spell/summon/on_use_cast(mob/living/user) if(summon_options.len) - var/choice = input(user, "Choose a creature to kidnap from somewhere!", "Summon") as null|anything in summon_options + var/choice = tgui_input_list(user, "Choose a creature to kidnap from somewhere!", "Summon", summon_options) if(choice) summoned_mob_type = summon_options[choice] diff --git a/code/game/gamemodes/technomancer/spells/track.dm b/code/game/gamemodes/technomancer/spells/track.dm index ae342a46a1..461c4e8391 100644 --- a/code/game/gamemodes/technomancer/spells/track.dm +++ b/code/game/gamemodes/technomancer/spells/track.dm @@ -44,7 +44,7 @@ var/list/technomancer_belongings = list() if(L == user) continue mob_choices += L - var/choice = input(user,"Decide what or who to track.","Tracking") as null|anything in object_choices + mob_choices + var/choice = tgui_input_list(user, "Decide what or who to track.", "Tracking", (object_choices + mob_choices)) if(choice) tracked = choice tracking = 1 diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index 46f6710aaf..73c15fd667 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -326,7 +326,7 @@ if("ejectify") go_out() if("changestasis") - var/new_stasis = input("Levels deeper than 50% stasis level will render the patient unconscious.","Stasis Level") as null|anything in stasis_choices + var/new_stasis = tgui_input_list(usr, "Levels deeper than 50% stasis level will render the patient unconscious.","Stasis Level", stasis_choices) if(new_stasis) stasis_level = stasis_choices[new_stasis] if("auto_eject_dead_on") diff --git a/code/game/machinery/air_alarm.dm b/code/game/machinery/air_alarm.dm index 4c3b406fed..54ae1f942c 100644 --- a/code/game/machinery/air_alarm.dm +++ b/code/game/machinery/air_alarm.dm @@ -639,7 +639,7 @@ var/list/selected = TLV["temperature"] var/max_temperature = min(selected[3] - T0C, MAX_TEMPERATURE) var/min_temperature = max(selected[2] - T0C, MIN_TEMPERATURE) - var/input_temperature = input("What temperature would you like the system to mantain? (Capped between [min_temperature] and [max_temperature]C)", "Thermostat Controls", target_temperature - T0C) as num|null + var/input_temperature = input(usr, "What temperature would you like the system to mantain? (Capped between [min_temperature] and [max_temperature]C)", "Thermostat Controls", target_temperature - T0C) as num|null if(isnum(input_temperature)) if(input_temperature > max_temperature || input_temperature < min_temperature) to_chat(usr, "Temperature must be between [min_temperature]C and [max_temperature]C") @@ -693,7 +693,7 @@ var/env = params["env"] var/name = params["var"] - var/value = input("New [name] for [env]:", name, TLV[env][name]) as num|null + var/value = input(usr, "New [name] for [env]:", name, TLV[env][name]) as num|null if(!isnull(value) && !..()) if(value < 0) TLV[env][name] = -1 diff --git a/code/game/machinery/airconditioner_vr.dm b/code/game/machinery/airconditioner_vr.dm index 1aa2516085..4e9ce2d22b 100644 --- a/code/game/machinery/airconditioner_vr.dm +++ b/code/game/machinery/airconditioner_vr.dm @@ -47,7 +47,7 @@ turn_off() return if(istype(I, /obj/item/device/multitool)) - var/new_temp = input("Input a new target temperature, in degrees C.","Target Temperature", 20) as num + var/new_temp = input(usr, "Input a new target temperature, in degrees C.","Target Temperature", 20) as num if(!Adjacent(user) || user.incapacitated()) return new_temp = convert_c2k(new_temp) diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index 8895844b00..83fd594382 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -315,7 +315,7 @@ update_flag "\[Air\]" = "grey", \ "\[CAUTION\]" = "yellow", \ ) - var/label = input("Choose canister label", "Gas canister") as null|anything in colors + var/label = tgui_input_list(usr, "Choose canister label", "Gas canister", colors) if(label) canister_color = colors[label] icon_state = colors[label] @@ -332,7 +332,7 @@ update_flag pressure = 10*ONE_ATMOSPHERE . = TRUE else if(pressure == "input") - pressure = input("New release pressure ([ONE_ATMOSPHERE/10]-[10*ONE_ATMOSPHERE] kPa):", name, release_pressure) as num|null + pressure = input(usr, "New release pressure ([ONE_ATMOSPHERE/10]-[10*ONE_ATMOSPHERE] kPa):", name, release_pressure) as num|null if(!isnull(pressure) && !..()) . = TRUE else if(text2num(pressure) != null) diff --git a/code/game/machinery/bioprinter.dm b/code/game/machinery/bioprinter.dm index 43cd3e0e2d..b951a3c396 100644 --- a/code/game/machinery/bioprinter.dm +++ b/code/game/machinery/bioprinter.dm @@ -132,7 +132,7 @@ return if(container) - var/response = alert(user, "What do you want to do?", "Bioprinter Menu", "Print Limbs", "Cancel") + var/response = tgui_alert(user, "What do you want to do?", list("Bioprinter Menu", "Print Limbs", "Cancel")) if(response == "Print Limbs") printing_menu(user) else @@ -149,7 +149,7 @@ if(anomalous_organs) possible_list |= anomalous_products - var/choice = input("What would you like to print?") as null|anything in possible_list + var/choice = tgui_input_list(usr, "What would you like to print?", "Print Choice", possible_list) if(!choice || printing || (stat & (BROKEN|NOPOWER))) return diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index 17f82629d4..5cec5a5b42 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -101,16 +101,16 @@ C.auto_turn() - C.replace_networks(uniquelist(tempnetwork)) + C.replace_networks(uniqueList(tempnetwork)) C.c_tag = input for(var/i = 5; i >= 0; i -= 1) - var/direct = input(user, "Direction?", "Assembling Camera", null) in list("LEAVE IT", "NORTH", "EAST", "SOUTH", "WEST" ) + var/direct = tgui_input_list(user, "Direction?", "Assembling Camera", list("NORTH", "EAST", "SOUTH", "WEST", "LEAVE IT")) if(direct != "LEAVE IT") C.dir = text2dir(direct) if(i != 0) - var/confirm = alert(user, "Is this what you want? Chances Remaining: [i]", "Confirmation", "Yes", "No") + var/confirm = tgui_alert(user, "Is this what you want? Chances Remaining: [i]", "Confirmation", list("Yes", "No")) if(confirm == "Yes") break return diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index 9fd6d026a0..5bb4d80194 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -168,7 +168,7 @@ playsound(src, P.usesound, 50, 1) to_chat(user, "You connect the monitor.") if(!brain) - var/open_for_latejoin = alert(user, "Would you like this core to be open for latejoining AIs?", "Latejoin", "Yes", "Yes", "No") == "Yes" + var/open_for_latejoin = tgui_alert(user, "Would you like this core to be open for latejoining AIs?", "Latejoin", list("Yes", "No")) == "Yes" var/obj/structure/AIcore/deactivated/D = new(loc) if(open_for_latejoin) empty_playable_ai_cores += D @@ -262,7 +262,7 @@ GLOBAL_LIST_BOILERPLATE(all_deactivated_AI_cores, /obj/structure/AIcore/deactiva for(var/obj/structure/AIcore/deactivated/D in GLOB.all_deactivated_AI_cores) cores["[D] ([D.loc.loc])"] = D - var/id = input("Which core?", "Toggle AI Core Latejoin", null) as null|anything in cores + var/id = tgui_input_list(usr, "Which core?", "Toggle AI Core Latejoin", cores) if(!id) return var/obj/structure/AIcore/deactivated/D = cores[id] diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 14fae598ff..059f058243 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -1182,7 +1182,7 @@ // Have the customer punch in the PIN before checking if there's enough money. Prevents people from figuring out acct is // empty at high security levels if(customer_account.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2) - var/attempt_pin = input("Enter pin code", "Vendor transaction") as num + var/attempt_pin = input(usr, "Enter pin code", "Vendor transaction") as num customer_account = attempt_account_access(I.associated_account_number, attempt_pin, 2) if(!customer_account) diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index 3473216a7b..58565ead6e 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -206,7 +206,7 @@ if(is_authenticated() && modify) var/t1 = params["assign_target"] if(t1 == "Custom") - var/temp_t = sanitize(input("Enter a custom job assignment.","Assignment"), 45) + var/temp_t = sanitize(input(usr, "Enter a custom job assignment.","Assignment"), 45) //let custom jobs function as an impromptu alt title, mainly for sechuds if(temp_t && modify) modify.assignment = temp_t diff --git a/code/game/machinery/computer/guestpass.dm b/code/game/machinery/computer/guestpass.dm index e2e1535728..283d86aeff 100644 --- a/code/game/machinery/computer/guestpass.dm +++ b/code/game/machinery/computer/guestpass.dm @@ -45,7 +45,7 @@ to_chat(user, "This guest pass is already deactivated!") return - var/confirm = alert("Do you really want to deactivate this guest pass? (you can't reactivate it)", "Confirm Deactivation", "Yes", "No") + var/confirm = tgui_alert(usr, "Do you really want to deactivate this guest pass? (you can't reactivate it)", "Confirm Deactivation", list("Yes", "No")) if(confirm == "Yes") //rip guest pass \The [user] deactivates \the [src].") @@ -162,15 +162,15 @@ mode = params["mode"] if("giv_name") - var/nam = sanitizeName(input("Person pass is issued to", "Name", giv_name) as text|null) + var/nam = sanitizeName(input(usr, "Person pass is issued to", "Name", giv_name) as text|null) if(nam) giv_name = nam if("reason") - var/reas = sanitize(input("Reason why pass is issued", "Reason", reason) as text|null) + var/reas = sanitize(input(usr, "Reason why pass is issued", "Reason", reason) as text|null) if(reas) reason = reas if("duration") - var/dur = input("Duration (in minutes) during which pass is valid (up to 360 minutes).", "Duration") as num|null //VOREStation Edit + var/dur = input(usr, "Duration (in minutes) during which pass is valid (up to 360 minutes).", "Duration") as num|null //VOREStation Edit if(dur) if(dur > 0 && dur <= 360) //VOREStation Edit duration = dur diff --git a/code/game/machinery/computer/id_restorer_vr.dm b/code/game/machinery/computer/id_restorer_vr.dm index af7f9304f9..c9bbf49a27 100644 --- a/code/game/machinery/computer/id_restorer_vr.dm +++ b/code/game/machinery/computer/id_restorer_vr.dm @@ -37,7 +37,7 @@ to_chat(user, "No ID is inserted.") return - var/choice = alert(user,"What do you want to do?","[src]","Restore ID access","Eject ID","Cancel") + var/choice = tgui_alert(user,"What do you want to do?","[src]",list("Restore ID access","Eject ID","Cancel")) if(user.incapacitated() || (get_dist(src, user) > 1)) return switch(choice) diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm index 87b35e8cd0..b39e8513bf 100644 --- a/code/game/machinery/computer/message.dm +++ b/code/game/machinery/computer/message.dm @@ -198,7 +198,7 @@ //Find a server if("find") if(message_servers && message_servers.len > 1) - linkedServer = input(usr,"Please select a server.", "Select a server.", null) as null|anything in message_servers + linkedServer = tgui_input_list(usr,"Please select a server.", "Select a server.", message_servers) set_temp("NOTICE: Server selected.", "alert") else if(message_servers && message_servers.len > 0) linkedServer = message_servers[1] diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm index 0a57a5e4c5..309453ee29 100644 --- a/code/game/machinery/computer/robot.dm +++ b/code/game/machinery/computer/robot.dm @@ -220,8 +220,8 @@ var/mob/living/silicon/robot/R = locate(params["ref"]) if(!can_hack(usr, R)) return - var/choice = input("Really hack [R.name]? This cannot be undone.") in list("Yes", "No") - if(choice != "Yes") + var/choice = tgui_alert(usr, "Really hack [R.name]? This cannot be undone.", "Hack?", list("Yes", "No")) + if(choice == "No") return log_game("[key_name(usr)] emagged [key_name(R)] using robotic console!") message_admins("[key_name_admin(usr)] emagged [key_name_admin(R)] using robotic console!") diff --git a/code/game/machinery/computer/shuttle.dm b/code/game/machinery/computer/shuttle.dm index d3de10cba1..d4e5867549 100644 --- a/code/game/machinery/computer/shuttle.dm +++ b/code/game/machinery/computer/shuttle.dm @@ -28,7 +28,7 @@ to_chat(user, "The access level of [W:registered_name]\'s card is not high enough. ") return 0 - var/choice = alert(user, text("Would you like to (un)authorize a shortened launch time? [] authorization\s are still needed. Use abort to cancel all authorizations.", src.auth_need - src.authorized.len), "Shuttle Launch", "Authorize", "Repeal", "Abort") + var/choice = tgui_alert(user, text("Would you like to (un)authorize a shortened launch time? [] authorization\s are still needed. Use abort to cancel all authorizations.", src.auth_need - src.authorized.len), "Shuttle Launch", list("Authorize", "Repeal", "Abort")) if(emergency_shuttle.location() && user.get_active_hand() != W) return 0 switch(choice) @@ -58,7 +58,7 @@ src.authorized = list( ) else if (istype(W, /obj/item/weapon/card/emag) && !emagged) - var/choice = alert(user, "Would you like to launch the shuttle?","Shuttle control", "Launch", "Cancel") + var/choice = tgui_alert(user, "Would you like to launch the shuttle?", "Shuttle control", list("Launch", "Cancel")) if(!emagged && !emergency_shuttle.location() && user.get_active_hand() == W) switch(choice) diff --git a/code/game/machinery/computer/supply.dm b/code/game/machinery/computer/supply.dm index 6b9b0f7380..e805e151bd 100644 --- a/code/game/machinery/computer/supply.dm +++ b/code/game/machinery/computer/supply.dm @@ -169,7 +169,7 @@ "cost" = P.cost, "group" = P.group, "contraband" = P.contraband, - "manifest" = uniquelist(P.manifest), + "manifest" = uniqueList(P.manifest), "random" = P.num_contained, "ref" = "\ref[P]" ) @@ -201,7 +201,7 @@ var/list/payload = list( "name" = P.name, "cost" = P.cost, - "manifest" = uniquelist(P.manifest), + "manifest" = uniqueList(P.manifest), "ref" = "\ref[P]", "random" = P.num_contained, ) @@ -394,7 +394,7 @@ if(!(authorization & SUP_ACCEPT_ORDERS)) return FALSE var/list/L = E.contents[params["index"]] - var/field = alert(usr, "Select which field to edit", , "Name", "Quantity", "Value") + var/field = tgui_alert(usr, "Select which field to edit", "Field Choice", list("Name", "Quantity", "Value")) var/new_val = sanitize(input(usr, field, "Enter the new value for this field:", L[lowertext(field)]) as null|text) if(!new_val) diff --git a/code/game/machinery/computer3/computers/card.dm b/code/game/machinery/computer3/computers/card.dm index f9e43aaa7d..d2f6074c78 100644 --- a/code/game/machinery/computer3/computers/card.dm +++ b/code/game/machinery/computer3/computers/card.dm @@ -305,7 +305,7 @@ if(auth) var/t1 = href_list["assign"] if(t1 == "Custom") - var/temp_t = sanitize(input("Enter a custom job assignment.","Assignment")) + var/temp_t = sanitize(input(usr, "Enter a custom job assignment.","Assignment")) if(temp_t) t1 = temp_t set_default_access(t1) diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 3cd05e69b5..51d97df592 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -664,7 +664,7 @@ var/willing = null //We don't want to allow people to be forced into despawning. if(M.client) - if(alert(M,"Would you like to enter long-term storage?",,"Yes","No") == "Yes") + if(tgui_alert(M,"Would you like to enter long-term storage?","Cryopod",list("Yes","No")) == "Yes") if(!M) return willing = 1 else diff --git a/code/game/machinery/deployable_vr.dm b/code/game/machinery/deployable_vr.dm index 2f2f2f6adf..25fdd4ed60 100644 --- a/code/game/machinery/deployable_vr.dm +++ b/code/game/machinery/deployable_vr.dm @@ -71,7 +71,7 @@ /obj/structure/barricade/cutout/attackby(var/obj/I, var/mob/user) if(is_type_in_list(I, painters)) - var/choice = input(user, "What would you like to paint the cutout as?", "Cutout Painting") as null|anything in cutout_types + var/choice = tgui_input_list(user, "What would you like to paint the cutout as?", "Cutout Painting", cutout_types) if(!choice || !Adjacent(user, src) || I != user.get_active_hand()) return TRUE if(do_after(user, 10 SECONDS, src)) diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index ed639f4288..1363148331 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -154,8 +154,8 @@ if(A.firedoors_closed) alarmed = 1 - var/answer = alert(user, "Would you like to [density ? "open" : "close"] this [src.name]?[ alarmed && density ? "\nNote that by doing so, you acknowledge any damages from opening this\n[src.name] as being your own fault, and you will be held accountable under the law." : ""]",\ - "\The [src]", "Yes, [density ? "open" : "close"]", "No") + var/answer = tgui_alert(user, "Would you like to [density ? "open" : "close"] this [src.name]?[ alarmed && density ? "\nNote that by doing so, you acknowledge any damages from opening this\n[src.name] as being your own fault, and you will be held accountable under the law." : ""]",\ + "\The [src]", list("Yes, [density ? "open" : "close"]", "No")) if(answer == "No") return if(user.incapacitated() || (get_dist(src, user) > 1 && !issilicon(user))) diff --git a/code/game/machinery/floorlayer.dm b/code/game/machinery/floorlayer.dm index d8a2b463e2..c77dff55ec 100644 --- a/code/game/machinery/floorlayer.dm +++ b/code/game/machinery/floorlayer.dm @@ -35,7 +35,7 @@ /obj/machinery/floorlayer/attackby(var/obj/item/W as obj, var/mob/user as mob) if(W.is_wrench()) - var/m = input("Choose work mode", "Mode") as null|anything in mode + var/m = tgui_input_list(usr, "Choose work mode", "Mode", mode) mode[m] = !mode[m] var/O = mode[m] user.visible_message("[usr] has set \the [src] [m] mode [!O?"off":"on"].", "You set \the [src] [m] mode [!O?"off":"on"].") @@ -51,7 +51,7 @@ if(!length(contents)) to_chat(user, "\The [src] is empty.") else - var/obj/item/stack/tile/E = input("Choose remove tile type.", "Tiles") as null|anything in contents + var/obj/item/stack/tile/E = tgui_input_list(usr, "Choose remove tile type.", "Tiles", contents) if(E) to_chat(user, "You remove the [E] from \the [src].") E.loc = src.loc @@ -59,7 +59,7 @@ return if(W.is_screwdriver()) - T = input("Choose tile type.", "Tiles") as null|anything in contents + T = tgui_input_list(usr, "Choose tile type.", "Tiles", contents) return ..() diff --git a/code/game/machinery/gear_dispenser.dm b/code/game/machinery/gear_dispenser.dm index 28a7e93d96..562c9906f4 100644 --- a/code/game/machinery/gear_dispenser.dm +++ b/code/game/machinery/gear_dispenser.dm @@ -188,7 +188,7 @@ var/list/dispenser_presets = list() dispenser_flags &= ~GD_BUSY return - var/choice = input("Select equipment to dispense.", "Equipment Dispenser") as null|anything in gear_list + var/choice = tgui_input_list(usr, "Select equipment to dispense.", "Equipment Dispenser", gear_list) if(!choice) dispenser_flags &= ~GD_BUSY diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 4c283cd301..fa9ab86e54 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -54,7 +54,7 @@ var/const/HOLOPAD_MODE = RANGE_BASED /obj/machinery/hologram/holopad/attack_hand(var/mob/living/carbon/human/user) //Carn: Hologram requests. if(!istype(user)) return - if(alert(user,"Would you like to request an AI's presence?",,"Yes","No") == "Yes") + if(tgui_alert(user,"Would you like to request an AI's presence?","Request AI",list("Yes","No")) == "Yes") if(last_request + 200 < world.time) //don't spam the AI with requests you jerk! last_request = world.time to_chat(user, "You request an AI's presence.") @@ -223,7 +223,7 @@ Holographic project of everything else. var/icon/flat_icon = icon(getFlatIcon(src,0))//Need to make sure it's a new icon so the old one is not reused. flat_icon.ColorTone(rgb(125,180,225))//Let's make it bluish. flat_icon.ChangeOpacity(0.5)//Make it half transparent. - var/input = input("Select what icon state to use in effect.",,"") + var/input = input(usr, "Select what icon state to use in effect.",,"") if(input) var/icon/alpha_mask = new('icons/effects/effects.dmi', "[input]") flat_icon.AddAlphaMask(alpha_mask)//Finally, let's mix in a distortion effect. diff --git a/code/game/machinery/holoposter.dm b/code/game/machinery/holoposter.dm index a273cc1474..d52e10b57a 100644 --- a/code/game/machinery/holoposter.dm +++ b/code/game/machinery/holoposter.dm @@ -84,7 +84,7 @@ GLOBAL_LIST_EMPTY(holoposters) return if (W.is_multitool()) playsound(src, 'sound/items/penclick.ogg', 60, 1) - icon_state = input("Available Posters", "Holographic Poster") as null|anything in postertypes + "random" + icon_state = tgui_input_list(usr, "Available Posters", "Holographic Poster", postertypes + "random") if(!Adjacent(user)) return if(icon_state == "random") diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index 6d4453d1f2..6a92186ac5 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -150,7 +150,7 @@ Transponder Codes: