diff --git a/code/game/machinery/ARES/ARES_interface_apollo.dm b/code/game/machinery/ARES/ARES_interface_apollo.dm index 4796c25514fd..acd6dc1de11e 100644 --- a/code/game/machinery/ARES/ARES_interface_apollo.dm +++ b/code/game/machinery/ARES/ARES_interface_apollo.dm @@ -18,6 +18,9 @@ /// The last person to login. var/last_login + /// Notification sound + var/notify_sounds = TRUE + /obj/structure/machinery/computer/working_joe/proc/link_systems(datum/ares_link/new_link = GLOB.ares_link, override) if(link && !override) @@ -34,6 +37,16 @@ link_systems(override = FALSE) . = ..() +/obj/structure/machinery/computer/working_joe/proc/notify() + if(notify_sounds) + playsound(src, 'sound/machines/pda_ping.ogg', 25, 0) + +/obj/structure/machinery/computer/working_joe/proc/send_notifcation() + for(var/obj/structure/machinery/computer/working_joe/ticketer as anything in link.ticket_computers) + if(ticketer == src) + continue + ticketer.notify() + /obj/structure/machinery/computer/working_joe/proc/delink() if(link) link.ticket_computers -= src @@ -79,6 +92,8 @@ data["apollo_log"] = list() data["apollo_log"] += datacore.apollo_log + data["notify_sounds"] = notify_sounds + var/list/logged_maintenance = list() for(var/datum/ares_ticket/maintenance/maint_ticket as anything in link.tickets_maintenance) if(!istype(maint_ticket)) @@ -220,6 +235,9 @@ last_menu = current_menu current_menu = "core_security_gas" + if("toggle_sound") + notify_sounds = !notify_sounds + if("new_report") var/priority_report = FALSE var/maint_type = tgui_input_list(operator, "What is the type of maintenance item you wish to report?", "Report Category", GLOB.maintenance_categories, 30 SECONDS) @@ -245,6 +263,8 @@ link.tickets_maintenance += maint_ticket if(priority_report) ares_apollo_talk("Priority Maintenance Report: [maint_type] - ID [maint_ticket.ticket_id]. Seek and resolve.") + else + send_notifcation() log_game("ARES: Maintenance Ticket '\ref[maint_ticket]' created by [key_name(operator)] as [last_login] with Category '[maint_type]' and Details of '[details]'.") return TRUE return FALSE @@ -283,6 +303,8 @@ ticket.ticket_status = TICKET_CANCELLED if(ticket.ticket_priority) ares_apollo_talk("Priority [ticket.ticket_type] [ticket.ticket_id] has been cancelled.") + else + send_notifcation() return TRUE if("mark_ticket") @@ -302,6 +324,8 @@ return FALSE if(ticket.ticket_priority) ares_apollo_talk("Priority [ticket.ticket_type] [ticket.ticket_id] has been [choice] by [last_login].") + else + send_notifcation() to_chat(usr, SPAN_NOTICE("[ticket.ticket_type] [ticket.ticket_id] marked as [choice].")) return TRUE @@ -350,8 +374,6 @@ break for(var/obj/item/card/id/identification in link.active_ids) - if(!istype(identification)) - continue if(identification.registered_gid != access_ticket.user_id_num) continue @@ -378,8 +400,6 @@ if(!access_ticket) return FALSE for(var/obj/item/card/id/identification in link.waiting_ids) - if(!istype(identification)) - continue if(identification.registered_gid != access_ticket.user_id_num) continue identification.handle_ares_access(last_login, operator) @@ -388,8 +408,6 @@ ares_apollo_talk("Access Ticket [access_ticket.ticket_id]: [access_ticket.ticket_submitter] was granted access by [last_login].") return TRUE for(var/obj/item/card/id/identification in link.active_ids) - if(!istype(identification)) - continue if(identification.registered_gid != access_ticket.user_id_num) continue identification.handle_ares_access(last_login, operator) @@ -409,6 +427,13 @@ access_ticket.ticket_status = TICKET_REJECTED to_chat(operator, SPAN_NOTICE("[access_ticket.ticket_type] [access_ticket.ticket_id] marked as rejected.")) ares_apollo_talk("Access Ticket [access_ticket.ticket_id]: [access_ticket.ticket_submitter] was rejected access by [last_login].") + for(var/obj/item/card/id/identification in link.waiting_ids) + if(identification.registered_gid != access_ticket.user_id_num) + continue + var/mob/living/carbon/human/id_owner = identification.registered_ref?.resolve() + if(id_owner) + to_chat(id_owner, SPAN_WARNING("AI visitation access rejected.")) + playsound_client(id_owner?.client, 'sound/machines/pda_ping.ogg', src, 25, 0) return TRUE if("trigger_vent") @@ -433,12 +458,12 @@ if(playsound) playsound(src, "keyboard_alt", 15, 1) -/obj/item/card/id/proc/handle_ares_access(logged_in, mob/user) +/obj/item/card/id/proc/handle_ares_access(logged_in = MAIN_AI_SYSTEM, mob/user) var/operator = key_name(user) var/datum/ares_link/link = GLOB.ares_link if(logged_in == MAIN_AI_SYSTEM) if(!user) - operator = "[MAIN_AI_SYSTEM] (Sensor Trip)" + operator = "[MAIN_AI_SYSTEM] (Automated)" else operator = "[user.ckey]/([MAIN_AI_SYSTEM])" if(ACCESS_MARINE_AI_TEMP in access) @@ -446,10 +471,18 @@ link.active_ids -= src modification_log += "Temporary AI access revoked by [operator]" to_chat(user, SPAN_NOTICE("Access revoked from [registered_name].")) + var/mob/living/carbon/human/id_owner = registered_ref?.resolve() + if(id_owner) + to_chat(id_owner, SPAN_WARNING("AI visitation access revoked.")) + playsound_client(id_owner?.client, 'sound/machines/pda_ping.ogg', src, 25, 0) else access += ACCESS_MARINE_AI_TEMP modification_log += "Temporary AI access granted by [operator]" to_chat(user, SPAN_NOTICE("Access granted to [registered_name].")) link.waiting_ids -= src link.active_ids += src + var/mob/living/carbon/human/id_owner = registered_ref?.resolve() + if(id_owner) + to_chat(id_owner, SPAN_HELPFUL("AI visitation access granted.")) + playsound_client(id_owner?.client, 'sound/machines/pda_ping.ogg', src, 25, 0) return TRUE diff --git a/code/game/machinery/ARES/apollo_pda.dm b/code/game/machinery/ARES/apollo_pda.dm index 2d395d79932f..eda10a241e4f 100644 --- a/code/game/machinery/ARES/apollo_pda.dm +++ b/code/game/machinery/ARES/apollo_pda.dm @@ -19,6 +19,9 @@ /// The last person to login. var/last_login + /// Notification sound + var/notify_sounds = TRUE + /obj/item/device/working_joe_pda/proc/link_systems(datum/ares_link/new_link = GLOB.ares_link, override) if(link && !override) @@ -35,6 +38,16 @@ link_systems(override = FALSE) . = ..() +/obj/item/device/working_joe_pda/proc/notify() + if(notify_sounds) + playsound(src, 'sound/machines/pda_ping.ogg', 25, 0) + +/obj/item/device/working_joe_pda/proc/send_notifcation() + for(var/obj/item/device/working_joe_pda/ticketer as anything in link.ticket_computers) + if(ticketer == src) + continue + ticketer.notify() + /obj/item/device/working_joe_pda/proc/delink() if(link) link.ticket_computers -= src @@ -103,6 +116,8 @@ data["apollo_log"] = list() data["apollo_log"] += datacore.apollo_log + data["notify_sounds"] = notify_sounds + var/list/logged_maintenance = list() for(var/datum/ares_ticket/maintenance/maint_ticket as anything in link.tickets_maintenance) if(!istype(maint_ticket)) @@ -245,6 +260,9 @@ last_menu = current_menu current_menu = "core_security_gas" + if("toggle_sound") + notify_sounds = !notify_sounds + if("new_report") var/priority_report = FALSE var/maint_type = tgui_input_list(operator, "What is the type of maintenance item you wish to report?", "Report Category", GLOB.maintenance_categories, 30 SECONDS) @@ -270,6 +288,8 @@ link.tickets_maintenance += maint_ticket if(priority_report) ares_apollo_talk("Priority Maintenance Report: [maint_type] - ID [maint_ticket.ticket_id]. Seek and resolve.") + else + send_notifcation() log_game("ARES: Maintenance Ticket '\ref[maint_ticket]' created by [key_name(operator)] as [last_login] with Category '[maint_type]' and Details of '[details]'.") return TRUE return FALSE @@ -308,6 +328,8 @@ ticket.ticket_status = TICKET_CANCELLED if(ticket.ticket_priority) ares_apollo_talk("Priority [ticket.ticket_type] [ticket.ticket_id] has been cancelled.") + else + send_notifcation() return TRUE if("mark_ticket") @@ -327,6 +349,8 @@ return FALSE if(ticket.ticket_priority) ares_apollo_talk("Priority [ticket.ticket_type] [ticket.ticket_id] has been [choice] by [last_login].") + else + send_notifcation() to_chat(usr, SPAN_NOTICE("[ticket.ticket_type] [ticket.ticket_id] marked as [choice].")) return TRUE @@ -375,8 +399,6 @@ break for(var/obj/item/card/id/identification in link.active_ids) - if(!istype(identification)) - continue if(identification.registered_gid != access_ticket.user_id_num) continue @@ -403,8 +425,6 @@ if(!access_ticket) return FALSE for(var/obj/item/card/id/identification in link.waiting_ids) - if(!istype(identification)) - continue if(identification.registered_gid != access_ticket.user_id_num) continue identification.handle_ares_access(last_login, operator) @@ -413,8 +433,6 @@ ares_apollo_talk("Access Ticket [access_ticket.ticket_id]: [access_ticket.ticket_submitter] was granted access by [last_login].") return TRUE for(var/obj/item/card/id/identification in link.active_ids) - if(!istype(identification)) - continue if(identification.registered_gid != access_ticket.user_id_num) continue identification.handle_ares_access(last_login, operator) @@ -434,6 +452,13 @@ access_ticket.ticket_status = TICKET_REJECTED to_chat(operator, SPAN_NOTICE("[access_ticket.ticket_type] [access_ticket.ticket_id] marked as rejected.")) ares_apollo_talk("Access Ticket [access_ticket.ticket_id]: [access_ticket.ticket_submitter] was rejected access by [last_login].") + for(var/obj/item/card/id/identification in link.waiting_ids) + if(identification.registered_gid != access_ticket.user_id_num) + continue + var/mob/living/carbon/human/id_owner = identification.registered_ref?.resolve() + if(id_owner) + to_chat(id_owner, SPAN_WARNING("AI visitation access rejected.")) + playsound_client(id_owner?.client, 'sound/machines/pda_ping.ogg', src, 25, 0) return TRUE if("trigger_vent") diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index 9addf3346a39..31158d055327 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -67,7 +67,7 @@ /// The name registered_name on the card var/registered_name = "Unknown" - var/registered_ref = null + var/datum/weakref/registered_ref = null var/registered_gid = 0 flags_equip_slot = SLOT_ID diff --git a/sound/machines/pda_ping.ogg b/sound/machines/pda_ping.ogg new file mode 100644 index 000000000000..2f3135bc3c22 Binary files /dev/null and b/sound/machines/pda_ping.ogg differ diff --git a/tgui/packages/tgui/interfaces/WorkingJoe.jsx b/tgui/packages/tgui/interfaces/WorkingJoe.jsx index a654aacee125..0d9e47b1757a 100644 --- a/tgui/packages/tgui/interfaces/WorkingJoe.jsx +++ b/tgui/packages/tgui/interfaces/WorkingJoe.jsx @@ -64,12 +64,22 @@ const Login = (props) => { const MainMenu = (props) => { const { data, act } = useBackend(); - const { logged_in, access_text, last_page, current_menu, access_level } = - data; + const { + logged_in, + access_text, + last_page, + current_menu, + access_level, + notify_sounds, + } = data; let can_request_access = 'Yes'; if (access_level > 2) { can_request_access = 'No'; } + let soundicon = 'volume-high'; + if (!notify_sounds) { + soundicon = 'volume-xmark'; + } return ( <> @@ -87,11 +97,17 @@ const MainMenu = (props) => {