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

@@ -10,7 +10,7 @@
else
jmp_coords = coords = "in nullspace"
if (alert(src, "Are you sure you want to delete:\n[D]\n[coords]?", "Confirmation", "Yes", "No") == "Yes")
if (tgui_alert(src, "Are you sure you want to delete:\n[D]\n[coords]?", "Confirmation", list("Yes", "No")) == "Yes")
log_admin("[key_name(usr)] deleted [D] [coords]")
message_admins("[key_name_admin(usr)] deleted [D] [jmp_coords]")
feedback_add_details("admin_verb","ADEL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!

View File

@@ -78,26 +78,26 @@
if (extra_classes)
classes += extra_classes
.["class"] = input(src, "What kind of data?", "Variable Type", default_class) as null|anything in classes
.["class"] = tgui_input_list(src, "What kind of data?", "Variable Type", classes, default_class)
if (holder && holder.marked_datum && .["class"] == "[VV_MARKED_DATUM] ([holder.marked_datum.type])")
.["class"] = VV_MARKED_DATUM
switch(.["class"])
if (VV_TEXT)
.["value"] = input("Enter new text:", "Text", current_value) as null|text
.["value"] = input(usr, "Enter new text:", "Text", current_value) as null|text
if (.["value"] == null)
.["class"] = null
return
if (VV_MESSAGE)
.["value"] = input("Enter new text:", "Text", current_value) as null|message
.["value"] = input(usr, "Enter new text:", "Text", current_value) as null|message
if (.["value"] == null)
.["class"] = null
return
if (VV_NUM)
.["value"] = input("Enter new number:", "Num", current_value) as null|num
.["value"] = input(usr, "Enter new number:", "Num", current_value) as null|num
if (.["value"] == null)
.["class"] = null
return
@@ -124,7 +124,7 @@
var/type = current_value
var/error = ""
do
type = input("Enter type:[error]", "Type", type) as null|text
type = input(usr, "Enter type:[error]", "Type", type) as null|text
if (!type)
break
type = text2path(type)
@@ -143,7 +143,7 @@
.["class"] = null
return
var/list/things = vv_reference_list(type, subtypes)
var/value = input("Select reference:", "Reference", current_value) as null|anything in things
var/value = tgui_input_list(usr, "Select reference:", "Reference", things, current_value)
if (!value)
.["class"] = null
return
@@ -156,7 +156,7 @@
.["class"] = null
return
var/list/things = vv_reference_list(type, subtypes)
var/value = input("Select reference:", "Reference", current_value) as null|anything in things
var/value = tgui_input_list(usr, "Select reference:", "Reference", things, current_value)
if (!value)
.["class"] = null
return
@@ -169,7 +169,7 @@
.["class"] = null
return
var/list/things = vv_reference_list(type, subtypes)
var/value = input("Select reference:", "Reference", current_value) as null|anything in things
var/value = tgui_input_list(usr, "Select reference:", "Reference", things, current_value)
if (!value)
.["class"] = null
return
@@ -178,21 +178,21 @@
if (VV_CLIENT)
.["value"] = input("Select reference:", "Reference", current_value) as null|anything in GLOB.clients
.["value"] = tgui_input_list(usr, "Select reference:", "Reference", GLOB.clients, current_value)
if (.["value"] == null)
.["class"] = null
return
if (VV_FILE)
.["value"] = input("Pick file:", "File") as null|file
.["value"] = input(usr, "Pick file:", "File") as null|file
if (.["value"] == null)
.["class"] = null
return
if (VV_ICON)
.["value"] = input("Pick icon:", "Icon") as null|icon
.["value"] = input(usr, "Pick icon:", "Icon") as null|icon
if (.["value"] == null)
.["class"] = null
return
@@ -229,7 +229,7 @@
var/type = current_value
var/error = ""
do
type = input("Enter type:[error]", "Type", type) as null|text
type = input(usr, "Enter type:[error]", "Type", type) as null|text
if (!type)
break
type = text2path(type)

View File

@@ -28,7 +28,7 @@
names = sortList(names)
variable = input("Which var?", "Var") as null|anything in names
variable = tgui_input_list(usr, "Which var?", "Var", names)
else
variable = var_name
@@ -49,7 +49,7 @@
if(variable in GLOB.VVpixelmovement)
if(!check_rights(R_DEBUG))
return
var/prompt = alert(src, "Editing this var may irreparably break tile gliding for the rest of the round. THIS CAN'T BE UNDONE", "DANGER", "ABORT ", "Continue", " ABORT")
var/prompt = tgui_alert(src, "Editing this var may irreparably break tile gliding for the rest of the round. THIS CAN'T BE UNDONE", "DANGER", list("ABORT","Continue","ABORT"))
if (prompt != "Continue")
return
@@ -115,7 +115,7 @@
var/pre_processing = new_value
var/unique
if (varsvars && varsvars.len)
unique = alert(usr, "Process vars unique to each instance, or same for all?", "Variable Association", "Unique", "Same")
unique = tgui_alert(usr, "Process vars unique to each instance, or same for all?", "Variable Association", list("Unique", "Same"))
if(unique == "Unique")
unique = TRUE
else
@@ -142,7 +142,7 @@
CHECK_TICK
if (VV_NEW_TYPE)
var/many = alert(src, "Create only one [value["type"]] and assign each or a new one for each thing", "How Many", "One", "Many", "Cancel")
var/many = tgui_alert(src, "Create only one [value["type"]] and assign each or a new one for each thing", "How Many", list("One", "Many", "Cancel"))
if (many == "Cancel")
return
if (many == "Many")

View File

@@ -9,7 +9,7 @@ GLOBAL_PROTECT(VVpixelmovement)
/client/proc/vv_parse_text(O, new_var)
if(O && findtext(new_var,"\["))
var/process_vars = alert(usr,"\[] detected in string, process as variables?","Process Variables?","Yes","No")
var/process_vars = tgui_alert(usr,"\[] detected in string, process as variables?","Process Variables?",list("Yes","No"))
if(process_vars == "Yes")
. = string2listofvars(new_var, O)
@@ -24,7 +24,7 @@ GLOBAL_PROTECT(VVpixelmovement)
if (!subtypes || !subtypes.len)
return FALSE
if (subtypes && subtypes.len)
switch(alert("Strict object type detection?", "Type detection", "Strictly this type","This type and subtypes", "Cancel"))
switch(tgui_alert(usr, "Strict object type detection?", "Type detection", list("Strictly this type", "This type and subtypes", "Cancel")))
if("Strictly this type")
return FALSE
if("This type and subtypes")
@@ -98,7 +98,7 @@ GLOBAL_PROTECT(VVpixelmovement)
L += var_value
if(IS_VALID_ASSOC_KEY(var_value))
switch(alert("Would you like to associate a value with the list entry?",,"Yes","No"))
switch(tgui_alert(usr, "Would you like to associate a value with the list entry?","List VV","Yes","No"))
if("Yes")
L[var_value] = mod_list_add_ass(O) //hehe
if (O)
@@ -117,7 +117,7 @@ GLOBAL_PROTECT(VVpixelmovement)
return
if(L.len > 1000)
var/confirm = alert(src, "The list you're trying to edit is very long, continuing may crash the server.", "Warning", "Continue", "Abort")
var/confirm = tgui_alert(src, "The list you're trying to edit is very long, continuing may crash the server.", "Warning", "Continue", "Abort")
if(confirm != "Continue")
return
@@ -133,7 +133,7 @@ GLOBAL_PROTECT(VVpixelmovement)
value = "null"
names["#[i] [key] = [value]"] = i
if (!index)
var/variable = input("Which var?","Var") as null|anything in names + "(ADD VAR)" + "(CLEAR NULLS)" + "(CLEAR DUPES)" + "(SHUFFLE)"
var/variable = tgui_input_list(usr, "Which var?","Var", names + "(ADD VAR)" + "(CLEAR NULLS)" + "(CLEAR DUPES)" + "(SHUFFLE)")
if(variable == null)
return
@@ -181,7 +181,7 @@ GLOBAL_PROTECT(VVpixelmovement)
return
var/assoc = 0
if(IS_VALID_ASSOC_KEY(L[index]))
var/prompt = alert(src, "Do you want to edit the key or its assigned value?", "Associated List", "Key", "Assigned Value", "Cancel")
var/prompt = tgui_alert(src, "Do you want to edit the key or its assigned value?", "Associated List", "Key", "Assigned Value", "Cancel")
if (prompt == "Cancel")
return
if (prompt == "Assigned Value")
@@ -309,14 +309,14 @@ GLOBAL_PROTECT(VVpixelmovement)
names = sortList(names)
variable = input("Which var?","Var") as null|anything in names
variable = tgui_input_list(usr, "Which var?","Var", names)
if(!variable)
return
if(variable in GLOB.VVpixelmovement)
if(!check_rights(R_DEBUG))
return
var/prompt = alert(src, "Editing this var may irreparably break tile gliding for the rest of the round. THIS CAN'T BE UNDONE", "DANGER", "ABORT ", "Continue", " ABORT")
var/prompt = tgui_alert(src, "Editing this var may irreparably break tile gliding for the rest of the round. THIS CAN'T BE UNDONE", "DANGER", list("ABORT","Continue","ABORT"))
if (prompt != "Continue")
return

View File

@@ -177,14 +177,14 @@
to_chat(usr, "This can only be used on instances of type /obj")
return
var/action_type = alert("Strict type ([O.type]) or type and all subtypes?",,"Strict type","Type and subtypes","Cancel")
var/action_type = tgui_alert(usr, "Strict type ([O.type]) or type and all subtypes?","Type Selection",list("Strict type","Type and subtypes","Cancel"))
if(action_type == "Cancel" || !action_type)
return
if(alert("Are you really sure you want to delete all objects of type [O.type]?",,"Yes","No") != "Yes")
if(tgui_alert(usr, "Are you really sure you want to delete all objects of type [O.type]?","Delete All?",list("Yes","No")) != "Yes")
return
if(alert("Second confirmation required. Delete?",,"Yes","No") != "Yes")
if(tgui_alert(usr, "Second confirmation required. Delete?","REALLY?",list("Yes","No")) != "Yes")
return
var/O_type = O.type
@@ -235,7 +235,7 @@
to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human")
return
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return
if(tgui_alert(usr, "Confirm mob type change?","Confirm",list("Transform","Cancel")) != "Transform") return
if(!H)
to_chat(usr, "Mob doesn't exist anymore")
return
@@ -249,7 +249,7 @@
to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human")
return
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return
if(tgui_alert(usr, "Confirm mob type change?","Confirm",list("Transform","Cancel")) != "Transform") return
if(!H)
to_chat(usr, "Mob doesn't exist anymore")
return
@@ -263,7 +263,7 @@
to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human")
return
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return
if(tgui_alert(usr, "Confirm mob type change?","Confirm",list("Transform","Cancel")) != "Transform") return
if(!H)
to_chat(usr, "Mob doesn't exist anymore")
return
@@ -277,7 +277,7 @@
to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human")
return
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return
if(tgui_alert(usr, "Confirm mob type change?","Confirm",list("Transform","Cancel")) != "Transform") return
if(!H)
to_chat(usr, "Mob doesn't exist anymore")
return
@@ -291,7 +291,7 @@
to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human")
return
var/new_species = input("Please choose a new species.","Species",null) as null|anything in GLOB.all_species
var/new_species = tgui_input_list(usr, "Please choose a new species.","Species", GLOB.all_species)
if(!H)
to_chat(usr, "Mob doesn't exist anymore")
@@ -310,7 +310,7 @@
to_chat(usr, "This can only be done to instances of type /mob")
return
var/new_language = input("Please choose a language to add.","Language",null) as null|anything in GLOB.all_languages
var/new_language = tgui_input_list(usr, "Please choose a language to add.","Language", GLOB.all_languages)
if(!new_language)
return
@@ -336,7 +336,7 @@
to_chat(usr, "This mob knows no languages.")
return
var/datum/language/rem_language = input("Please choose a language to remove.","Language",null) as null|anything in H.languages
var/datum/language/rem_language = tgui_input_list(usr, "Please choose a language to remove.","Language", H.languages)
if(!rem_language)
return
@@ -372,7 +372,7 @@
possibleverbs -= H.verbs
possibleverbs += "Cancel" // ...And one for the bottom
var/verb = input("Select a verb!", "Verbs",null) as anything in possibleverbs
var/verb = tgui_input_list(usr, "Select a verb!", "Verbs", possibleverbs)
if(!H)
to_chat(usr, "Mob doesn't exist anymore")
return
@@ -389,7 +389,7 @@
if(!istype(H))
to_chat(usr, "This can only be done to instances of type /mob")
return
var/verb = input("Please choose a verb to remove.","Verbs",null) as null|anything in H.verbs
var/verb = tgui_input_list(usr, "Please choose a verb to remove.","Verbs", H.verbs)
if(!H)
to_chat(usr, "Mob doesn't exist anymore")
return
@@ -406,7 +406,7 @@
to_chat(usr, "This can only be done to instances of type /mob/living/carbon")
return
var/new_organ = input("Please choose an organ to add.","Organ",null) as null|anything in typesof(/obj/item/organ)-/obj/item/organ
var/new_organ = tgui_input_list(usr, "Please choose an organ to add.","Organ", subtypesof(/obj/item/organ))
if(!new_organ) return
if(!M)
@@ -428,7 +428,7 @@
to_chat(usr, "This can only be done to instances of type /mob/living/carbon")
return
var/obj/item/organ/rem_organ = input("Please choose an organ to remove.","Organ",null) as null|anything in M.internal_organs
var/obj/item/organ/rem_organ = tgui_input_list(usr, "Please choose an organ to remove.","Organ", M.internal_organs)
if(!M)
to_chat(usr, "Mob doesn't exist anymore")
@@ -475,7 +475,7 @@
var/Text = href_list["adjustDamage"]
var/amount = input("Deal how much damage to mob? (Negative values here heal)","Adjust [Text]loss",0) as num
var/amount = input(usr, "Deal how much damage to mob? (Negative values here heal)","Adjust [Text]loss",0) as num
if(!L)
to_chat(usr, "Mob doesn't exist anymore")
@@ -508,7 +508,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")
return
if(!thing)

View File

@@ -10,7 +10,7 @@
mod_list(target, null, "list", "contents", target_index, autodetect_class = FALSE)
if(href_list[VV_HK_LIST_REMOVE])
var/variable = target[target_index]
var/prompt = alert("Do you want to remove item number [target_index] from list?", "Confirm", "Yes", "No")
var/prompt = tgui_alert(usr, "Do you want to remove item number [target_index] from list?", "Confirm", "Yes", "No")
if (prompt != "Yes")
return
target.Cut(target_index, target_index+1)