The One Where I Port Modals

This commit is contained in:
Chompstation Bot
2021-06-30 19:29:34 +00:00
parent 2457a62edd
commit b6e1989a01
468 changed files with 10519 additions and 1808 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -306,12 +306,6 @@ This actually tests if they have the same entries and values.
for(var/i=1, i<L.len, ++i)
L.Swap(i,rand(i,L.len))
//Return a list with no duplicate entries
/proc/uniquelist(var/list/L)
. = list()
for(var/i in L)
. |= i
//same, but returns nothing and acts on list in place (also handles associated values properly)
/proc/uniqueList_inplace(list/L)
var/temp = L.Copy()
@@ -867,3 +861,16 @@ var/global/list/json_cache = list()
catch(var/exception/e)
log_error("Exception during JSON decoding ([json_to_decode]): [e]")
return list()
//takes an input_key, as text, and the list of keys already used, outputting a replacement key in the format of "[input_key] ([number_of_duplicates])" if it finds a duplicate
//use this for lists of things that might have the same name, like mobs or objects, that you plan on giving to a player as input
/proc/avoid_assoc_duplicate_keys(input_key, list/used_key_list)
if(!input_key || !istype(used_key_list))
return
if(used_key_list[input_key])
used_key_list[input_key]++
input_key = "[input_key] ([used_key_list[input_key]])"
else
used_key_list[input_key] = 1
return input_key

View File

@@ -25,7 +25,7 @@
if(path != root)
choices.Insert(1,"/")
var/choice = input(src,"Choose a file to access:","Download",null) as null|anything in choices
var/choice = tgui_input_list(src, "Choose a file to access:", "Download", choices)
switch(choice)
if(null)
return

View File

@@ -8,6 +8,7 @@ var/global/list/silicon_mob_list = list() //List of all silicon mobs, includin
var/global/list/ai_list = list() //List of all AIs, including clientless
var/global/list/living_mob_list = list() //List of all alive mobs, including clientless. Excludes /mob/new_player
var/global/list/dead_mob_list = list() //List of all dead mobs, including clientless. Excludes /mob/new_player
var/global/list/observer_mob_list = list() //List of all /mob/observer/dead, including clientless.
var/global/list/listening_objects = list() //List of all objects which care about receiving messages (communicators, radios, etc)
var/global/list/cleanbot_reserved_turfs = list() //List of all turfs currently targeted by some cleanbot
@@ -201,6 +202,12 @@ GLOBAL_LIST_EMPTY(mannequins)
S.race_key = rkey //Used in mob icon caching.
GLOB.all_species[S.name] = S
//Shakey shakey shake
sortTim(GLOB.all_species, /proc/cmp_species, associative = TRUE)
//Split up the rest
for(var/speciesname in GLOB.all_species)
var/datum/species/S = GLOB.all_species[speciesname]
if(!(S.spawn_flags & SPECIES_IS_RESTRICTED))
GLOB.playable_species += S.name
if(S.spawn_flags & SPECIES_IS_WHITELISTED)

View File

@@ -533,19 +533,27 @@ var/global/list/remainless_species = list(SPECIES_PROMETHEAN,
var/datum/trait/instance = new path()
if(!instance.name)
continue //A prototype or something
var/category = instance.category
var/cost = instance.cost
traits_costs[path] = cost
all_traits[path] = instance
// Shakey shakey shake
sortTim(all_traits, /proc/cmp_trait_datums_name, associative = TRUE)
// Split 'em up
for(var/traitpath in all_traits)
var/datum/trait/T = all_traits[traitpath]
var/category = T.category
switch(category)
if(-INFINITY to -0.1)
negative_traits[path] = instance
negative_traits[traitpath] = T
if(0)
neutral_traits[path] = instance
if(!(instance.custom_only))
everyone_traits[path] = instance
neutral_traits[traitpath] = T
if(!(T.custom_only))
everyone_traits[traitpath] = T
if(0.1 to INFINITY)
positive_traits[path] = instance
positive_traits[traitpath] = T
// Weaver recipe stuff
paths = typesof(/datum/weaver_recipe/structure) - /datum/weaver_recipe/structure

View File

@@ -79,9 +79,19 @@
/proc/cmp_text_asc(a,b)
return sorttext(b,a)
///Tracks are sorted by genre then by title inside that.
/proc/cmp_media_track_asc(datum/track/A, datum/track/B)
var/genre_sort = sorttext(B.genre || "Uncategorized", A.genre || "Uncategorized")
return genre_sort || sorttext(B.title, A.title)
///Filters have a numerical priority.
/proc/cmp_filter_data_priority(list/A, list/B)
return A["priority"] - B["priority"]
///Traits have sort they have defined on them to categorize themselves into groups. After that, alphabetical.
/proc/cmp_trait_datums_name(datum/trait/A, datum/trait/B)
return A.sort == B.sort ? sorttext("[B.name]","[A.name]") : A.sort - B.sort
///Species have sort_hint they self-generate to hint themselves into groups. After that, alphabetical.
/proc/cmp_species(datum/species/A, datum/species/B)
return A.sort_hint == B.sort_hint ? sorttext("[B.name]","[A.name]") : A.sort_hint - B.sort_hint

View File

@@ -394,8 +394,9 @@ Turf and target are seperate in case you want to teleport some distance from a t
borgs[name] = A
if (borgs.len)
select = input("Unshackled borg signals detected:", "Borg selection", null, null) as null|anything in borgs
return borgs[select]
select = tgui_input_list(usr, "Unshackled borg signals detected:", "Borg selection", borgs)
if(select)
return borgs[select]
//When a borg is activated, it can choose which AI it wants to be slaved to
/proc/active_ais()
@@ -421,7 +422,7 @@ Turf and target are seperate in case you want to teleport some distance from a t
/proc/select_active_ai(var/mob/user)
var/list/ais = active_ais()
if(ais.len)
if(user) . = input(usr,"AI signals detected:", "AI selection") in ais
if(user) . = tgui_input_list(usr, "AI signals detected:", "AI selection", ais)
else . = pick(ais)
return .
@@ -1482,7 +1483,7 @@ var/mob/dview/dview_mob = new
/proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types())
if (value == FALSE) //nothing should be calling us with a number, so this is safe
value = input("Enter type to find (blank for all, cancel to cancel)", "Search for type") as null|text
value = input(usr, "Enter type to find (blank for all, cancel to cancel)", "Search for type") as null|text
if (isnull(value))
return
value = trim(value)
@@ -1496,7 +1497,7 @@ var/mob/dview/dview_mob = new
if(matches.len==1)
chosen = matches[1]
else
chosen = input("Select a type", "Pick Type", matches[1]) as null|anything in matches
chosen = tgui_input_list(usr, "Select a type", "Pick Type", matches)
if(!chosen)
return
chosen = matches[chosen]

