From 6f8e0852e64214b35468cdff58265f2d267a6c6d Mon Sep 17 00:00:00 2001 From: forest2001 Date: Wed, 22 Nov 2023 19:39:53 +0000 Subject: [PATCH] last caller --- code/modules/cm_phone/phone.dm | 4 ++++ tgui/packages/tgui/interfaces/PhoneMenu.js | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/code/modules/cm_phone/phone.dm b/code/modules/cm_phone/phone.dm index fd9c8aa02d44..b4f13044bc20 100644 --- a/code/modules/cm_phone/phone.dm +++ b/code/modules/cm_phone/phone.dm @@ -26,6 +26,8 @@ GLOBAL_LIST_EMPTY_TYPED(transmitters, /obj/structure/transmitter) var/enabled = TRUE /// Whether or not the phone is receiving calls or not. Varies between on/off or forcibly on/off. var/do_not_disturb = PHONE_DND_OFF + /// The Phone_ID of the last person to call this telephone. + var/last_caller var/base_icon_state @@ -138,6 +140,7 @@ GLOBAL_LIST_EMPTY_TYPED(transmitters, /obj/structure/transmitter) var/list/data = list() data["availability"] = do_not_disturb + data["last_caller"] = last_caller return data @@ -175,6 +178,7 @@ GLOBAL_LIST_EMPTY_TYPED(transmitters, /obj/structure/transmitter) calling = T T.caller = src + T.last_caller = src.phone_id T.update_icon() to_chat(user, SPAN_PURPLE("[icon2html(src, user)] Dialing [calling_phone_id]..")) diff --git a/tgui/packages/tgui/interfaces/PhoneMenu.js b/tgui/packages/tgui/interfaces/PhoneMenu.js index 9a2edf943767..233ca47987cd 100644 --- a/tgui/packages/tgui/interfaces/PhoneMenu.js +++ b/tgui/packages/tgui/interfaces/PhoneMenu.js @@ -15,7 +15,7 @@ export const PhoneMenu = (props, context) => { const GeneralPanel = (props, context) => { const { act, data } = useBackend(context); - const { availability } = data; + const { availability, last_caller } = data; const available_transmitters = Object.keys(data.available_transmitters); const transmitters = data.transmitters.filter((val1) => available_transmitters.includes(val1.phone_id) @@ -131,6 +131,7 @@ const GeneralPanel = (props, context) => { /> )} + {!!last_caller && Last Caller: {last_caller}}