mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-24 13:30:42 +01:00
@@ -243,25 +243,25 @@
|
||||
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 = tgui_alert(user, "What would you like to change?", "Book", list("Title", "Contents", "Author", "Cancel"))
|
||||
var/choice = tgui_input_list(user, "What would you like to change?", "Book", list("Title", "Contents", "Author", "Cancel"), "Cancel")
|
||||
switch(choice)
|
||||
if("Title")
|
||||
var/newtitle = reject_bad_text(sanitizeSafe(input("Write a new title:")))
|
||||
var/newtitle = reject_bad_text(strip_html_full(tgui_input_text(user, "Write a new title:", "Title", encode = FALSE)))
|
||||
if(!newtitle)
|
||||
to_chat(usr, "The title is invalid.")
|
||||
return
|
||||
else
|
||||
src.name = newtitle
|
||||
src.name = html_decode(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 = strip_html_readd_newlines(tgui_input_text(user, "Write your book's contents (HTML NOT allowed):", "Content", multiline = TRUE, encode = FALSE), MAX_BOOK_MESSAGE_LEN)
|
||||
if(!content)
|
||||
to_chat(usr, "The content is invalid.")
|
||||
return
|
||||
else
|
||||
src.dat += content
|
||||
if("Author")
|
||||
var/newauthor = sanitize(input(usr, "Write the author's name:"))
|
||||
var/newauthor = strip_html_full(tgui_input_text(user, "Write the author's name:", "Author", encode = FALSE))
|
||||
if(!newauthor)
|
||||
to_chat(usr, "The name is invalid.")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user