View File

@@ -494,13 +494,13 @@
if("Show Camera List")
if(isAI(usr))
var/mob/living/silicon/ai/AI = usr
var/camera = input(AI) in AI.get_camera_list()
var/camera = tgui_input_list(AI, "Pick Camera:", "Camera Choice", AI.get_camera_list())
AI.ai_camera_list(camera)
if("Track With Camera")
if(isAI(usr))
var/mob/living/silicon/ai/AI = usr
var/target_name = input(AI) in AI.trackable_mobs()
var/target_name = tgui_input_list(AI, "Pick Mob:", "Mob Choice", AI.trackable_mobs())
AI.ai_camera_track(target_name)
if("Toggle Camera Light")

View File

@@ -125,7 +125,7 @@ SUBSYSTEM_DEF(game_master)
/datum/controller/subsystem/game_master/proc/choose_game_master(mob/user)
var/list/subtypes = subtypesof(/datum/game_master)
var/new_gm_path = input(user, "What kind of Game Master do you want?", "New Game Master", /datum/game_master/default) as null|anything in subtypes
var/new_gm_path = tgui_input_list(user, "What kind of Game Master do you want?", "New Game Master", subtypes)
if(new_gm_path)
log_and_message_admins("has swapped the current GM ([GM.type]) for a new GM ([new_gm_path]).")
GM = new new_gm_path(src)

View File

@@ -362,7 +362,7 @@ SUBSYSTEM_DEF(garbage)
return
if(!skip_alert)
if(alert("Running this will lock everything up for about 5 minutes. Would you like to begin the search?", "Find References", "Yes", "No") == "No")
if(tgui_alert(usr, "Running this will lock everything up for about 5 minutes. Would you like to begin the search?", "Find References", list("Yes", "No")) == "No")
running_find_references = null
return

View File

@@ -129,7 +129,7 @@ SUBSYSTEM_DEF(media_tracks)
if(isnull(genre)) // Cancel rather than empty string
return
var/secret = alert(C, "Optional: Mark track as secret?", "Track Secret", "Yes", "Cancel", "No")
var/secret = tgui_alert(C, "Optional: Mark track as secret?", "Track Secret", list("Yes", "Cancel", "No"))
if(secret == "Cancel")
return
else if(secret == "Yes")
@@ -137,7 +137,7 @@ SUBSYSTEM_DEF(media_tracks)
else
secret = FALSE
var/lobby = alert(C, "Optional: Mark track as lobby music?", "Track Lobby", "Yes", "Cancel", "No")
var/lobby = tgui_alert(C, "Optional: Mark track as lobby music?", "Track Lobby", list("Yes", "Cancel", "No"))
if(lobby == "Cancel")
return
else if(secret == "Yes")

View File

@@ -309,8 +309,8 @@ SUBSYSTEM_DEF(supply)
// Will delete the specified order from the user-side list
/datum/controller/subsystem/supply/proc/delete_order(var/datum/supply_order/O, var/mob/user)
// Making sure they know what they're doing
if(alert(user, "Are you sure you want to delete this record? If it has been approved, cargo points will NOT be refunded!", "Delete Record","No","Yes") == "Yes")
if(alert(user, "Are you really sure? There is no way to recover the order once deleted.", "Delete Record", "No", "Yes") == "Yes")
if(tgui_alert(user, "Are you sure you want to delete this record? If it has been approved, cargo points will NOT be refunded!", "Delete Record",list("No","Yes")) == "Yes")
if(tgui_alert(user, "Are you really sure? There is no way to recover the order once deleted.", "Delete Record", list("No","Yes")) == "Yes")
log_admin("[key_name(user)] has deleted supply order \ref[O] [O] from the user-side order history.")
order_history -= O
return
@@ -353,8 +353,8 @@ SUBSYSTEM_DEF(supply)
// Will delete the specified export receipt from the user-side list
/datum/controller/subsystem/supply/proc/delete_export(var/datum/exported_crate/E, var/mob/user)
// Making sure they know what they're doing
if(alert(user, "Are you sure you want to delete this record?", "Delete Record","No","Yes") == "Yes")
if(alert(user, "Are you really sure? There is no way to recover the receipt once deleted.", "Delete Record", "No", "Yes") == "Yes")
if(tgui_alert(user, "Are you sure you want to delete this record?", "Delete Record",list("No","Yes")) == "Yes")
if(tgui_alert(user, "Are you really sure? There is no way to recover the receipt once deleted.", "Delete Record", list("No","Yes")) == "Yes")
log_admin("[key_name(user)] has deleted export receipt \ref[E] [E] from the user-side export history.")
exported_crates -= E
return

