Convert almost all alert() to tgui_alert()

This commit is contained in:
Aronai Sieyes
2021-06-25 17:03:35 -04:00
parent 70bff20384
commit 0da0c54388
191 changed files with 509 additions and 521 deletions
+3 -4
View File
@@ -160,7 +160,7 @@
return null
if(!config.guests_allowed && IsGuestKey(key))
alert(src,"This server doesn't allow guest accounts to play. Please go to http://www.byond.com/ and register for a key.","Guest","OK")
alert(src,"This server doesn't allow guest accounts to play. Please go to http://www.byond.com/ and register for a key.","Guest") // Not tgui_alert
del(src)
return
@@ -385,8 +385,7 @@
else
var/error_message = query_hours.ErrorMsg() // Need this out here since the spawn below will split the stack and who knows what'll happen by the time it runs
log_debug("Error loading play hours for [ckey]: [error_message]")
spawn(0)
alert(src, "The query to load your existing playtime failed. Screenshot this, give the screenshot to a developer, and reconnect, otherwise you may lose any recorded play hours (which may limit access to jobs). ERROR: [error_message]", "PROBLEMS!!")
tgui_alert_async(src, "The query to load your existing playtime failed. Screenshot this, give the screenshot to a developer, and reconnect, otherwise you may lose any recorded play hours (which may limit access to jobs). ERROR: [error_message]", "PROBLEMS!!")
// VOREStation Edit End - Department Hours
if(sql_id)
@@ -472,7 +471,7 @@
//Timing
if(src.chatOutputLoadedAt > (world.time - 10 SECONDS))
alert(src, "You can only try to reload VChat every 10 seconds at most.")
tgui_alert_async(src, "You can only try to reload VChat every 10 seconds at most.")
return
verbs -= /client/proc/vchat_export_log
@@ -62,7 +62,7 @@
else if(href_list["add_language"])
var/datum/species/S = GLOB.all_species[pref.species]
if(pref.alternate_languages.len >= S.num_alternate_languages)
alert(user, "You have already selected the maximum number of alternate languages for this species!")
tgui_alert_async(user, "You have already selected the maximum number of alternate languages for this species!")
else
var/list/available_languages = S.secondary_langs.Copy()
for(var/L in GLOB.all_languages)
@@ -76,7 +76,7 @@
available_languages -= pref.alternate_languages
if(!available_languages.len)
alert(user, "There are no additional languages available to select.")
tgui_alert_async(user, "There are no additional languages available to select.")
else
var/new_lang = input(user, "Select an additional language", "Character Generation", null) as null|anything in available_languages
if(new_lang && pref.alternate_languages.len < S.num_alternate_languages)
@@ -90,13 +90,13 @@
char = input("Enter a single special character.\nYou may re-select the same characters.\nThe following characters are already in use by radio: ; : .\nThe following characters are already in use by special say commands: ! * ^", "Enter Character - [3 - keys.len] remaining") as null|text
if(char)
if(length(char) > 1)
alert(user, "Only single characters allowed.", "Error", "Ok")
tgui_alert_async(user, "Only single characters allowed.", "Error")
else if(char in list(";", ":", "."))
alert(user, "Radio character. Rejected.", "Error", "Ok")
tgui_alert_async(user, "Radio character. Rejected.", "Error")
else if(char in list("!","*","^","-"))
alert(user, "Say character. Rejected.", "Error", "Ok")
tgui_alert_async(user, "Say character. Rejected.", "Error")
else if(contains_az09(char))
alert(user, "Non-special character. Rejected.", "Error", "Ok")
tgui_alert_async(user, "Non-special character. Rejected.", "Error")
else
keys.Add(char)
while(char && keys.len < 3)
@@ -78,7 +78,7 @@
swear to god I will find you and I will punch you for not reading these directions!\n\
([WEIGHT_MIN]-[WEIGHT_MAX])", "Character Preference") as num|null
if(new_weight)
var/unit_of_measurement = alert(user, "Is that number in pounds (lb) or kilograms (kg)?", "Confirmation", "Pounds", "Kilograms")
var/unit_of_measurement = tgui_alert(user, "Is that number in pounds (lb) or kilograms (kg)?", "Confirmation", list("Pounds", "Kilograms"))
if(unit_of_measurement == "Pounds")
new_weight = round(text2num(new_weight),4)
if(unit_of_measurement == "Kilograms")
@@ -186,12 +186,6 @@
return TOPIC_NOACTION
else if(href_list["custom_species"])
/*if(pref.species != "Custom Species")
alert(usr, "You cannot set a custom species name unless you set your character to use the 'Custom Species' \
species on the 'General' tab. If you have this set to something, it's because you had it set before the \
Trait system was implemented. If you wish to change it, set your species to 'Custom Species' and configure \
the species completely.")
return TOPIC_REFRESH*/ //There was no reason to have this.
var/raw_choice = sanitize(input(user, "Input your custom species name:",
"Character Preference", pref.custom_species) as null|text, MAX_NAME_LEN)
if (CanUseTopic(user))
@@ -214,28 +208,28 @@
return TOPIC_REFRESH
else if(href_list["blood_reset"])
var/choice = alert(usr, "Reset blood color to human default (#A10808)?","Reset Blood Color","Reset","Cancel")
var/choice = tgui_alert(usr, "Reset blood color to human default (#A10808)?","Reset Blood Color",list("Reset","Cancel"))
if(choice == "Reset")
pref.blood_color = "#A10808"
return TOPIC_REFRESH
else if(href_list["clicked_pos_trait"])
var/datum/trait/trait = text2path(href_list["clicked_pos_trait"])
var/choice = alert(usr, "Remove [initial(trait.name)] and regain [initial(trait.cost)] points?","Remove Trait","Remove","Cancel")
var/choice = tgui_alert(usr, "Remove [initial(trait.name)] and regain [initial(trait.cost)] points?","Remove Trait",list("Remove","Cancel"))
if(choice == "Remove")
pref.pos_traits -= trait
return TOPIC_REFRESH
else if(href_list["clicked_neu_trait"])
var/datum/trait/trait = text2path(href_list["clicked_neu_trait"])
var/choice = alert(usr, "Remove [initial(trait.name)]?","Remove Trait","Remove","Cancel")
var/choice = tgui_alert(usr, "Remove [initial(trait.name)]?","Remove Trait",list("Remove","Cancel"))
if(choice == "Remove")
pref.neu_traits -= trait
return TOPIC_REFRESH
else if(href_list["clicked_neg_trait"])
var/datum/trait/trait = text2path(href_list["clicked_neg_trait"])
var/choice = alert(usr, "Remove [initial(trait.name)] and lose [initial(trait.cost)] points?","Remove Trait","Remove","Cancel")
var/choice = tgui_alert(usr, "Remove [initial(trait.name)] and lose [initial(trait.cost)] points?","Remove Trait",list("Remove","Cancel"))
if(choice == "Remove")
pref.neg_traits -= trait
return TOPIC_REFRESH
@@ -310,7 +304,7 @@
done = TRUE
if(trait_choice in nicelist)
var/datum/trait/path = nicelist[trait_choice]
var/choice = alert(usr, "\[Cost:[initial(path.cost)]\] [initial(path.desc)]",initial(path.name),"Take Trait","Cancel","Go Back")
var/choice = tgui_alert(usr, "\[Cost:[initial(path.cost)]\] [initial(path.desc)]",initial(path.name),"Take Trait",list("Cancel","Go Back"))
if(choice == "Cancel")
trait_choice = null
if(choice != "Go Back")
@@ -325,21 +319,21 @@
var/conflict = FALSE
if(pref.dirty_synth && !(instance.can_take & SYNTHETICS))
alert(usr, "The trait you've selected can only be taken by organic characters!","Error")
tgui_alert_async(usr, "The trait you've selected can only be taken by organic characters!","Error")
pref.dirty_synth = 0 //Just to be sure
return TOPIC_REFRESH
if(pref.gross_meatbag && !(instance.can_take & ORGANICS))
alert(usr, "The trait you've selected can only be taken by synthetic characters!","Error")
tgui_alert_async(usr, "The trait you've selected can only be taken by synthetic characters!","Error")
pref.gross_meatbag = 0 //Just to be sure
return TOPIC_REFRESH
if(pref.species in instance.banned_species)
alert(usr, "The trait you've selected cannot be taken by the species you've chosen!","Error")
tgui_alert_async(usr, "The trait you've selected cannot be taken by the species you've chosen!","Error")
return TOPIC_REFRESH
if( LAZYLEN(instance.allowed_species) && !(pref.species in instance.allowed_species)) //Adding white list handling -shark
alert(usr, "The trait you've selected cannot be taken by the species you've chosen!","Error")
tgui_alert_async(usr, "The trait you've selected cannot be taken by the species you've chosen!","Error")
return TOPIC_REFRESH
if(trait_choice in pref.pos_traits + pref.neu_traits + pref.neg_traits)
@@ -358,8 +352,7 @@
break varconflict
if(conflict)
alert(usr, "You cannot take this trait and [conflict] at the same time. \
Please remove that trait, or pick another trait to add.","Error")
tgui_alert_async(usr, "You cannot take this trait and [conflict] at the same time. Please remove that trait, or pick another trait to add.", "Error")
return TOPIC_REFRESH
mylist += path
+2 -2
View File
@@ -349,9 +349,9 @@ var/list/preferences_datums = list()
sanitize_preferences()
close_load_dialog(usr)
else if(href_list["resetslot"])
if("No" == alert(usr, "This will reset the current slot. Continue?", "Reset current slot?", "No", "Yes"))
if("No" == tgui_alert(usr, "This will reset the current slot. Continue?", "Reset current slot?", list("No", "Yes")))
return 0
if("No" == alert(usr, "Are you completely sure that you want to reset this character slot?", "Reset current slot?", "No", "Yes"))
if("No" == tgui_alert(usr, "Are you completely sure that you want to reset this character slot?", "Reset current slot?", list("No", "Yes")))
return 0
load_character(SAVE_RESET)
sanitize_preferences()
+1 -1
View File
@@ -73,7 +73,7 @@ var/global/list/all_tooltip_styles = list(
I.alpha = UI_style_alpha_new
if(alert(usr, "Like it? Save changes?","Save?","Yes", "No") == "Yes")
if(tgui_alert(usr, "Like it? Save changes?","Save?",list("Yes", "No")) == "Yes")
prefs.UI_style = UI_style_new
prefs.UI_style_alpha = UI_style_alpha_new
prefs.UI_style_color = UI_style_color_new
+5 -5
View File
@@ -20,7 +20,7 @@
to_chat(src, "You're already committing suicide! Be patient!")
return
var/confirm = alert(usr, "Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No")
var/confirm = tgui_alert(usr, "Are you sure you want to commit suicide?", "Confirm Suicide", list("Yes", "No"))
if(confirm == "Yes")
if(!canmove || restrained()) //just while I finish up the new 'fun' suiciding verb. This is to prevent metagaming via suicide
@@ -103,7 +103,7 @@
to_chat(src, "You're already committing suicide! Be patient!")
return
var/confirm = alert(usr, "Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No")
var/confirm = tgui_alert(usr, "Are you sure you want to commit suicide?", "Confirm Suicide", list("Yes", "No"))
if(confirm == "Yes")
suiciding = 1
@@ -123,7 +123,7 @@
to_chat(src, "You're already committing suicide! Be patient!")
return
var/confirm = alert(usr, "Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No")
var/confirm = tgui_alert(usr, "Are you sure you want to commit suicide?", "Confirm Suicide", list("Yes", "No"))
if(confirm == "Yes")
suiciding = 1
@@ -143,7 +143,7 @@
to_chat(src, "You're already committing suicide! Be patient!")
return
var/confirm = alert(usr, "Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No")
var/confirm = tgui_alert(usr, "Are you sure you want to commit suicide?", "Confirm Suicide", list("Yes", "No"))
if(confirm == "Yes")
suiciding = 1
@@ -156,7 +156,7 @@
set category = "pAI Commands"
set desc = "Kill yourself and become a ghost (You will receive a confirmation prompt)"
set name = "pAI Suicide"
var/answer = input("REALLY kill yourself? This action can't be undone.", "Suicide", "No") in list ("Yes", "No")
var/answer = input("REALLY kill yourself? This action can't be undone.", "Suicide", "No") in list (list("Yes", "No"))
if(answer == "Yes")
var/obj/item/device/paicard/card = loc
card.removePersonality()