From 2f73635cf3cb31281150da04523325bce129bd5a Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Sat, 12 Dec 2015 10:59:29 +0100 Subject: [PATCH] Misc fixes. The station alert console no longer uses the old interact proc() to open the window interface. Makes the records computers use the ui_interact proc to show the window. This fixes https://github.com/PolarisSS13/Polaris/issues/537. The station alert console now registers alarms using the correct procs. The proper fingerprint type should now be applied during Topic() call (this means that admin observer object NanoUI interactions now have a degree of logging). --- code/game/machinery/computer/medical.dm | 3 +++ code/game/machinery/computer/security.dm | 3 +++ code/game/machinery/computer/skills.dm | 3 +++ code/game/machinery/computer/station_alert.dm | 23 ++++++++----------- code/game/objects/objs.dm | 16 +++++++++---- 5 files changed, 30 insertions(+), 18 deletions(-) diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 15c504800a8..58643157d31 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -49,6 +49,9 @@ /obj/machinery/computer/med_data/attack_hand(mob/user as mob) if(..()) return + ui_interact(user) + +/obj/machinery/computer/med_data/ui_interact(mob/user) var/dat if (src.temp) dat = text("[src.temp]

Clear Screen") diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index eba129df262..468c6289194 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -56,6 +56,9 @@ /obj/machinery/computer/secure_data/attack_hand(mob/user as mob) if(..()) return + ui_interact(user) + +/obj/machinery/computer/secure_data/ui_interact(user) if (src.z > 6) user << "Unable to establish a connection: You're too far away from the station!" return diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm index 8e57548d6e2..f6290591f6f 100644 --- a/code/game/machinery/computer/skills.dm +++ b/code/game/machinery/computer/skills.dm @@ -39,6 +39,9 @@ /obj/machinery/computer/skills/attack_hand(mob/user as mob) if(..()) return + ui_interact(user) + +/obj/machinery/computer/skills/ui_interact(mob/user as mob) if (src.z > 6) user << "Unable to establish a connection: You're too far away from the station!" return diff --git a/code/game/machinery/computer/station_alert.dm b/code/game/machinery/computer/station_alert.dm index 691214198fb..a2d6026e99c 100644 --- a/code/game/machinery/computer/station_alert.dm +++ b/code/game/machinery/computer/station_alert.dm @@ -23,18 +23,18 @@ alarm_monitor.register_alarm(src, /obj/machinery/computer/station_alert/update_icon) ..() if(monitor_type) - register(new monitor_type(src)) + register_monitor(new monitor_type(src)) /obj/machinery/computer/station_alert/Destroy() . = ..() - unregister() + unregister_monitor() /obj/machinery/computer/station_alert/proc/register_monitor(var/datum/nano_module/alarm_monitor/monitor) if(monitor.host != src) return alarm_monitor = monitor - alarm_monitor.register(src, /obj/machinery/computer/station_alert/update_icon) + alarm_monitor.register_alarm(src, /obj/machinery/computer/station_alert/update_icon) /obj/machinery/computer/station_alert/proc/unregister_monitor() if(alarm_monitor) @@ -43,23 +43,18 @@ alarm_monitor = null /obj/machinery/computer/station_alert/attack_ai(mob/user) - add_fingerprint(user) - if(stat & (BROKEN|NOPOWER)) - return - interact(user) - return + ui_interact(user) /obj/machinery/computer/station_alert/attack_hand(mob/user) - add_fingerprint(user) - if(stat & (BROKEN|NOPOWER)) - return - interact(user) - return + ui_interact(user) -/obj/machinery/computer/station_alert/interact(mob/user) +/obj/machinery/computer/station_alert/ui_interact(mob/user) if(alarm_monitor) alarm_monitor.ui_interact(user) +/obj/machinery/computer/station_alert/nano_container() + return alarm_monitor + /obj/machinery/computer/station_alert/update_icon() icon_screen = initial(icon_screen) if(!(stat & (BROKEN|NOPOWER))) diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 8e67bb27554..1efcd0450af 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -45,11 +45,19 @@ return 1 /obj/proc/CouldUseTopic(var/mob/user) - if(!isAI(user) && src.Adjacent(user)) - // We are -probably- in physical contact with the object, better than how Topics() previously did it and always applied fingerprints. - add_fingerprint(user) + user.AddTopicPrint(src) + +/mob/proc/AddTopicPrint(var/obj/target) + target.add_hiddenprint(src) + +/mob/living/AddTopicPrint(var/obj/target) + if(Adjacent(target)) + target.add_fingerprint(src) else - add_hiddenprint(user) + target.add_hiddenprint(src) + +/mob/living/silicon/ai/AddTopicPrint(var/obj/target) + target.add_hiddenprint(src) /obj/proc/CouldNotUseTopic(var/mob/user) // Nada