View File

@@ -365,7 +365,7 @@ SUBSYSTEM_DEF(vote)
if("cancel")
if(usr.client.holder)
if("Yes" == alert(usr, "You are about to cancel this vote. Are you sure?", "Cancel Vote", "No", "Yes"))
if("Yes" == tgui_alert(usr, "You are about to cancel this vote. Are you sure?", "Cancel Vote", list("No", "Yes")))
reset()
if("toggle_restart")
if(usr.client.holder)

View File

@@ -82,7 +82,7 @@ SUBSYSTEM_DEF(webhooks)
to_chat(usr, SPAN_WARNING("Webhook list is empty; either webhooks are disabled, webhooks aren't configured, or the subsystem hasn't initialized."))
return
var/choice = input(usr, "Select a webhook to ping.", "Ping Webhook") as null|anything in SSwebhooks.webhook_decls
var/choice = tgui_input_list(usr, "Select a webhook to ping.", "Ping Webhook", SSwebhooks.webhook_decls)
if(choice && SSwebhooks.webhook_decls[choice])
var/decl/webhook/webhook = SSwebhooks.webhook_decls[choice]
log_and_message_admins("has pinged webhook [choice].", usr)

View File

@@ -99,7 +99,7 @@
options["LEGACY: transfer_controller"] = transfer_controller
options["LEGACY: gas_data"] = gas_data
var/pick = input(mob, "Choose a controller to debug/view variables of.", "VV controller:") as null|anything in options
var/pick = input(mob, "Choose a controller to debug/view variables of.", "VV controller:") as null|anything in options // Leaving as input() due to debug tool
if(!pick)
return
var/datum/D = options[pick]

View File

@@ -42,7 +42,7 @@
var/client/C = value["value"]
if (!C)
return
var/prompt = alert("Do you want to grant [C] access to view this VV window? (they will not be able to edit or change anysrc nor open nested vv windows unless they themselves are an admin)", "Confirm", "Yes", "No")
var/prompt = tgui_alert(usr, "Do you want to grant [C] access to view this VV window? (they will not be able to edit or change anysrc nor open nested vv windows unless they themselves are an admin)", "Confirm", list("Yes", "No"))
if (prompt != "Yes" || !usr.client)
return
message_admins("[key_name_admin(usr)] Showed [key_name_admin(C)] a <a href='?_src_=vars;datumrefresh=\ref[src]'>VV window</a>")
@@ -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))

View File

@@ -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, "<span class='warning'>Unfortunately, you were not fast enough, and there are no more available roles. Sorry.</span>")
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, "<span class='notice'>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.</span>")
else
to_chat(D, "<span class='warning'>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!</span>")
if("Yes")
if(!evaluate_candidate(D)) // Failed revalidation
to_chat(D, "<span class='warning'>Unfortunately, you no longer qualify for this role. Sorry.</span>")
else if(finished) // Already finished candidate list
to_chat(D, "<span class='warning'>Unfortunately, you were not fast enough, and there are no more available roles. Sorry.</span>")
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, "<span class='warning'>Unfortunately, you no longer qualify for this role. Sorry.</span>")
else if(finished) // Already finished candidate list
to_chat(D, "<span class='warning'>Unfortunately, you were not fast enough, and there are no more available roles. Sorry.</span>")
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

View File

@@ -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)
*/

View File

@@ -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())

View File

@@ -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 = "<B>[name]</B>[(current&&(current.real_name!=name))?" (as [current.real_name])":""]<br>"
@@ -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]")

View File

@@ -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)

View File

@@ -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 = ""

View File

@@ -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)

View File

@@ -34,7 +34,7 @@
message_admins("<span class='danger'>[src]([src.ckey]) attempted to convert [player.current].</span>")
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, "<span class='notice'>\The [player.current] joins the [faction.faction_descriptor]!</span>")
return

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -22,7 +22,7 @@
to_chat(src, "<span class='danger'>We have no genomes, not even our own, and cannot regenerate.</span>")
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, "<span class='notice'>We will attempt to regenerate our form.</span>")

View File

@@ -37,7 +37,7 @@ var/list/datum/dna/hivemind_bank = list()
to_chat(src, "<span class='notice'>The airwaves already have all of our DNA.</span>")
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, "<span class='notice'>There's no new DNA to absorb from the air.</span>")
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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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

View File

