Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phone QOL - Last Caller ID #5008

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading