mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
The One Where I Port Modals
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
O.loc = src
|
||||
update_icon()
|
||||
else if(istype(O, /obj/item/weapon/pen))
|
||||
var/newname = sanitizeSafe(input("What would you like to title this bookshelf?"), MAX_NAME_LEN)
|
||||
var/newname = sanitizeSafe(input(usr, "What would you like to title this bookshelf?"), MAX_NAME_LEN)
|
||||
if(!newname)
|
||||
return
|
||||
else
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
/obj/structure/bookcase/attack_hand(var/mob/user as mob)
|
||||
if(contents.len)
|
||||
var/obj/item/weapon/book/choice = input("Which book would you like to remove from the shelf?") as null|obj in contents
|
||||
var/obj/item/weapon/book/choice = tgui_input_list(usr, "Which book would you like to remove from the shelf?", "Book Selection", contents)
|
||||
if(choice)
|
||||
if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
|
||||
return
|
||||
@@ -226,10 +226,10 @@ Book Cart End
|
||||
if(unique)
|
||||
to_chat(user, "These pages don't seem to take the ink well. Looks like you can't modify it.")
|
||||
return
|
||||
var/choice = input("What would you like to change?") in list("Title", "Contents", "Author", "Cancel")
|
||||
var/choice = tgui_input_list(usr, "What would you like to change?", "Change What?", list("Title", "Contents", "Author", "Cancel"))
|
||||
switch(choice)
|
||||
if("Title")
|
||||
var/newtitle = reject_bad_text(sanitizeSafe(input("Write a new title:")))
|
||||
var/newtitle = reject_bad_text(sanitizeSafe(input(usr, "Write a new title:")))
|
||||
if(!newtitle)
|
||||
to_chat(usr, "The title is invalid.")
|
||||
return
|
||||
@@ -237,7 +237,7 @@ Book Cart End
|
||||
src.name = newtitle
|
||||
src.title = newtitle
|
||||
if("Contents")
|
||||
var/content = sanitize(input("Write your book's contents (HTML NOT allowed):") as message|null, MAX_BOOK_MESSAGE_LEN)
|
||||
var/content = sanitize(input(usr, "Write your book's contents (HTML NOT allowed):") as message|null, MAX_BOOK_MESSAGE_LEN)
|
||||
if(!content)
|
||||
to_chat(usr, "The content is invalid.")
|
||||
return
|
||||
|
||||
@@ -75,21 +75,21 @@
|
||||
return
|
||||
|
||||
if(href_list["settitle"])
|
||||
var/newtitle = input("Enter a title to search for:") as text|null
|
||||
var/newtitle = input(usr, "Enter a title to search for:") as text|null
|
||||
if(newtitle)
|
||||
title = sanitize(newtitle)
|
||||
else
|
||||
title = null
|
||||
title = sanitizeSQL(title)
|
||||
if(href_list["setcategory"])
|
||||
var/newcategory = input("Choose a category to search for:") in list("Any", "Fiction", "Non-Fiction", "Adult", "Reference", "Religion")
|
||||
var/newcategory = tgui_input_list(usr, "Choose a category to search for:", list("Any", "Fiction", "Non-Fiction", "Adult", "Reference", "Religion"))
|
||||
if(newcategory)
|
||||
category = sanitize(newcategory)
|
||||
else
|
||||
category = "Any"
|
||||
category = sanitizeSQL(category)
|
||||
if(href_list["setauthor"])
|
||||
var/newauthor = input("Enter an author to search for:") as text|null
|
||||
var/newauthor = input(usr, "Enter an author to search for:") as text|null
|
||||
if(newauthor)
|
||||
author = sanitize(newauthor)
|
||||
else
|
||||
@@ -376,9 +376,9 @@
|
||||
if(checkoutperiod < 1)
|
||||
checkoutperiod = 1
|
||||
if(href_list["editbook"])
|
||||
buffer_book = sanitizeSafe(input("Enter the book's title:") as text|null)
|
||||
buffer_book = sanitizeSafe(input(usr, "Enter the book's title:") as text|null)
|
||||
if(href_list["editmob"])
|
||||
buffer_mob = sanitize(input("Enter the recipient's name:") as text|null, MAX_NAME_LEN)
|
||||
buffer_mob = sanitize(input(usr, "Enter the recipient's name:") as text|null, MAX_NAME_LEN)
|
||||
if(href_list["checkout"])
|
||||
var/datum/borrowbook/b = new /datum/borrowbook
|
||||
b.bookname = sanitizeSafe(buffer_book)
|
||||
@@ -393,11 +393,11 @@
|
||||
var/obj/item/weapon/book/b = locate(href_list["delbook"])
|
||||
inventory.Remove(b)
|
||||
if(href_list["setauthor"])
|
||||
var/newauthor = sanitize(input("Enter the author's name: ") as text|null)
|
||||
var/newauthor = sanitize(input(usr, "Enter the author's name: ") as text|null)
|
||||
if(newauthor)
|
||||
scanner.cache.author = newauthor
|
||||
if(href_list["setcategory"])
|
||||
var/newcategory = input("Choose a category: ") in list("Fiction", "Non-Fiction", "Adult", "Reference", "Religion")
|
||||
var/newcategory = tgui_input_list(usr, "Choose a category: ", list("Fiction", "Non-Fiction", "Adult", "Reference", "Religion"))
|
||||
if(newcategory)
|
||||
upload_category = newcategory
|
||||
|
||||
@@ -405,14 +405,22 @@
|
||||
if(href_list["upload"])
|
||||
if(scanner)
|
||||
if(scanner.cache)
|
||||
var/choice = input("Are you certain you wish to upload this title to the Archive?") in list("Confirm", "Abort")
|
||||
var/choice = tgui_alert(usr, "Are you certain you wish to upload this title to the Archive?", "Confirmation", list("Confirm", "Abort"))
|
||||
if(choice == "Confirm")
|
||||
if(scanner.cache.unique)
|
||||
alert("This book has been rejected from the database. Aborting!")
|
||||
tgui_alert_async(usr, "This book has been rejected from the database. Aborting!")
|
||||
else
|
||||
establish_old_db_connection()
|
||||
<<<<<<< HEAD
|
||||
if(!SSdbcore.IsConnected()) //CHOMPEdit TGSQL
|
||||
alert("Connection to Archive has been severed. Aborting.")
|
||||
||||||| parent of f9e9aafd1d... Merge pull request #10756 from VOREStation/Arokha/fixes2
|
||||
if(!dbcon_old.IsConnected())
|
||||
alert("Connection to Archive has been severed. Aborting.")
|
||||
=======
|
||||
if(!dbcon_old.IsConnected())
|
||||
tgui_alert_async(usr, "Connection to Archive has been severed. Aborting.")
|
||||
>>>>>>> f9e9aafd1d... Merge pull request #10756 from VOREStation/Arokha/fixes2
|
||||
else
|
||||
/*
|
||||
var/sqltitle = dbcon.Quote(scanner.cache.name)
|
||||
@@ -430,15 +438,29 @@
|
||||
to_chat(usr,query.ErrorMsg())
|
||||
else
|
||||
log_game("[usr.name]/[usr.key] has uploaded the book titled [scanner.cache.name], [length(scanner.cache.dat)] signs")
|
||||
<<<<<<< HEAD
|
||||
alert("Upload Complete.")
|
||||
qdel(query) //CHOMPEdit TGSQL
|
||||
||||||| parent of f9e9aafd1d... Merge pull request #10756 from VOREStation/Arokha/fixes2
|
||||
alert("Upload Complete.")
|
||||
=======
|
||||
tgui_alert_async(usr, "Upload Complete.")
|
||||
>>>>>>> f9e9aafd1d... Merge pull request #10756 from VOREStation/Arokha/fixes2
|
||||
//VOREStation Edit End
|
||||
|
||||
if(href_list["targetid"])
|
||||
var/sqlid = sanitizeSQL(href_list["targetid"])
|
||||
establish_old_db_connection()
|
||||
<<<<<<< HEAD
|
||||
if(!SSdbcore.IsConnected()) //CHOMPEdit TGSQL
|
||||
alert("Connection to Archive has been severed. Aborting.")
|
||||
||||||| parent of f9e9aafd1d... Merge pull request #10756 from VOREStation/Arokha/fixes2
|
||||
if(!dbcon_old.IsConnected())
|
||||
alert("Connection to Archive has been severed. Aborting.")
|
||||
=======
|
||||
if(!dbcon_old.IsConnected())
|
||||
tgui_alert_async(usr, "Connection to Archive has been severed. Aborting.")
|
||||
>>>>>>> f9e9aafd1d... Merge pull request #10756 from VOREStation/Arokha/fixes2
|
||||
if(bibledelay)
|
||||
for (var/mob/V in hearers(src))
|
||||
V.show_message("<b>[src]</b>'s monitor flashes, \"Printer unavailable. Please allow a short time before attempting to print.\"")
|
||||
@@ -462,9 +484,37 @@
|
||||
B.item_state = B.icon_state
|
||||
src.visible_message("[src]'s printer hums as it produces a completely bound book. How did it do that?")
|
||||
break
|
||||
<<<<<<< HEAD
|
||||
qdel(query) //CHOMPEdit TGSQL
|
||||
||||||| parent of f9e9aafd1d... Merge pull request #10756 from VOREStation/Arokha/fixes2
|
||||
|
||||
if(href_list["delid"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
var/sqlid = sanitizeSQL(href_list["delid"])
|
||||
establish_old_db_connection()
|
||||
if(!dbcon_old.IsConnected())
|
||||
alert("Connection to Archive has been severed. Aborting.")
|
||||
else
|
||||
var/DBQuery/query = dbcon_old.NewQuery("DELETE FROM library WHERE id=[sqlid]")
|
||||
query.Execute()
|
||||
|
||||
=======
|
||||
|
||||
if(href_list["delid"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
var/sqlid = sanitizeSQL(href_list["delid"])
|
||||
establish_old_db_connection()
|
||||
if(!dbcon_old.IsConnected())
|
||||
tgui_alert_async(usr, "Connection to Archive has been severed. Aborting.")
|
||||
else
|
||||
var/DBQuery/query = dbcon_old.NewQuery("DELETE FROM library WHERE id=[sqlid]")
|
||||
query.Execute()
|
||||
|
||||
>>>>>>> f9e9aafd1d... Merge pull request #10756 from VOREStation/Arokha/fixes2
|
||||
if(href_list["orderbyid"])
|
||||
var/orderid = input("Enter your order:") as num|null
|
||||
var/orderid = input(usr, "Enter your order:") as num|null
|
||||
if(orderid)
|
||||
if(isnum(orderid))
|
||||
var/nhref = "src=\ref[src];targetid=[orderid]"
|
||||
|
||||
Reference in New Issue
Block a user