@@ -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, "<span class='notice'>You do not have enough space to write a proper rune.</span>")
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

View File

@@ -172,7 +172,7 @@ var/list/sacrificed = list()
to_chat(target, "<span class='danger'>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.</span>")
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.

View File

@@ -183,7 +183,7 @@
if(!A)
to_chat(U, "<span class='danger'>Capture failed!</span>: 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))

View File

@@ -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]

View File

@@ -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))

View File

@@ -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

View File

@@ -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<72>3RT5<54>^#COMU@(#$)TED)@$")
to_chat(target, "SYSTEM LOG: System re<72>3RT5<54>^#COMU@(#$)TED)@$")
for(var/i = 0, i < 5, i++)
var/temptxt = pick("1101000100101001010001001001",\
"0101000100100100000100010010",\

View File

@@ -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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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

View File

@@ -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, "<b>Sandbox: Created an airlock.</b>")
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)

View File

@@ -31,7 +31,9 @@
to_chat(user, "<span class='danger'>\The [src] has ran out of uses, and is now useless to you!</span>")
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

View File

@@ -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]

View File

@@ -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)

View File

@@ -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

View File

@@ -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]

View File

@@ -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

View File

@@ -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")

View File

@@ -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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -168,7 +168,7 @@
playsound(src, P.usesound, 50, 1)
to_chat(user, "<span class='notice'>You connect the monitor.</span>")
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]

View File

@@ -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)

View File

@@ -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

View File

@@ -45,7 +45,7 @@
to_chat(user, "<span class='warning'>This guest pass is already deactivated!</span>")
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 </3
user.visible_message("<span class='notice'>\The [user] deactivates \the [src].</span>")
@@ -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

View File

@@ -37,7 +37,7 @@
to_chat(user, "<span class='notice'>No ID is inserted.</span>")
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)

View File

@@ -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]

View File

@@ -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("<span class='notice'>[key_name_admin(usr)] emagged [key_name_admin(R)] using robotic console!</span>")

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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

View File

@@ -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))

View File

@@ -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)))

View File

@@ -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("<span class='notice'>[usr] has set \the [src] [m] mode [!O?"off":"on"].</span>", "<span class='notice'>You set \the [src] [m] mode [!O?"off":"on"].</span>")
@@ -51,7 +51,7 @@
if(!length(contents))
to_chat(user, "<span class='notice'>\The [src] is empty.</span>")
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, "<span class='notice'>You remove the [E] from \the [src].</span>")
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
..()

View File

@@ -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

View File

@@ -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, "<span class='notice'>You request an AI's presence.</span>")
@@ -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.

View File

@@ -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")

View File

@@ -150,7 +150,7 @@ Transponder Codes:<UL>"}
usr.set_machine(src)
if(href_list["locedit"])
var/newloc = sanitize(input("Enter New Location", "Navigation Beacon", location) as text|null)
var/newloc = sanitize(input(usr, "Enter New Location", "Navigation Beacon", location) as text|null)
if(newloc)
location = newloc
updateDialog()
@@ -158,12 +158,12 @@ Transponder Codes:<UL>"}
else if(href_list["edit"])
var/codekey = href_list["code"]
var/newkey = input("Enter Transponder Code Key", "Navigation Beacon", codekey) as text|null
var/newkey = input(usr, "Enter Transponder Code Key", "Navigation Beacon", codekey) as text|null
if(!newkey)
return
var/codeval = codes[codekey]
var/newval = input("Enter Transponder Code Value", "Navigation Beacon", codeval) as text|null
var/newval = input(usr, "Enter Transponder Code Value", "Navigation Beacon", codeval) as text|null
if(!newval)
newval = codekey
return
@@ -180,11 +180,11 @@ Transponder Codes:<UL>"}
else if(href_list["add"])
var/newkey = input("Enter New Transponder Code Key", "Navigation Beacon") as text|null
var/newkey = input(usr, "Enter New Transponder Code Key", "Navigation Beacon") as text|null
if(!newkey)
return
var/newval = input("Enter New Transponder Code Value", "Navigation Beacon") as text|null
var/newval = input(usr, "Enter New Transponder Code Value", "Navigation Beacon") as text|null
if(!newval)
newval = "1"
return

View File

