[MIRROR] Refactor, improve, and rename canUseTopic to be can_perform_action [MDB IGNORE] (#19391)

* Refactor, improve, and rename canUseTopic to be can_perform_action

* updoot

* https://github.com/tgstation/tgstation/pull/72876

https://github.com/tgstation/tgstation/pull/72876

---------

Co-authored-by: Tim <timothymtorres@gmail.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-03-10 04:19:25 +00:00
committed by GitHub
co-authored by Tim Gandalf
parent 7305d12d29
commit f8f2abb11f
209 changed files with 455 additions and 354 deletions
@@ -199,7 +199,7 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
. = ..()
if(issilicon(user))
return FALSE
if(!user.canUseTopic(src, be_close = TRUE))
if(!user.can_perform_action(src))
return FALSE
if(RemoveID(user))
@@ -300,7 +300,7 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
/obj/item/modular_computer/MouseDrop(obj/over_object, src_location, over_location)
var/mob/M = usr
if((!istype(over_object, /atom/movable/screen)) && usr.canUseTopic(src, be_close = TRUE))
if((!istype(over_object, /atom/movable/screen)) && usr.can_perform_action(src))
return attack_self(M)
return ..()
@@ -77,10 +77,10 @@
var/original_host = source
var/fakename = sanitize_name(tgui_input_text(user, "Enter a name for the rigged message.", "Forge Message", max_length = MAX_NAME_LEN), allow_numbers = TRUE)
if(!fakename || source != original_host || !user.canUseTopic(source, be_close = TRUE))
if(!fakename || source != original_host || !user.can_perform_action(source))
return
var/fakejob = sanitize_name(tgui_input_text(user, "Enter a job for the rigged message.", "Forge Message", max_length = MAX_NAME_LEN), allow_numbers = TRUE)
if(!fakejob || source != original_host || !user.canUseTopic(source, be_close = TRUE))
if(!fakejob || source != original_host || !user.can_perform_action(source))
return
var/datum/computer_file/program/messenger/app = locate() in source.stored_files
@@ -84,7 +84,7 @@
return
if(!isturf(loc) && !ismob(loc)) // No opening it in backpack.
return
if(!user.canUseTopic(src, be_close = TRUE))
if(!user.can_perform_action(src))
return
toggle_open(user)
@@ -182,7 +182,7 @@
/obj/item/modular_computer/pda/proc/remove_pen(mob/user)
if(issilicon(user) || !user.canUseTopic(src, be_close = TRUE, no_dexterity = FALSE, no_tk = TRUE)) //TK doesn't work even with this removed but here for readability
if(issilicon(user) || !user.can_perform_action(src, FORBID_TELEKINESIS_REACH)) //TK doesn't work even with this removed but here for readability
return
if(inserted_item)
@@ -251,7 +251,7 @@
if (!input_message || !sending_and_receiving)
return
if(!user.canUseTopic(computer, be_close = TRUE))
if(!user.can_perform_action(computer))
return
return sanitize(input_message)
@@ -423,7 +423,7 @@
if(computer.active_program != src)
if(!computer.open_program(usr, src))
return
if(!href_list["close"] && usr.canUseTopic(computer, be_close = TRUE, no_dexterity = FALSE, no_tk = TRUE))
if(!href_list["close"] && usr.can_perform_action(computer, FORBID_TELEKINESIS_REACH))
switch(href_list["choice"])
if("Message")
send_message(usr, list(locate(href_list["target"])))