diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm
index 6b191ef1..443ac26d 100644
--- a/code/game/machinery/requests_console.dm
+++ b/code/game/machinery/requests_console.dm
@@ -9,7 +9,7 @@ GLOBAL_LIST_EMPTY(allConsoles)
#define NO_NEW_MESSAGE 0
#define NORMAL_MESSAGE_PRIORITY 1
#define HIGH_MESSAGE_PRIORITY 2
-#define EXTREME_MESSAGE_PRIORITY 3 // not implemented, will probably require some hacking... everything needs to have a hidden feature in this game.
+#define EXTREME_MESSAGE_PRIORITY 3 // is implimented, does require hacking. everything needs to have a hidden feature in this game.
/obj/machinery/requests_console
name = "requests console"
@@ -47,9 +47,9 @@ GLOBAL_LIST_EMPTY(allConsoles)
var/announceAuth = FALSE //Will be set to 1 when you authenticate yourself for announcements
var/msgVerified = "" //Will contain the name of the person who verified it
var/msgStamped = "" //If a message is stamped, this will contain the stamp name
- var/message = "";
- var/dpt = ""; //the department which will be receiving the message
- var/priority = -1 ; //Priority of the message being sent
+ var/message = ""
+ var/dpt = "" //the department which will be receiving the message
+ var/priority = NORMAL_MESSAGE_PRIORITY //Priority of the message being sent. why is the default -1??
var/obj/item/radio/Radio
var/emergency //If an emergency has been called by this device. Acts as both a cooldown and lets the responder know where it the emergency was triggered from
var/receive_ore_updates = FALSE //If ore redemption machines will send an update when it receives new ores.
@@ -64,13 +64,14 @@ GLOBAL_LIST_EMPTY(allConsoles)
if(stat & NOPOWER)
set_light(0)
else
- set_light(1.4,0.7,"#34D352")//green light
+ set_light(1.4, 0.7, "#34D352")//green light
+
if(open)
if(!hackState)
icon_state="req_comp_open"
else
icon_state="req_comp_rewired"
- else if(stat & NOPOWER)
+ else if(CHECK_BITFIELD(stat, NOPOWER))
if(icon_state != "req_comp_off")
icon_state = "req_comp_off"
else
@@ -121,7 +122,7 @@ GLOBAL_LIST_EMPTY(allConsoles)
GLOB.req_console_information += department
Radio = new /obj/item/radio(src)
- Radio.listening = 0
+ Radio.listening = FALSE
/obj/machinery/requests_console/Destroy()
QDEL_NULL(Radio)
@@ -130,164 +131,173 @@ GLOBAL_LIST_EMPTY(allConsoles)
/obj/machinery/requests_console/ui_interact(mob/user)
. = ..()
+ if(open) //no.
+ return
+
var/dat = ""
- if(!open)
- switch(screen)
- if(1) //req. assistance
- dat += "Which department do you need assistance from?
"
- dat += "
| [dpt] | " - dat += "Normal High" - if(hackState) - dat += "EXTREME" - dat += " | " - dat += "
| [dpt] | " + dat += "" + dat += "Normal" + dat += "High" + if(hackState) + dat += "EXTREME" + dat += " | " + dat += "
| [dpt] | " - dat += "Normal High" - if(hackState) - dat += "EXTREME" - dat += " | " - dat += "
| [dpt] | " - dat += "Normal High" - if(hackState) - dat += "EXTREME" - dat += " | " - dat += "
| [dpt] | " + dat += "" + dat += "Normal" + dat += "High" + if(hackState) + dat += "EXTREME" + dat += " | " + dat += "
| X | Sender | Recipient | Message |
|---|---|---|---|
| [pda.sender] | [pda.recipient] | [pda.message][pda.picture ? " (Photo)":""] |
| Sender | -Sender's Job | -Recipient | -Message |
| [customsender] | -[customjob] | -[customrecepient ? customrecepient.owner : "NONE"] | -[custommessage] |
| X | Sending Dep. | Receiving Dep. | -Message | Stamp | ID Auth. | Priority. |
|---|---|---|---|---|---|---|
| [rc.send_dpt] | -[rc.rec_dpt] | [rc.message] | [rc.stamp] | [rc.id_auth] | [rc.priority] |
" \
- + "", "window=pdaphoto;size=[picture.psize_x]x[picture.psize_y];can-close=true")
+
+ M << browse_rsc(picture.picture_image, "pda_photo.png")
+
+ var/dat = ""
+
+ var/datum/browser/popup = new(M, "pdaphoto", "PDA Photo", picture.psize_x, picture.psize_y)
+ popup.set_content(dat)
+ popup.open()
onclose(M, "pdaphoto")
/datum/data_rc_msg
diff --git a/code/game/machinery/telecomms/machines/server.dm b/code/game/machinery/telecomms/machines/server.dm
index 46b16252..4ce2d54b 100644
--- a/code/game/machinery/telecomms/machines/server.dm
+++ b/code/game/machinery/telecomms/machines/server.dm
@@ -28,7 +28,7 @@
totaltraffic += traffic // add current traffic to total traffic
// Delete particularly old logs
- if (log_entries.len >= 400)
+ if(LAZYLEN(log_entries) >= 400) //[list].len is not safe
log_entries.Cut(1, 2)
var/datum/comm_log_entry/log = new
diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm
index b82b3071..ac812d52 100644
--- a/code/game/machinery/telecomms/telecomunications.dm
+++ b/code/game/machinery/telecomms/telecomunications.dm
@@ -1,152 +1,152 @@
-
-/*
- Hello, friends, this is Doohl from sexylands. You may be wondering what this
- monstrous code file is. Sit down, boys and girls, while I tell you the tale.
-
-
- The telecom machines were designed to be compatible with any radio
- signals, provided they use subspace transmission. Currently they are only used for
- headsets, but they can eventually be outfitted for real COMPUTER networks. This
- is just a skeleton, ladies and gentlemen.
-
- Look at radio.dm for the prequel to this code.
-*/
-
-GLOBAL_LIST_EMPTY(telecomms_list)
-
-/obj/machinery/telecomms
- icon = 'icons/obj/machines/telecomms.dmi'
- critical_machine = TRUE
- var/list/links = list() // list of machines this machine is linked to
- var/traffic = 0 // value increases as traffic increases
- var/netspeed = 5 // how much traffic to lose per tick (50 gigabytes/second * netspeed)
- var/list/autolinkers = list() // list of text/number values to link with
- var/id = "NULL" // identification string
- var/network = "NULL" // the network of the machinery
-
- var/list/freq_listening = list() // list of frequencies to tune into: if none, will listen to all
-
- var/on = TRUE
- var/toggled = TRUE // Is it toggled on
- var/long_range_link = FALSE // Can you link it across Z levels or on the otherside of the map? (Relay & Hub)
- var/hide = FALSE // Is it a hidden machine?
-
-
-/obj/machinery/telecomms/proc/relay_information(datum/signal/subspace/signal, filter, copysig, amount = 20)
- // relay signal to all linked machinery that are of type [filter]. If signal has been sent [amount] times, stop sending
-
- if(!on)
- return
- var/send_count = 0
-
- // Apply some lag based on traffic rates
- var/netlag = round(traffic / 50)
- if(netlag > signal.data["slow"])
- signal.data["slow"] = netlag
-
- // Loop through all linked machines and send the signal or copy.
- for(var/obj/machinery/telecomms/machine in links)
- if(filter && !istype( machine, filter ))
- continue
- if(!machine.on)
- continue
- if(amount && send_count >= amount)
- break
- if(z != machine.loc.z && !long_range_link && !machine.long_range_link)
- continue
-
- send_count++
- if(machine.is_freq_listening(signal))
- machine.traffic++
-
- if(copysig)
- machine.receive_information(signal.copy(), src)
- else
- machine.receive_information(signal, src)
-
- if(send_count > 0 && is_freq_listening(signal))
- traffic++
-
- return send_count
-
-/obj/machinery/telecomms/proc/relay_direct_information(datum/signal/signal, obj/machinery/telecomms/machine)
- // send signal directly to a machine
- machine.receive_information(signal, src)
-
-/obj/machinery/telecomms/proc/receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from)
- // receive information from linked machinery
-
-/obj/machinery/telecomms/proc/is_freq_listening(datum/signal/signal)
- // return TRUE if found, FALSE if not found
- return signal && (!freq_listening.len || (signal.frequency in freq_listening))
-
-/obj/machinery/telecomms/Initialize(mapload)
- . = ..()
- GLOB.telecomms_list += src
- if(mapload && autolinkers.len)
- return INITIALIZE_HINT_LATELOAD
-
-/obj/machinery/telecomms/LateInitialize()
- ..()
- for(var/obj/machinery/telecomms/T in (long_range_link ? GLOB.telecomms_list : urange(20, src, 1)))
- add_link(T)
-
-/obj/machinery/telecomms/Destroy()
- GLOB.telecomms_list -= src
- for(var/obj/machinery/telecomms/comm in GLOB.telecomms_list)
- comm.links -= src
- links = list()
- return ..()
-
-// Used in auto linking
-/obj/machinery/telecomms/proc/add_link(obj/machinery/telecomms/T)
- var/turf/position = get_turf(src)
- var/turf/T_position = get_turf(T)
- if((position.z == T_position.z) || (long_range_link && T.long_range_link))
- if(src != T)
- for(var/x in autolinkers)
- if(x in T.autolinkers)
- links |= T
- T.links |= src
-
-/obj/machinery/telecomms/update_icon()
- if(on)
- if(panel_open)
- icon_state = "[initial(icon_state)]_o"
- else
- icon_state = initial(icon_state)
- else
- if(panel_open)
- icon_state = "[initial(icon_state)]_o_off"
- else
- icon_state = "[initial(icon_state)]_off"
-
-/obj/machinery/telecomms/proc/update_power()
-
- if(toggled)
- if(stat & (BROKEN|NOPOWER|EMPED)) // if powered, on. if not powered, off. if too damaged, off
- on = FALSE
- else
- on = TRUE
- else
- on = FALSE
-
-/obj/machinery/telecomms/process()
- update_power()
-
- // Update the icon
- update_icon()
-
- if(traffic > 0)
- traffic -= netspeed
-
-/obj/machinery/telecomms/emp_act(severity)
- . = ..()
- if(. & EMP_PROTECT_SELF)
- return
- if(prob(100/severity))
- if(!(stat & EMPED))
- stat |= EMPED
- var/duration = (300 * 10)/severity
- spawn(rand(duration - 20, duration + 20)) // Takes a long time for the machines to reboot.
- stat &= ~EMPED
+
+/*
+ Hello, friends, this is Doohl from sexylands. You may be wondering what this
+ monstrous code file is. Sit down, boys and girls, while I tell you the tale.
+
+
+ The telecom machines were designed to be compatible with any radio
+ signals, provided they use subspace transmission. Currently they are only used for
+ headsets, but they can eventually be outfitted for real COMPUTER networks. This
+ is just a skeleton, ladies and gentlemen.
+
+ Look at radio.dm for the prequel to this code.
+*/
+
+GLOBAL_LIST_EMPTY(telecomms_list)
+
+/obj/machinery/telecomms
+ icon = 'icons/obj/machines/telecomms.dmi'
+ critical_machine = TRUE
+ var/list/links = list() // list of machines this machine is linked to
+ var/traffic = 0 // value increases as traffic increases
+ var/netspeed = 5 // how much traffic to lose per tick (50 gigabytes/second * netspeed)
+ var/list/autolinkers = list() // list of text/number values to link with
+ var/id = "NULL" // identification string
+ var/network = "NULL" // the network of the machinery
+
+ var/list/freq_listening = list() // list of frequencies to tune into: if none, will listen to all
+
+ var/on = TRUE
+ var/toggled = TRUE // Is it toggled on
+ var/long_range_link = FALSE // Can you link it across Z levels or on the otherside of the map? (Relay & Hub)
+ var/hide = FALSE // Is it a hidden machine?
+
+
+/obj/machinery/telecomms/proc/relay_information(datum/signal/subspace/signal, filter, copysig, amount = 20)
+ // relay signal to all linked machinery that are of type [filter]. If signal has been sent [amount] times, stop sending
+
+ if(!on)
+ return
+ var/send_count = 0
+
+ // Apply some lag based on traffic rates
+ var/netlag = round(traffic / 50)
+ if(netlag > signal.data["slow"])
+ signal.data["slow"] = netlag
+
+ // Loop through all linked machines and send the signal or copy.
+ for(var/obj/machinery/telecomms/machine in links)
+ if(filter && !istype( machine, filter ))
+ continue
+ if(!machine.on)
+ continue
+ if(amount && send_count >= amount)
+ break
+ if(z != machine.loc.z && !long_range_link && !machine.long_range_link)
+ continue
+
+ send_count++
+ if(machine.is_freq_listening(signal))
+ machine.traffic++
+
+ if(copysig)
+ machine.receive_information(signal.copy(), src)
+ else
+ machine.receive_information(signal, src)
+
+ if(send_count > 0 && is_freq_listening(signal))
+ traffic++
+
+ return send_count
+
+/obj/machinery/telecomms/proc/relay_direct_information(datum/signal/signal, obj/machinery/telecomms/machine)
+ // send signal directly to a machine
+ machine.receive_information(signal, src)
+
+/obj/machinery/telecomms/proc/receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from)
+ // receive information from linked machinery
+
+/obj/machinery/telecomms/proc/is_freq_listening(datum/signal/signal)
+ // return TRUE if found, FALSE if not found
+ return signal && (!freq_listening.len || (signal.frequency in freq_listening))
+
+/obj/machinery/telecomms/Initialize(mapload)
+ . = ..()
+ GLOB.telecomms_list += src
+ if(mapload && autolinkers.len)
+ return INITIALIZE_HINT_LATELOAD
+
+/obj/machinery/telecomms/LateInitialize()
+ ..()
+ for(var/obj/machinery/telecomms/T in (long_range_link ? GLOB.telecomms_list : urange(20, src, 1)))
+ add_link(T)
+
+/obj/machinery/telecomms/Destroy()
+ GLOB.telecomms_list -= src
+ for(var/obj/machinery/telecomms/comm in GLOB.telecomms_list)
+ comm.links -= src
+ links = list()
+ return ..()
+
+// Used in auto linking
+/obj/machinery/telecomms/proc/add_link(obj/machinery/telecomms/T)
+ var/turf/position = get_turf(src)
+ var/turf/T_position = get_turf(T)
+ if((position.z == T_position.z) || (long_range_link && T.long_range_link))
+ if(src != T)
+ for(var/x in autolinkers)
+ if(x in T.autolinkers)
+ links |= T
+ T.links |= src
+
+/obj/machinery/telecomms/update_icon()
+ if(on)
+ if(panel_open)
+ icon_state = "[initial(icon_state)]_o"
+ else
+ icon_state = initial(icon_state)
+ else
+ if(panel_open)
+ icon_state = "[initial(icon_state)]_o_off"
+ else
+ icon_state = "[initial(icon_state)]_off"
+
+/obj/machinery/telecomms/proc/update_power()
+ if(toggled)
+ // if powered, on. if not powered, off. if too damaged, off
+ if(CHECK_BITFIELD(stat, (BROKEN | NOPOWER | EMPED)))
+ on = FALSE
+ else
+ on = TRUE
+ else
+ on = FALSE
+
+/obj/machinery/telecomms/process()
+ update_power()
+
+ // Update the icon
+ update_icon()
+
+ if(traffic > 0)
+ traffic -= netspeed
+
+/obj/machinery/telecomms/emp_act(severity)
+ . = ..()
+ if(CHECK_BITFIELD(., EMP_PROTECT_SELF))
+ return
+ if(prob(100 / severity))
+ if(!CHECK_BITFIELD(stat, EMPED))
+ ENABLE_BITFIELD(stat, EMPED)
+ var/duration = (300 * 10) / severity
+ spawn(rand(duration - 20, duration + 20)) // Takes a long time for the machines to reboot.
+ DISABLE_BITFIELD(stat, EMPED)
diff --git a/tgui-next/packages/tgui/interfaces/TelecommsInteraction.js b/tgui-next/packages/tgui/interfaces/TelecommsInteraction.js
new file mode 100644
index 00000000..a67bfdf9
--- /dev/null
+++ b/tgui-next/packages/tgui/interfaces/TelecommsInteraction.js
@@ -0,0 +1,238 @@
+import { Fragment } from 'inferno';
+import { useBackend } from '../backend';
+import { toFixed } from 'common/math';
+import { RADIO_CHANNELS } from '../constants';
+import { Button, LabeledList, NumberInput, NoticeBox, Section, Input } from '../components';
+
+export const TeleInteract = props => {
+ const { act, data } = useBackend(props);
+ const {
+ notice = "",
+ multitool = false,
+ multitool_buf = null,
+ machine = null,
+ links = [],
+ freq_listening = [],
+ } = data;
+ const {
+ power = false,
+ id = "NULL",
+ network,
+ prefab = false,
+ hidden = false,
+ isrelay = false,
+ isbus = false,
+ } = machine;
+ return (
+