@@ -413,7 +413,7 @@ GLOBAL_LIST_BOILERPLATE(allCasters, /obj/machinery/newscaster)
set_temp("Error: Could not submit feed channel to network: A feed channel already exists under your name.", "danger", FALSE)
return TRUE
var/choice = alert("Please confirm Feed channel creation","Network Channel Handler","Confirm","Cancel")
var/choice = tgui_alert(usr, "Please confirm Feed channel creation","Network Channel Handler",list("Confirm","Cancel"))
if(choice == "Confirm")
news_network.CreateFeedChannel(channel_name, our_user, c_locked)
set_temp("Feed channel [channel_name] created successfully.", "success", FALSE)
@@ -425,7 +425,7 @@ GLOBAL_LIST_BOILERPLATE(allCasters, /obj/machinery/newscaster)
for(var/datum/feed_channel/F in news_network.network_channels)
if((!F.locked || F.author == scanned_user) && !F.censored)
available_channels += F.channel_name
var/new_channel_name = input(usr, "Choose receiving Feed Channel", "Network Channel Handler") as null|anything in available_channels
var/new_channel_name = tgui_input_list(usr, "Choose receiving Feed Channel", "Network Channel Handler", available_channels)
if(new_channel_name)
channel_name = new_channel_name
return TRUE
@@ -490,11 +490,11 @@ GLOBAL_LIST_BOILERPLATE(allCasters, /obj/machinery/newscaster)
set_temp("Error: Could not submit wanted issue to network: Author unverified.", "danger", FALSE)
return TRUE
var/choice = alert("Please confirm Wanted Issue change.", "Network Security Handler", "Confirm", "Cancel")
var/choice = tgui_alert(usr, "Please confirm Wanted Issue change.", "Network Security Handler", list("Confirm", "Cancel"))
if(choice == "Confirm")
if(news_network.wanted_issue)
if(news_network.wanted_issue.is_admin_message)
alert("The wanted issue has been distributed by a [using_map.company_name] higherup. You cannot edit it.", "Ok")
tgui_alert_async(usr, "The wanted issue has been distributed by a [using_map.company_name] higherup. You cannot edit it.")
return
news_network.wanted_issue.author = channel_name
news_network.wanted_issue.body = msg
@@ -519,9 +519,9 @@ GLOBAL_LIST_BOILERPLATE(allCasters, /obj/machinery/newscaster)
if(!securityCaster)
return FALSE
if(news_network.wanted_issue.is_admin_message)
alert("The wanted issue has been distributed by a [using_map.company_name] higherup. You cannot take it down.","Ok")
tgui_alert_async(usr, "The wanted issue has been distributed by a [using_map.company_name] higherup. You cannot take it down.")
return
var/choice = alert("Please confirm Wanted Issue removal","Network Security Handler","Confirm","Cancel")
var/choice = tgui_alert(usr, "Please confirm Wanted Issue removal","Network Security Handler",list("Confirm","Cancel"))
if(choice=="Confirm")
news_network.wanted_issue = null
for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allCasters)
@@ -534,7 +534,7 @@ GLOBAL_LIST_BOILERPLATE(allCasters, /obj/machinery/newscaster)
return FALSE
var/datum/feed_channel/FC = locate(params["ref"])
if(FC.is_admin_channel)
alert("This channel was created by a [using_map.company_name] Officer. You cannot censor it.","Ok")
tgui_alert_async(usr, "This channel was created by a [using_map.company_name] Officer. You cannot censor it.")
return
if(FC.author != "\[REDACTED\]")
FC.backup_author = FC.author
@@ -549,7 +549,7 @@ GLOBAL_LIST_BOILERPLATE(allCasters, /obj/machinery/newscaster)
return FALSE
var/datum/feed_message/MSG = locate(params["ref"])
if(MSG.is_admin_message)
alert("This message was created by a [using_map.company_name] Officer. You cannot censor its author.","Ok")
tgui_alert_async(usr, "This message was created by a [using_map.company_name] Officer. You cannot censor its author.")
return
if(MSG.author != "\[REDACTED\]")
MSG.backup_author = MSG.author
@@ -564,7 +564,7 @@ GLOBAL_LIST_BOILERPLATE(allCasters, /obj/machinery/newscaster)
return FALSE
var/datum/feed_message/MSG = locate(params["ref"])
if(MSG.is_admin_message)
alert("This channel was created by a [using_map.company_name] Officer. You cannot censor it.","Ok")
tgui_alert_async(usr, "This channel was created by a [using_map.company_name] Officer. You cannot censor it.")
return
if(MSG.body != "\[REDACTED\]")
MSG.backup_body = MSG.body
@@ -586,7 +586,7 @@ GLOBAL_LIST_BOILERPLATE(allCasters, /obj/machinery/newscaster)
return FALSE
var/datum/feed_channel/FC = locate(params["ref"])
if(FC.is_admin_channel)
alert("This channel was created by a [using_map.company_name] Officer. You cannot place a D-Notice upon it.","Ok")
tgui_alert_async(usr, "This channel was created by a [using_map.company_name] Officer. You cannot place a D-Notice upon it.")
return
FC.censored = !FC.censored
FC.update()

View File

@@ -59,7 +59,7 @@
if(metal < 1)
to_chat(user, "\The [src] is empty.")
return
var/answer = alert(user, "Do you want to eject all the metal in \the [src]?", , "Yes","No")
var/answer = tgui_alert(user, "Do you want to eject all the metal in \the [src]?", "Eject?", list("Yes","No"))
if(answer == "Yes")
var/amount_ejected = eject_metal()
user.visible_message("<span class='notice'>[user] removes [amount_ejected] sheet\s of [DEFAULT_WALL_MATERIAL] from the \the [src].</span>",
@@ -82,7 +82,7 @@
if(default_part_replacement(user, W))
return
if (!panel_open && W.is_wrench())
P_type_t = input("Choose pipe type", "Pipe type") as null|anything in Pipes
P_type_t = tgui_input_list(usr, "Choose pipe type", "Pipe type", Pipes)
P_type = Pipes[P_type_t]
user.visible_message("<span class='notice'>[user] has set \the [src] to manufacture [P_type_t].</span>", "<span class='notice'>You set \the [src] to manufacture [P_type_t].</span>")
return

View File

@@ -143,7 +143,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
if(reject_bad_text(params["write"]))
recipient = params["write"] //write contains the string of the receiving department's name
var/new_message = sanitize(input("Write your message:", "Awaiting Input", ""))
var/new_message = sanitize(input(usr, "Write your message:", "Awaiting Input", ""))
if(new_message)
message = new_message
screen = RCS_MESSAUTH
@@ -159,7 +159,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
. = TRUE
if("writeAnnouncement")
var/new_message = sanitize(input("Write your message:", "Awaiting Input", ""))
var/new_message = sanitize(input(usr, "Write your message:", "Awaiting Input", ""))
if(new_message)
message = new_message
else

View File

@@ -41,7 +41,9 @@ var/list/ai_status_emotions = list(
/proc/set_ai_status_displays(mob/user as mob)
var/list/ai_emotions = get_ai_emotions(user.ckey)
var/emote = input("Please, select a status!", "AI Status", null, null) in ai_emotions
var/emote = tgui_input_list(user, "Please, select a status:", "AI Status", ai_emotions)
if(!emote)
return
for (var/obj/machinery/M in machines) //change status
if(istype(M, /obj/machinery/ai_status_display))
var/obj/machinery/ai_status_display/AISD = M
@@ -80,9 +82,11 @@ var/list/ai_status_emotions = list(
attack_hand(user)
return
/obj/machinery/ai_status_display/attack_ai/(mob/user as mob)
/obj/machinery/ai_status_display/attack_ai(mob/user as mob)
var/list/ai_emotions = get_ai_emotions(user.ckey)
var/emote = input("Please, select a status!", "AI Status", null, null) in ai_emotions
var/emote = tgui_input_list(user, "Please, select a status:", "AI Status", ai_emotions)
if(!emote)
return
emotion = emote
/obj/machinery/ai_status_display/process()

View File

@@ -62,7 +62,7 @@
O.forceMove(src)
occupant = O
update_icon()
if(alert(O, "Are you sure you're ready to launch?", , "Yes", "No") == "Yes")
if(tgui_alert(O, "Are you sure you're ready to launch?", "Transport Pod", list("Yes", "No")) == "Yes")
in_transit = 1
playsound(src, HYPERSPACE_WARMUP)
else

View File

@@ -57,7 +57,7 @@
if(!occupant)
return
if(!forced && avatar && avatar.stat != DEAD && alert(avatar, "Someone wants to remove you from virtual reality. Do you want to leave?", "Leave VR?", "Yes", "No") == "No")
if(!forced && avatar && avatar.stat != DEAD && tgui_alert(avatar, "Someone wants to remove you from virtual reality. Do you want to leave?", "Leave VR?", list("Yes", "No")) == "No")
return
avatar.exit_vr()
@@ -89,7 +89,7 @@
if(avatar && !occupant.stat)
to_chat(occupant,"<span class='alien'>\The [src] begins to [pick("whir","hum","pulse")] as a screen appears in front of you.</span>")
if(alert(occupant, "This pod is already linked. Are you certain you wish to engage?", "Commmit?", "Yes", "No") == "No")
if(tgui_alert(occupant, "This pod is already linked. Are you certain you wish to engage?", "Commmit?", list("Yes", "No")) == "No")
visible_message("<span class='alien'>\The [src] pulses!</span>")
to_chat(occupant,"<span class='alien'>Your mind blurs as information bombards you.</span>")

View File

@@ -182,7 +182,7 @@
if(!occupant)
return
if(!forced && avatar && alert(avatar, "Someone wants to remove you from virtual reality. Do you want to leave?", "Leave VR?", "Yes", "No") == "No")
if(!forced && avatar && tgui_alert(avatar, "Someone wants to remove you from virtual reality. Do you want to leave?", "Leave VR?", list("Yes", "No")) == "No")
return
avatar.exit_vr()
@@ -218,7 +218,7 @@
avatar = occupant.vr_link
// If they've already enterred VR, and are reconnecting, prompt if they want a new body
if(avatar && alert(occupant, "You already have a [avatar.stat == DEAD ? "" : "deceased "]Virtual Reality avatar. Would you like to use it?", "New avatar", "Yes", "No") == "No")
if(avatar && tgui_alert(occupant, "You already have a [avatar.stat == DEAD ? "" : "deceased "]Virtual Reality avatar. Would you like to use it?", "New avatar", list("Yes", "No")) == "No")
// Delink the mob
occupant.vr_link = null
avatar = null
@@ -230,7 +230,7 @@
for(var/obj/effect/landmark/virtual_reality/sloc in landmarks_list)
vr_landmarks += sloc.name
S = input(occupant, "Please select a location to spawn your avatar at:", "Spawn location") as null|anything in vr_landmarks
S = tgui_input_list(occupant, "Please select a location to spawn your avatar at:", "Spawn location", vr_landmarks)
if(!S)
return 0

View File

@@ -28,7 +28,7 @@
update_type_list()
var/datum/frame/frame_types/frame_type
if(!build_machine_type)
var/datum/frame/frame_types/response = input(user, "What kind of frame would you like to make?", "Frame type request", null) as null|anything in frame_types_floor
var/datum/frame/frame_types/response = tgui_input_list(user, "What kind of frame would you like to make?", "Frame type request", null, frame_types_floor)
if(!response)
return
frame_type = response
@@ -82,7 +82,7 @@
var/datum/frame/frame_types/frame_type
if(!build_machine_type)
var/datum/frame/frame_types/response = input(user, "What kind of frame would you like to make?", "Frame type request", null) as null|anything in frame_types_wall
var/datum/frame/frame_types/response = tgui_input_list(user, "What kind of frame would you like to make?", "Frame type request", null, frame_types_wall)
if(!response)
return
frame_type = response

View File

@@ -40,7 +40,7 @@ var/global/datum/book_manager/book_mgr = new()
to_chat(src, "Only administrators may use this command.")
return
var/isbn = input("ISBN number?", "Delete Book") as num | null
var/isbn = input(usr, "ISBN number?", "Delete Book") as num | null
if(!isbn)
return
@@ -48,7 +48,8 @@ var/global/datum/book_manager/book_mgr = new()
var/DBConnection/dbcon = new()
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
if(!dbcon.IsConnected())
alert("Connection to Archive has been severed. Aborting.")
tgui_alert_async(usr, "Connection to Archive has been severed. Aborting.")
return
else
var/DBQuery/query = dbcon.NewQuery("DELETE FROM library WHERE id=[isbn]")
if(!query.Execute())

View File

@@ -109,7 +109,7 @@
for(var/obj/effect/overmap/visitable/V in range(1, our_ship))
choices[V.name] = V
var/choice = input("Choose an overmap destination:", "Destination", null) as null|anything in choices
var/choice = tgui_input_list(usr, "Choose an overmap destination:", "Destination", choices)
if(!choice)
var/backwards = turn(what_edge, 180)
forceMove(get_step(src,backwards)) //Move them back a step, then.
@@ -270,9 +270,9 @@
/obj/mecha/combat/fighter/gunpod/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/device/multitool) && state == 1)
var/new_paint_location = input("Please select a target zone.", "Paint Zone", null) as null|anything in list("Fore Stripe", "Aft Stripe", "CANCEL")
var/new_paint_location = tgui_input_list(usr, "Please select a target zone.", "Paint Zone", list("Fore Stripe", "Aft Stripe", "CANCEL"))
if(new_paint_location && new_paint_location != "CANCEL")
var/new_paint_color = input("Please select a paint color.", "Paint Color", null) as color|null
var/new_paint_color = input(usr, "Please select a paint color.", "Paint Color", null) as color|null
if(new_paint_color)
switch(new_paint_location)
if("Fore Stripe")

View File

@@ -143,7 +143,7 @@
..()
/obj/mecha/combat/phazon/janus/query_damtype()
var/new_damtype = alert(src.occupant,"Gauntlet Phase Emitter Mode",null,"Force","Energy","Stun")
var/new_damtype = tgui_alert(src.occupant,"Gauntlet Phase Emitter Mode","Damage Type",list("Force","Energy","Stun"))
switch(new_damtype)
if("Force")
damtype = "brute"

View File

@@ -108,7 +108,7 @@
switch(action)
if("species")
var/new_species = input(usr, "Select a new species", "Prosfab Species Selection", "Human") as null|anything in species_types
var/new_species = tgui_input_list(usr, "Select a new species", "Prosfab Species Selection", species_types)
if(new_species && tgui_status(usr, state) == STATUS_INTERACTIVE)
species = new_species
return
@@ -122,7 +122,7 @@
continue
new_manufacturers += A
var/new_manufacturer = input(usr, "Select a new manufacturer", "Prosfab Species Selection", "Unbranded") as null|anything in new_manufacturers
var/new_manufacturer = tgui_input_list(usr, "Select a new manufacturer", "Prosfab Species Selection", new_manufacturers)
if(new_manufacturer && tgui_status(usr, state) == STATUS_INTERACTIVE)
manufacturer = new_manufacturer
return

View File

@@ -1483,7 +1483,7 @@
else
to_chat(user, "<span class='notice'>\The [src] appears to be missing \the [slot].</span>")
var/remove = input(user, "Which component do you want to pry out?", "Remove Component") as null|anything in removable_components
var/remove = tgui_input_list(user, "Which component do you want to pry out?", "Remove Component", removable_components)
if(!remove)
return
@@ -2546,7 +2546,7 @@
if(newname)
name = newname
else
alert(occupant, "nope.avi")
tgui_alert_async(occupant, "nope.avi")
return
if (href_list["toggle_id_upload"])
if(usr != src.occupant) return
@@ -2596,7 +2596,7 @@
to_chat(user, "<span class='warning'>There are no passengers to remove.</span>")
return
var/pname = input(user, "Choose a passenger to forcibly remove.", "Forcibly Remove Passenger") as null|anything in passengers
var/pname = tgui_input_list(user, "Choose a passenger to forcibly remove.", "Forcibly Remove Passenger", passengers)
if (!pname)
return

View File

@@ -399,7 +399,7 @@
/obj/mecha/proc/query_damtype()
if(usr!=src.occupant)
return
var/new_damtype = alert(src.occupant,"Melee Damage Type",null,"Brute","Fire","Toxic")
var/new_damtype = tgui_alert(src.occupant,"Melee Damage Type","Damage Type",list("Brute","Fire","Toxic"))
switch(new_damtype)
if("Brute")
damtype = "brute"

View File

@@ -49,7 +49,7 @@
set name = "Set client perspective."
set category = "Exosuit Interface"
set src = usr.loc
var/perspective = input("Select a perspective type.",
var/perspective = input(usr, "Select a perspective type.",
"Client perspective",
occupant.client.perspective) in list(MOB_PERSPECTIVE,EYE_PERSPECTIVE)
to_world("[perspective]")

View File

@@ -68,9 +68,9 @@
/obj/mecha/working/hoverpod/shuttlecraft/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/device/multitool) && state == 1)
var/new_paint_location = input("Please select a target zone.", "Paint Zone", null) as null|anything in list("Central", "Engine", "Base", "Front", "CANCEL")
var/new_paint_location = tgui_input_list(usr, "Please select a target zone.", "Paint Zone", list("Central", "Engine", "Base", "Front", "CANCEL"))
if(new_paint_location && new_paint_location != "CANCEL")
var/new_paint_color = input("Please select a paint color.", "Paint Color", null) as color|null
var/new_paint_color = input(usr, "Please select a paint color.", "Paint Color", null) as color|null
if(new_paint_color)
switch(new_paint_location)
if("Central")

