canUseTopic now uses TRUE/FALSE instead of defines that just say TRUE (#69790)

* canUseTopic now uses TRUE/FALSE instead of defines that just say TRUE

The most idiotic thing I've seen is canUseTopic's defines, they literally just define TRUE, you can use it however you want, it doesn't matter, it just means TRUE. You can mix and match the args and it will set that arg to true, despite the name.

It's so idiotic I decided to remove it, so now I can reclaim a little bit of my sanity.
This commit is contained in:
John Willard
2022-10-01 09:47:52 -07:00
committed by GitHub
parent 94dece8e5a
commit 91f02f2a6b
156 changed files with 232 additions and 233 deletions
+5 -5
View File
@@ -139,7 +139,7 @@
/obj/item/book/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/pen))
if(!user.canUseTopic(src, BE_CLOSE) || !user.can_write(I))
if(!user.canUseTopic(src, be_close = TRUE) || !user.can_write(I))
return
if(user.is_blind())
to_chat(user, span_warning("As you are trying to write on the book, you suddenly feel very stupid!"))
@@ -151,12 +151,12 @@
var/choice = tgui_input_list(usr, "What would you like to change?", "Book Alteration", list("Title", "Contents", "Author", "Cancel"))
if(isnull(choice))
return
if(!user.canUseTopic(src, BE_CLOSE) || !user.can_write(I))
if(!user.canUseTopic(src, be_close = TRUE) || !user.can_write(I))
return
switch(choice)
if("Title")
var/newtitle = reject_bad_text(tgui_input_text(user, "Write a new title", "Book Title", max_length = 30))
if(!user.canUseTopic(src, BE_CLOSE) || !user.can_write(I))
if(!user.canUseTopic(src, be_close = TRUE) || !user.can_write(I))
return
if (length_char(newtitle) > 30)
to_chat(user, span_warning("That title won't fit on the cover!"))
@@ -168,7 +168,7 @@
book_data.set_title(html_decode(newtitle)) //Don't want to double encode here
if("Contents")
var/content = tgui_input_text(user, "Write your book's contents (HTML NOT allowed)", "Book Contents", multiline = TRUE)
if(!user.canUseTopic(src, BE_CLOSE) || !user.can_write(I))
if(!user.canUseTopic(src, be_close = TRUE) || !user.can_write(I))
return
if(!content)
to_chat(user, span_warning("The content is invalid."))
@@ -176,7 +176,7 @@
book_data.set_content(html_decode(content))
if("Author")
var/author = tgui_input_text(user, "Write the author's name", "Author Name")
if(!user.canUseTopic(src, BE_CLOSE) || !user.can_write(I))
if(!user.canUseTopic(src, be_close = TRUE) || !user.can_write(I))
return
if(!author)
to_chat(user, span_warning("The name is invalid."))
+2 -2
View File
@@ -123,10 +123,10 @@
to_chat(user, span_notice("You empty \the [I] into \the [src]."))
update_appearance()
else if(istype(I, /obj/item/pen))
if(!user.canUseTopic(src, BE_CLOSE) || !user.can_write(I))
if(!user.canUseTopic(src, be_close = TRUE) || !user.can_write(I))
return
var/newname = tgui_input_text(user, "What would you like to title this bookshelf?", "Bookshelf Renaming", max_length = MAX_NAME_LEN)
if(!user.canUseTopic(src, BE_CLOSE) || !user.can_write(I))
if(!user.canUseTopic(src, be_close = TRUE) || !user.can_write(I))
return
if(!newname)
return