From 19c90a78b757a834eade9d725a2c7aece721eb08 Mon Sep 17 00:00:00 2001 From: forest2001 <41653574+realforest2001@users.noreply.github.com> Date: Fri, 24 Nov 2023 10:16:19 +0000 Subject: [PATCH] Phone QOL - Last Caller ID (#5008) # About the pull request Phones now log the last phone_id to call them. # Explain why it's good for the game QOL, sometimes you miss calls, other times people are... irritating. # Testing Photographs and Procedure
Screenshots & Videos Put screenshots and videos here with an empty line between the screenshots and the `
` tags. ![image](https://github.com/cmss13-devs/cmss13/assets/41653574/9d90f07a-82be-4e1c-94e8-88a366c97425)
# Changelog :cl: add: Telephones now list the last attempted caller, above the DND button. /:cl: --- 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}}