View File

@@ -18,7 +18,7 @@
if(can_buckle && has_buckled_mobs())
if(buckled_mobs.len > 1)
var/unbuckled = input(user, "Who do you wish to unbuckle?","Unbuckle Who?") as null|mob in buckled_mobs
var/unbuckled = tgui_input_list(user, "Who do you wish to unbuckle?","Unbuckle Who?", buckled_mobs)
if(user_unbuckle_mob(unbuckled, user))
return TRUE
else

View File

@@ -113,7 +113,7 @@
for(var/datum/poster/posteroption in poster_designs)
options[posteroption.listing_name] = posteroption
var/choice = input(M,"Choose a poster!","Customize Poster") in options
var/choice = tgui_input_list(M, "Choose a poster!", "Customize Poster", options)
if(src && choice && !M.stat && in_range(M,src))
var serial = poster_designs.Find(options[choice])
serial_number = serial
@@ -195,7 +195,7 @@
if(ruined)
return
if(alert("Do I want to rip the poster from the wall?","You think...","Yes","No") == "Yes")
if(tgui_alert(usr, "Do I want to rip the poster from the wall?","You think...",list("Yes","No")) == "Yes")
if(ruined || !user.Adjacent(src))
return

View File

@@ -102,7 +102,7 @@
for(var/decl/poster/posteroption in decls_repository.get_decls_of_type(/decl/poster))
options[posteroption.listing_name] = posteroption
var/choice = input(M,"Choose a poster!","Customize Poster") in options
var/choice = tgui_input_list(M, "Choose a poster!", "Customize Poster", options)
if(src && choice && !M.stat && in_range(M,src))
poster_decl = options[choice]
name = "rolled-up poly-poster - No.[poster_decl.icon_state]"
@@ -179,7 +179,7 @@
if(ruined)
return
if(alert("Do I want to rip the poster from the wall?","You think...","Yes","No") == "Yes")
if(tgui_alert(usr, "Do I want to rip the poster from the wall?","You think...",list("Yes","No")) == "Yes")
if(ruined || !user.Adjacent(src))
return

