diff --git a/code/modules/detectivework/scanner.dm b/code/modules/detectivework/scanner.dm index aa80178030..e7589aa15f 100644 --- a/code/modules/detectivework/scanner.dm +++ b/code/modules/detectivework/scanner.dm @@ -16,6 +16,15 @@ var/list/log = list() var/range = 8 var/view_check = TRUE + actions_types = list(/datum/action/item_action/displayDetectiveScanResults) + +/datum/action/item_action/displayDetectiveScanResults + name = "Display Forensic Scanner Results" + +/datum/action/item_action/displayDetectiveScanResults/Trigger() + var/obj/item/device/detective_scanner/scanner = target + if(istype(scanner)) + scanner.displayDetectiveScanResults(usr) /obj/item/device/detective_scanner/attack_self(mob/user) if(log.len && !scanning) @@ -36,6 +45,7 @@ P.info += jointext(log, "
") P.info += "
Notes:
" P.info_links = P.info + P.updateinfolinks() if(ismob(loc)) var/mob/M = loc @@ -165,3 +175,28 @@ /proc/get_timestamp() return time2text(world.time + 432000, ":ss") + +/obj/item/device/detective_scanner/AltClick(mob/living/user) + // Best way for checking if a player can use while not incapacitated, etc + if(!user.canUseTopic(src, be_close=TRUE)) + return + if(!LAZYLEN(log)) + to_chat(user, "Cannot clear logs, the scanner has no logs.") + return + if(scanning) + to_chat(user, "Cannot clear logs, the scanner is in use.") + return + to_chat(user, "The scanner logs are cleared.") + log = list() + +/obj/item/device/detective_scanner/proc/displayDetectiveScanResults(mob/living/user) + // No need for can-use checks since the action button should do proper checks + if(!LAZYLEN(log)) + to_chat(user, "Cannot display logs, the scanner has no logs.") + return + if(scanning) + to_chat(user, "Cannot display logs, the scanner is in use.") + return + to_chat(user, "Scanner Report") + for(var/iterLog in log) + to_chat(user, iterLog) \ No newline at end of file