Revert "TGUI alerts, lists, inputs"

This commit is contained in:
Letter N
2021-10-28 12:17:29 +08:00
committed by GitHub
parent 853ff1d8ad
commit bcdf96f274
362 changed files with 1149 additions and 1570 deletions
+2 -2
View File
@@ -140,7 +140,7 @@
create_random_books(books_to_load, src, FALSE, random_category)
load_random_books = FALSE
if(contents.len)
var/obj/item/book/choice = tgui_input_list(user, "Which book would you like to remove from the shelf?", "", sortNames(contents.Copy()))
var/obj/item/book/choice = input(user, "Which book would you like to remove from the shelf?") as null|obj in sortNames(contents.Copy())
if(choice)
if(!(user.mobility_flags & MOBILITY_USE) || user.stat != CONSCIOUS || !in_range(loc, user))
return
@@ -239,7 +239,7 @@
if(!literate)
to_chat(user, "<span class='notice'>You scribble illegibly on the cover of [src]!</span>")
return
var/choice = tgui_input_list(user, "What would you like to change?", "", list("Title", "Contents", "Author", "Cancel"))
var/choice = input("What would you like to change?") in list("Title", "Contents", "Author", "Cancel")
if(!user.canUseTopic(src, BE_CLOSE, literate))
return
switch(choice)
+12 -12
View File
@@ -110,19 +110,19 @@
return
if(href_list["settitle"])
var/newtitle = tgui_input_text(usr, "Enter a title to search for:")
var/newtitle = input("Enter a title to search for:") as text|null
if(newtitle)
title = sanitize(newtitle)
else
title = null
if(href_list["setcategory"])
var/newcategory = tgui_input_list(usr, "Choose a category to search for:", "", list("Any", "Fiction", "Non-Fiction", "Adult", "Reference", "Religion"))
var/newcategory = input("Choose a category to search for:") in list("Any", "Fiction", "Non-Fiction", "Adult", "Reference", "Religion")
if(newcategory)
category = sanitize(newcategory)
else
category = "Any"
if(href_list["setauthor"])
var/newauthor = tgui_input_text(usr, "Enter an author to search for:")
var/newauthor = input("Enter an author to search for:") as text|null
if(newauthor)
author = sanitize(newauthor)
else
@@ -407,16 +407,16 @@
if(newauthor)
scanner.cache.author = newauthor
if(href_list["setcategory"])
var/newcategory = tgui_input_list(usr, "Choose a category: ", "", list("Fiction", "Non-Fiction", "Adult", "Reference", "Religion","Technical"))
var/newcategory = input("Choose a category: ") in list("Fiction", "Non-Fiction", "Adult", "Reference", "Religion","Technical")
if(newcategory)
upload_category = newcategory
if(href_list["upload"])
if(scanner)
if(scanner.cache)
var/choice = tgui_input_list(usr, "Are you certain you wish to upload this title to the Archive?", "", list("Confirm", "Abort"))
var/choice = input("Are you certain you wish to upload this title to the Archive?") in list("Confirm", "Abort")
if(choice == "Confirm")
if (!SSdbcore.Connect())
tgui_alert(usr, "Connection to Archive has been severed. Aborting.")
alert("Connection to Archive has been severed. Aborting.")
else
var/msg = "[key_name(usr)] has uploaded the book titled [scanner.cache.name], [length(scanner.cache.dat)] signs"
var/datum/db_query/query_library_upload = SSdbcore.NewQuery({"
@@ -425,15 +425,15 @@
"}, list("title" = scanner.cache.name, "author" = scanner.cache.author, "content" = scanner.cache.dat, "category" = upload_category, "ckey" = usr.ckey, "round_id" = GLOB.round_id))
if(!query_library_upload.Execute())
qdel(query_library_upload)
tgui_alert(usr, "Database error encountered uploading to Archive")
alert("Database error encountered uploading to Archive")
return
else
log_game(msg)
qdel(query_library_upload)
tgui_alert(usr, "Upload Complete. Uploaded title will be unavailable for printing for a short period")
alert("Upload Complete. Uploaded title will be unavailable for printing for a short period")
if(href_list["newspost"])
if(!GLOB.news_network)
tgui_alert(usr, "No news network found on station. Aborting.")
alert("No news network found on station. Aborting.")
var/channelexists = 0
for(var/datum/news/feed_channel/FC in GLOB.news_network.network_channels)
if(FC.channel_name == "Nanotrasen Book Club")
@@ -442,12 +442,12 @@
if(!channelexists)
GLOB.news_network.CreateFeedChannel("Nanotrasen Book Club", "Library", null)
GLOB.news_network.SubmitArticle(scanner.cache.dat, "[scanner.cache.name]", "Nanotrasen Book Club", null)
tgui_alert(usr, "Upload complete. Your uploaded title is now available on station newscasters.")
alert("Upload complete. Your uploaded title is now available on station newscasters.")
if(href_list["orderbyid"])
if(printer_cooldown > world.time)
say("Printer unavailable. Please allow a short time before attempting to print.")
else
var/orderid = tgui_input_num(usr, "Enter your order:")
var/orderid = input("Enter your order:") as num|null
if(orderid)
if(isnum(orderid) && ISINTEGER(orderid))
href_list["targetid"] = num2text(orderid)
@@ -455,7 +455,7 @@
if(href_list["targetid"])
var/id = href_list["targetid"]
if (!SSdbcore.Connect())
tgui_alert(usr, "Connection to Archive has been severed. Aborting.")
alert("Connection to Archive has been severed. Aborting.")
if(printer_cooldown > world.time)
say("Printer unavailable. Please allow a short time before attempting to print.")
else
+1 -1
View File
@@ -265,7 +265,7 @@
if("delete")
if(!is_admin)
return
var/confirm = tgui_alert(user, "Confirm deletion of engraved message?", "Confirm Deletion", list("Yes", "No"))
var/confirm = alert(user, "Confirm deletion of engraved message?", "Confirm Deletion", "Yes", "No")
if(confirm == "Yes")
persists = FALSE
qdel(src)