Skip to content

Commit

Permalink
last caller
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed Nov 22, 2023
1 parent 1b85e53 commit 6f8e085
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions code/modules/cm_phone/phone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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].."))
Expand Down
3 changes: 2 additions & 1 deletion tgui/packages/tgui/interfaces/PhoneMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -131,6 +131,7 @@ const GeneralPanel = (props, context) => {
/>
</Stack.Item>
)}
{!!last_caller && <Stack.Item>Last Caller: {last_caller}</Stack.Item>}
<Stack.Item>
<Button
content="Do Not Disturb"
Expand Down

0 comments on commit 6f8e085

Please sign in to comment.