View File

@@ -114,13 +114,13 @@
var/obj/effect/spawner/newbomb/proto = /obj/effect/spawner/newbomb/radio/custom
var/p = input("Enter phoron amount (mol):","Phoron", initial(proto.phoron_amt)) as num|null
var/p = input(usr, "Enter phoron amount (mol):","Phoron", initial(proto.phoron_amt)) as num|null
if(p == null) return
var/o = input("Enter oxygen amount (mol):","Oxygen", initial(proto.oxygen_amt)) as num|null
var/o = input(usr, "Enter oxygen amount (mol):","Oxygen", initial(proto.oxygen_amt)) as num|null
if(o == null) return
var/c = input("Enter carbon dioxide amount (mol):","Carbon Dioxide", initial(proto.carbon_amt)) as num|null
var/c = input(usr, "Enter carbon dioxide amount (mol):","Carbon Dioxide", initial(proto.carbon_amt)) as num|null
if(c == null) return
new /obj/effect/spawner/newbomb/radio/custom(get_turf(mob), p, o, c)

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("New area name:","Blueprint Editing", ""), MAX_NAME_LEN)
var/str = sanitizeSafe(input(usr, "New area name:","Blueprint Editing", ""), 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("New area name:","Blueprint Editing", prevname), MAX_NAME_LEN)
var/str = sanitizeSafe(input(usr, "New area name:","Blueprint Editing", prevname), MAX_NAME_LEN)
if(!str || !length(str) || str==prevname) //cancel
return
if(length(str) > 50)

View File

@@ -168,8 +168,7 @@
/obj/structure/closet/body_bag/cryobag/attack_hand(mob/living/user)
if(used)
var/confirm = alert(user, "Are you sure you want to open \the [src]? \
\The [src] will expire upon opening it.", "Confirm Opening", "No", "Yes")
var/confirm = tgui_alert(user, "Are you sure you want to open \the [src]? \The [src] will expire upon opening it.", "Confirm Opening", list("No", "Yes"))
if(confirm == "Yes")
..() // Will call `toggle()` and open the bag.
else

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