mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-21 20:13:45 +01:00
@@ -159,7 +159,6 @@
|
||||
radio.name = "[src] radio"
|
||||
radio.icon = icon
|
||||
radio.icon_state = icon_state
|
||||
radio.subspace_transmission = 1
|
||||
|
||||
/obj/mecha/examine(mob/user)
|
||||
. = ..()
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
materials = list(MAT_METAL=10000, MAT_GLASS=2500)
|
||||
var/code = 2
|
||||
|
||||
is_special = 1
|
||||
|
||||
/obj/item/radio/electropack/attack_hand(mob/user as mob)
|
||||
if(src == user.back)
|
||||
to_chat(user, "<span class='notice'>You need help taking this off!</span>")
|
||||
@@ -54,23 +52,6 @@
|
||||
if(src.flags & NODROP)
|
||||
A.flags |= NODROP
|
||||
|
||||
/obj/item/radio/electropack/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
if(href_list["freq"])
|
||||
var/new_frequency = sanitize_frequency(frequency + text2num(href_list["freq"]))
|
||||
set_frequency(new_frequency)
|
||||
|
||||
else if(href_list["code"])
|
||||
code += text2num(href_list["code"])
|
||||
code = round(code)
|
||||
code = clamp(code, 1, 100)
|
||||
|
||||
else if(href_list["power"])
|
||||
on = !on
|
||||
|
||||
add_fingerprint(usr)
|
||||
|
||||
/obj/item/radio/electropack/receive_signal(datum/signal/signal)
|
||||
if(!signal || signal.encryption != code)
|
||||
@@ -96,18 +77,48 @@
|
||||
return
|
||||
|
||||
|
||||
/obj/item/radio/electropack/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/item/radio/electropack/tgui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = TRUE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_inventory_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "radio_electro.tmpl", "[name]", 400, 500)
|
||||
ui = new(user, src, ui_key, "Electropack", name, 360, 150, master_ui, state)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/item/radio/electropack/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state)
|
||||
var/data[0]
|
||||
|
||||
/obj/item/radio/electropack/tgui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["power"] = on
|
||||
data["freq"] = format_frequency(frequency)
|
||||
data["frequency"] = frequency
|
||||
data["code"] = code
|
||||
|
||||
data["minFrequency"] = PUBLIC_LOW_FREQ
|
||||
data["maxFrequency"] = PUBLIC_HIGH_FREQ
|
||||
return data
|
||||
|
||||
/obj/item/radio/electropack/tgui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
. = TRUE
|
||||
switch(action)
|
||||
if("power")
|
||||
on = !on
|
||||
if("freq")
|
||||
var/value = params["freq"]
|
||||
if(value)
|
||||
frequency = sanitize_frequency(value)
|
||||
set_frequency(frequency)
|
||||
else
|
||||
. = FALSE
|
||||
if("code")
|
||||
var/value = text2num(params["code"])
|
||||
if(value)
|
||||
value = round(value)
|
||||
code = clamp(value, 1, 100)
|
||||
else
|
||||
. = FALSE
|
||||
if("reset")
|
||||
if(params["reset"] == "freq")
|
||||
frequency = initial(frequency)
|
||||
else if(params["reset"] == "code")
|
||||
code = initial(code)
|
||||
else
|
||||
. = FALSE
|
||||
if(.)
|
||||
add_fingerprint(usr)
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
"Vox Armalis" = 'icons/mob/species/armalis/ears.dmi'
|
||||
) //We read you loud and skree-er.
|
||||
materials = list(MAT_METAL=75)
|
||||
subspace_transmission = TRUE
|
||||
canhear_range = 0 // can't hear headsets from very far away
|
||||
|
||||
slot_flags = SLOT_EARS
|
||||
@@ -91,6 +90,7 @@
|
||||
ks1type = /obj/item/encryptionkey/syndicate/nukeops
|
||||
requires_tcomms = FALSE
|
||||
instant = TRUE // Work instantly if there are no comms
|
||||
freqlock = TRUE
|
||||
|
||||
/obj/item/radio/headset/syndicate/alt //undisguised bowman with flash protection
|
||||
name = "syndicate headset"
|
||||
@@ -289,6 +289,7 @@
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
ks2type = /obj/item/encryptionkey/ert
|
||||
freqlock = TRUE
|
||||
|
||||
/obj/item/radio/headset/ert/alt
|
||||
name = "\proper emergency response team's bowman headset"
|
||||
@@ -367,7 +368,7 @@
|
||||
else
|
||||
to_chat(user, "This headset doesn't have any encryption keys! How useless...")
|
||||
|
||||
/obj/item/radio/headset/proc/recalculateChannels(var/setDescription = FALSE)
|
||||
/obj/item/radio/headset/recalculateChannels(setDescription = FALSE)
|
||||
channels = list()
|
||||
translate_binary = FALSE
|
||||
translate_hive = FALSE
|
||||
|
||||
@@ -75,7 +75,6 @@
|
||||
name = "illicit intercom"
|
||||
desc = "Talk through this. Evilly"
|
||||
frequency = SYND_FREQ
|
||||
subspace_transmission = TRUE
|
||||
syndiekey = new /obj/item/encryptionkey/syndicate/nukeops
|
||||
|
||||
/obj/item/radio/intercom/syndicate/New()
|
||||
@@ -85,7 +84,6 @@
|
||||
/obj/item/radio/intercom/pirate
|
||||
name = "pirate radio intercom"
|
||||
desc = "You wouldn't steal a space shuttle. Piracy. It's a crime!"
|
||||
subspace_transmission = 1
|
||||
|
||||
/obj/item/radio/intercom/pirate/New()
|
||||
..()
|
||||
@@ -109,13 +107,13 @@
|
||||
GLOB.global_intercoms.Remove(src)
|
||||
return ..()
|
||||
|
||||
/obj/item/radio/intercom/attack_ai(mob/user as mob)
|
||||
/obj/item/radio/intercom/attack_ai(mob/user)
|
||||
add_hiddenprint(user)
|
||||
add_fingerprint(user)
|
||||
spawn(0)
|
||||
attack_self(user)
|
||||
|
||||
/obj/item/radio/intercom/attack_hand(mob/user as mob)
|
||||
/obj/item/radio/intercom/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
spawn(0)
|
||||
attack_self(user)
|
||||
|
||||
@@ -26,21 +26,37 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
|
||||
suffix = "\[3\]"
|
||||
icon_state = "walkietalkie"
|
||||
item_state = "walkietalkie"
|
||||
var/on = 1 // 0 for off
|
||||
/// boolean for radio enabled or not
|
||||
var/on = TRUE
|
||||
var/last_transmission
|
||||
var/frequency = PUB_FREQ //common chat
|
||||
var/traitor_frequency = 0 //tune to frequency to unlock traitor supplies
|
||||
var/canhear_range = 3 // the range which mobs can hear this radio from
|
||||
var/frequency = PUB_FREQ
|
||||
/// tune to frequency to unlock traitor supplies
|
||||
var/traitor_frequency = 0
|
||||
/// the range which mobs can hear this radio from
|
||||
var/canhear_range = 3
|
||||
var/datum/wires/radio/wires = null
|
||||
var/b_stat = 0
|
||||
var/broadcasting = 0
|
||||
var/listening = 1
|
||||
var/list/channels = list() //see communications.dm for full list. First channes is a "default" for :h
|
||||
var/subspace_transmission = 0
|
||||
var/obj/item/encryptionkey/syndicate/syndiekey = null //Holder for the syndicate encryption key if present
|
||||
var/disable_timer = 0 //How many times this is disabled by EMPs
|
||||
|
||||
var/is_special = 0 //For electropacks mostly, skips Topic() checks
|
||||
/// Whether the radio will broadcast stuff it hears, out over the radio
|
||||
var/broadcasting = FALSE
|
||||
/// Whether the radio is currently receiving
|
||||
var/listening = TRUE
|
||||
/// Whether the radio can be re-tuned to restricted channels it has no key for
|
||||
var/freerange = FALSE
|
||||
/// Whether the radio is able to have its primary frequency changed. Used for radios with weird primary frequencies, like DS, syndi, etc
|
||||
var/freqlock = FALSE
|
||||
|
||||
/// Whether the radio broadcasts to everyone within a few tiles, or not
|
||||
var/loudspeaker = FALSE
|
||||
/// Whether loudspeaker can be toggled by the user
|
||||
var/has_loudspeaker = FALSE
|
||||
|
||||
/// see communications.dm for full list. First channes is a "default" for :h
|
||||
var/list/channels = list()
|
||||
/// Holder for the syndicate encryption key if present
|
||||
var/obj/item/encryptionkey/syndicate/syndiekey = null
|
||||
/// How many times this is disabled by EMPs
|
||||
var/disable_timer = 0
|
||||
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
@@ -100,47 +116,87 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
|
||||
/obj/item/radio/attack_ghost(mob/user)
|
||||
return interact(user)
|
||||
|
||||
/obj/item/radio/attack_self(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
/obj/item/radio/attack_self(mob/user)
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/item/radio/interact(mob/user)
|
||||
if(!user)
|
||||
return 0
|
||||
|
||||
if(b_stat)
|
||||
wires.Interact(user)
|
||||
tgui_interact(user)
|
||||
|
||||
return ui_interact(user)
|
||||
|
||||
/obj/item/radio/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/item/radio/tgui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = TRUE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_physical_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "radio_basic.tmpl", "[name]", 400, 550)
|
||||
ui = new(user, src, ui_key, "Radio", name, 360, 150 + (length(channels) * 20), master_ui, state)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/item/radio/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state)
|
||||
var/data[0]
|
||||
/obj/item/radio/tgui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
data["mic_status"] = broadcasting
|
||||
data["speaker"] = listening
|
||||
data["freq"] = format_frequency(frequency)
|
||||
data["rawfreq"] = num2text(frequency)
|
||||
|
||||
data["mic_cut"] = (wires.is_cut(WIRE_RADIO_TRANSMIT) || wires.is_cut(WIRE_RADIO_SIGNAL))
|
||||
data["spk_cut"] = (wires.is_cut(WIRE_RADIO_RECEIVER) || wires.is_cut(WIRE_RADIO_SIGNAL))
|
||||
|
||||
var/list/chanlist = list_channels(user)
|
||||
if(islist(chanlist) && chanlist.len)
|
||||
data["chan_list"] = chanlist
|
||||
data["chan_list_len"] = chanlist.len
|
||||
|
||||
if(syndiekey)
|
||||
data["useSyndMode"] = 1
|
||||
data["broadcasting"] = broadcasting
|
||||
data["listening"] = listening
|
||||
data["frequency"] = frequency
|
||||
data["minFrequency"] = freerange ? RADIO_LOW_FREQ : PUBLIC_LOW_FREQ
|
||||
data["maxFrequency"] = freerange ? RADIO_HIGH_FREQ : PUBLIC_HIGH_FREQ
|
||||
data["canReset"] = frequency == initial(frequency) ? FALSE : TRUE
|
||||
data["freqlock"] = freqlock
|
||||
data["channels"] = list()
|
||||
for(var/channel in channels)
|
||||
data["channels"][channel] = channels[channel] & FREQ_LISTENING
|
||||
|
||||
data["has_loudspeaker"] = has_loudspeaker
|
||||
data["loudspeaker"] = loudspeaker
|
||||
return data
|
||||
|
||||
/obj/item/radio/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return
|
||||
. = TRUE
|
||||
switch(action)
|
||||
if("frequency")
|
||||
if(freqlock)
|
||||
return
|
||||
var/tune = params["tune"]
|
||||
var/adjust = text2num(params["adjust"])
|
||||
if(tune == "reset")
|
||||
tune = initial(frequency)
|
||||
else if(adjust)
|
||||
tune = frequency + adjust * 10
|
||||
else if(text2num(tune) != null)
|
||||
tune = tune * 10
|
||||
else
|
||||
. = FALSE
|
||||
if(hidden_uplink)
|
||||
if(hidden_uplink.check_trigger(usr, frequency, traitor_frequency))
|
||||
usr << browse(null, "window=radio")
|
||||
if(.)
|
||||
set_frequency(sanitize_frequency(tune, freerange))
|
||||
if("listen")
|
||||
listening = !listening
|
||||
if("broadcast")
|
||||
broadcasting = !broadcasting
|
||||
if("channel")
|
||||
var/channel = params["channel"]
|
||||
if(!(channel in channels))
|
||||
return
|
||||
if(channels[channel] & FREQ_LISTENING)
|
||||
channels[channel] &= ~FREQ_LISTENING
|
||||
else
|
||||
channels[channel] |= FREQ_LISTENING
|
||||
if("loudspeaker")
|
||||
// Toggle loudspeaker mode, AKA everyone around you hearing your radio.
|
||||
if(has_loudspeaker)
|
||||
loudspeaker = !loudspeaker
|
||||
if(loudspeaker)
|
||||
canhear_range = 3
|
||||
else
|
||||
canhear_range = 0
|
||||
else
|
||||
. = FALSE
|
||||
if(.)
|
||||
add_fingerprint(usr)
|
||||
|
||||
/obj/item/radio/proc/list_channels(var/mob/user)
|
||||
return list_internal_channels(user)
|
||||
@@ -190,53 +246,6 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
|
||||
/obj/item/radio/proc/ToggleReception()
|
||||
listening = !listening && !(wires.is_cut(WIRE_RADIO_RECEIVER) || wires.is_cut(WIRE_RADIO_SIGNAL))
|
||||
|
||||
/obj/item/radio/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
if(is_special)
|
||||
return 0
|
||||
|
||||
if(href_list["track"])
|
||||
var/mob/target = locate(href_list["track"])
|
||||
var/mob/living/silicon/ai/A = locate(href_list["track2"])
|
||||
if(A && target)
|
||||
A.ai_actual_track(target)
|
||||
. = 1
|
||||
|
||||
else if(href_list["freq"])
|
||||
var/new_frequency = (frequency + text2num(href_list["freq"]))
|
||||
if((new_frequency < PUBLIC_LOW_FREQ || new_frequency > PUBLIC_HIGH_FREQ))
|
||||
new_frequency = sanitize_frequency(new_frequency)
|
||||
set_frequency(new_frequency)
|
||||
if(hidden_uplink)
|
||||
if(hidden_uplink.check_trigger(usr, frequency, traitor_frequency))
|
||||
usr << browse(null, "window=radio")
|
||||
. = 1
|
||||
else if(href_list["talk"])
|
||||
ToggleBroadcast()
|
||||
. = 1
|
||||
else if(href_list["listen"])
|
||||
var/chan_name = href_list["ch_name"]
|
||||
if(!chan_name)
|
||||
ToggleReception()
|
||||
else
|
||||
if(channels[chan_name] & FREQ_LISTENING)
|
||||
channels[chan_name] &= ~FREQ_LISTENING
|
||||
else
|
||||
channels[chan_name] |= FREQ_LISTENING
|
||||
. = 1
|
||||
else if(href_list["spec_freq"])
|
||||
var/freq = href_list["spec_freq"]
|
||||
if(has_channel_access(usr, freq))
|
||||
set_frequency(text2num(freq))
|
||||
. = 1
|
||||
|
||||
if(href_list["nowindow"]) // here for pAIs, maybe others will want it, idk
|
||||
return 1
|
||||
|
||||
add_fingerprint(usr)
|
||||
|
||||
/obj/item/radio/proc/autosay(message, from, channel, role = "Unknown") //BS12 EDIT
|
||||
var/datum/radio_frequency/connection = null
|
||||
if(channel && channels && channels.len > 0)
|
||||
@@ -582,19 +591,24 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
|
||||
if(!disable_timer)
|
||||
on = 1
|
||||
|
||||
/obj/item/radio/proc/recalculateChannels()
|
||||
/// Exists so that borg radios and headsets can override it.
|
||||
stack_trace("recalculateChannels() called on a radio which does not implement the proc.")
|
||||
|
||||
///////////////////////////////
|
||||
//////////Borg Radios//////////
|
||||
///////////////////////////////
|
||||
//Giving borgs their own radio to have some more room to work with -Sieve
|
||||
|
||||
/obj/item/radio/borg
|
||||
name = "Cyborg Radio"
|
||||
var/mob/living/silicon/robot/myborg = null // Cyborg which owns this radio. Used for power checks
|
||||
var/obj/item/encryptionkey/keyslot = null//Borg radios can handle a single encryption key
|
||||
var/shut_up = 1
|
||||
icon = 'icons/obj/robot_component.dmi' // Cyborgs radio icons should look like the component.
|
||||
icon_state = "radio"
|
||||
has_loudspeaker = TRUE
|
||||
loudspeaker = FALSE
|
||||
canhear_range = 0
|
||||
subspace_transmission = 1
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/radio/borg/syndicate
|
||||
@@ -616,12 +630,14 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
|
||||
..()
|
||||
syndiekey = keyslot
|
||||
set_frequency(SYND_FREQ)
|
||||
freqlock = TRUE
|
||||
|
||||
/obj/item/radio/borg/deathsquad
|
||||
|
||||
/obj/item/radio/borg/deathsquad/New()
|
||||
..()
|
||||
set_frequency(DTH_FREQ)
|
||||
freqlock = TRUE
|
||||
|
||||
/obj/item/radio/borg/ert
|
||||
keyslot = new /obj/item/encryptionkey/ert
|
||||
@@ -629,6 +645,7 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
|
||||
/obj/item/radio/borg/ert/New()
|
||||
..()
|
||||
set_frequency(ERT_FREQ)
|
||||
freqlock = TRUE
|
||||
|
||||
/obj/item/radio/borg/ert/specops
|
||||
keyslot = new /obj/item/encryptionkey/centcom
|
||||
@@ -673,7 +690,7 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
|
||||
else
|
||||
to_chat(user, "This radio doesn't have any encryption keys!")
|
||||
|
||||
/obj/item/radio/borg/proc/recalculateChannels()
|
||||
/obj/item/radio/borg/recalculateChannels()
|
||||
channels = list()
|
||||
syndiekey = null
|
||||
|
||||
@@ -706,72 +723,12 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
|
||||
|
||||
return
|
||||
|
||||
/obj/item/radio/borg/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
if(href_list["mode"])
|
||||
var/enable_subspace_transmission = text2num(href_list["mode"])
|
||||
if(enable_subspace_transmission != subspace_transmission)
|
||||
subspace_transmission = !subspace_transmission
|
||||
if(subspace_transmission)
|
||||
to_chat(usr, "<span class='notice'>Subspace Transmission is enabled.</span>")
|
||||
else
|
||||
to_chat(usr, "<span class='notice'>Subspace Transmission is disabled.</span>")
|
||||
|
||||
if(subspace_transmission == 0)//Simple as fuck, clears the channel list to prevent talking/listening over them if subspace transmission is disabled
|
||||
channels = list()
|
||||
else
|
||||
recalculateChannels()
|
||||
. = 1
|
||||
if(href_list["shutup"]) // Toggle loudspeaker mode, AKA everyone around you hearing your radio.
|
||||
var/do_shut_up = text2num(href_list["shutup"])
|
||||
if(do_shut_up != shut_up)
|
||||
shut_up = !shut_up
|
||||
if(shut_up)
|
||||
canhear_range = 0
|
||||
to_chat(usr, "<span class='notice'>Loudspeaker disabled.</span>")
|
||||
else
|
||||
canhear_range = 3
|
||||
to_chat(usr, "<span class='notice'>Loudspeaker enabled.</span>")
|
||||
. = 1
|
||||
|
||||
|
||||
/obj/item/radio/borg/interact(mob/user as mob)
|
||||
/obj/item/radio/borg/interact(mob/user)
|
||||
if(!on)
|
||||
return
|
||||
|
||||
. = ..()
|
||||
|
||||
/obj/item/radio/borg/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "radio_basic.tmpl", "[name]", 430, 500)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/item/radio/borg/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state)
|
||||
var/data[0]
|
||||
|
||||
data["mic_status"] = broadcasting
|
||||
data["speaker"] = listening
|
||||
data["freq"] = format_frequency(frequency)
|
||||
data["rawfreq"] = num2text(frequency)
|
||||
|
||||
var/list/chanlist = list_channels(user)
|
||||
if(islist(chanlist) && chanlist.len)
|
||||
data["chan_list"] = chanlist
|
||||
data["chan_list_len"] = chanlist.len
|
||||
|
||||
if(syndiekey)
|
||||
data["useSyndMode"] = 1
|
||||
|
||||
data["has_loudspeaker"] = 1
|
||||
data["loudspeaker"] = !shut_up
|
||||
data["has_subspace"] = 1
|
||||
data["subspace"] = subspace_transmission
|
||||
|
||||
return data
|
||||
|
||||
/obj/item/radio/proc/config(op)
|
||||
if(SSradio)
|
||||
for(var/ch_name in channels)
|
||||
|
||||
@@ -164,6 +164,7 @@ GLOBAL_VAR_INIT(sent_strike_team, 0)
|
||||
R.set_frequency(DTH_FREQ)
|
||||
R.requires_tcomms = FALSE
|
||||
R.instant = TRUE
|
||||
R.freqlock = TRUE
|
||||
equip_to_slot_or_del(R, slot_l_ear)
|
||||
if(is_leader)
|
||||
equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_officer(src), slot_w_uniform)
|
||||
|
||||
@@ -1119,7 +1119,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/robot/proc/radio_menu()
|
||||
radio.interact(src)//Just use the radio's Topic() instead of bullshit special-snowflake code
|
||||
radio.interact(src)
|
||||
|
||||
/mob/living/silicon/robot/proc/control_headlamp()
|
||||
if(stat || lamp_recharging || low_power_mode)
|
||||
|
||||
@@ -94,7 +94,6 @@
|
||||
hud_possible = list(DIAG_STAT_HUD, DIAG_BOT_HUD, DIAG_HUD, DIAG_PATH_HUD = HUD_LIST_LIST)//Diagnostic HUD views
|
||||
|
||||
/obj/item/radio/headset/bot
|
||||
subspace_transmission = 1
|
||||
requires_tcomms = FALSE
|
||||
canhear_range = 0
|
||||
|
||||
|
||||
@@ -318,3 +318,4 @@ GLOBAL_VAR_INIT(ert_request_answered, FALSE)
|
||||
name = "centcomm bounced radio"
|
||||
frequency = ERT_FREQ
|
||||
icon_state = "radio"
|
||||
freqlock = TRUE
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
<!--
|
||||
Title: Basic Radio UI
|
||||
Used In File(s): /code/game/objects/item/devices/radio/radio.dm
|
||||
-->
|
||||
<head>
|
||||
<style type="text/css">
|
||||
.radio {color: #408010;}
|
||||
.deptradio {color: #993399;}
|
||||
.comradio {color: #204090;}
|
||||
.syndradio {color: #6D3F40;}
|
||||
.centradio {color: #5C5C7C;}
|
||||
.airadio {color: #FF00FF;}
|
||||
.secradio {color: #A30000;}
|
||||
.engradio {color: #A66300;}
|
||||
.medradio {color: #009190;}
|
||||
.sciradio {color: #993399;}
|
||||
.supradio {color: #7F6539;}
|
||||
.srvradio {color: #80A000;}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
{{if data.useSyndMode}}
|
||||
{{:helper.syndicateMode()}}
|
||||
{{/if}}
|
||||
|
||||
<div class="item">
|
||||
<div class="itemLabelWide">
|
||||
Microphone
|
||||
</div>
|
||||
<div class="itemContentMedium">
|
||||
{{if data.mic_cut}}
|
||||
{{:helper.link('On', null, null, 'disabled')}}
|
||||
{{:helper.link('Off', null, null, 'disabled')}}
|
||||
{{else}}
|
||||
{{:helper.link('On', null, {'talk' : 0}, data.mic_status ? 'selected' : null)}}
|
||||
{{:helper.link('Off', null, {'talk' : 1}, data.mic_status ? null : 'selected')}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<div class="itemLabelWide">
|
||||
Speaker
|
||||
</div>
|
||||
<div class="itemContentMedium">
|
||||
{{if data.spk_cut}}
|
||||
{{:helper.link('On', null, null, 'disabled')}}
|
||||
{{:helper.link('Off', null, null, 'disabled')}}
|
||||
{{else}}
|
||||
{{:helper.link('On', null, {'listen' : 0}, data.speaker ? 'selected' : null)}}
|
||||
{{:helper.link('Off', null, {'listen' : 1}, data.speaker ? null : 'selected')}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if data.has_subspace}}
|
||||
<div class="item">
|
||||
<div class="itemLabelWide">
|
||||
Subspace Transmission:
|
||||
</div>
|
||||
<div class="itemContentMedium">
|
||||
{{:helper.link('On', null, {'mode' : 1}, data.subspace ? 'selected' : null)}}
|
||||
{{:helper.link('Off', null, {'mode' : 0}, data.subspace ? null : 'selected')}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{if data.has_loudspeaker}}
|
||||
<div class="item">
|
||||
<div class="itemLabelWide">
|
||||
Loudspeaker:
|
||||
</div>
|
||||
<div class="itemContentMedium">
|
||||
{{:helper.link('On', null, {'shutup' : 0}, data.loudspeaker ? 'selected' : null)}}
|
||||
{{:helper.link('Off', null, {'shutup' : 1}, data.loudspeaker ? null : 'selected')}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<div class="item">
|
||||
<div class="itemLabelWide">
|
||||
Frequency: {{:data.freq}}
|
||||
</div>
|
||||
<div class="itemContentMedium">
|
||||
{{:helper.link('--', null, {'freq' : -10})}}
|
||||
{{:helper.link('-', null, {'freq' : -2})}}
|
||||
{{:helper.link('+', null, {'freq' : 2})}}
|
||||
{{:helper.link('++', null, {'freq' : 10})}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if data.chan_list_len >= 1}}
|
||||
<h3>Channels</h3>
|
||||
<div class="item">
|
||||
{{for data.chan_list}}
|
||||
<div class="itemLabelWide">
|
||||
<span class='{{:value.chan_span}}'>◼</span>{{:value.display_name}}
|
||||
</div>
|
||||
<div class="itemContentMedium">
|
||||
{{if value.secure_channel}}
|
||||
{{:helper.link('On', null, {'ch_name' : value.chan, 'listen' : value.sec_channel_listen}, value.sec_channel_listen ? null : 'selected')}}
|
||||
{{:helper.link('Off', null, {'ch_name' : value.chan, 'listen' : value.sec_channel_listen}, value.sec_channel_listen ? 'selected' : null)}}
|
||||
{{else}}
|
||||
{{:helper.link('Switch', null, {'spec_freq' : value.chan}, data.rawfreq == value.chan ? 'selected' : null)}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/for}}
|
||||
</div>
|
||||
{{/if}}
|
||||
@@ -1,37 +0,0 @@
|
||||
<!--
|
||||
Title: Electropack UI
|
||||
Used In File(s): /code/game/objects/item/devices/radio/electropack.dm
|
||||
-->
|
||||
<div class="item">
|
||||
<div class="itemLabel">
|
||||
Power
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
{{:helper.link('On', null, {'power' : 1}, data.power ? 'selected' : null)}}
|
||||
{{:helper.link('Off', null, {'power' : 1}, data.power ? null : 'selected')}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<div class="itemLabel">
|
||||
Frequency: {{:data.freq}}
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
{{:helper.link('--', null, {'freq' : -10})}}
|
||||
{{:helper.link('-', null, {'freq' : -2})}}
|
||||
{{:helper.link('+', null, {'freq' : 2})}}
|
||||
{{:helper.link('++', null, {'freq' : 10})}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<div class="itemLabel">
|
||||
Code: {{:data.code}}
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
{{:helper.link('--', null, {'code' : -5})}}
|
||||
{{:helper.link('-', null, {'code' : -1})}}
|
||||
{{:helper.link('+', null, {'code' : 1})}}
|
||||
{{:helper.link('++', null, {'code' : 5})}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -54,6 +54,11 @@ export const RADIO_CHANNELS = [
|
||||
freq: 1213,
|
||||
color: '#a52a2a',
|
||||
},
|
||||
{
|
||||
name: 'SyndTeam',
|
||||
freq: 1244,
|
||||
color: '#a52a2a',
|
||||
},
|
||||
{
|
||||
name: 'Red Team',
|
||||
freq: 1215,
|
||||
@@ -65,8 +70,13 @@ export const RADIO_CHANNELS = [
|
||||
color: '#3434fd',
|
||||
},
|
||||
{
|
||||
name: 'CentCom',
|
||||
freq: 1337,
|
||||
name: 'Response Team',
|
||||
freq: 1345,
|
||||
color: '#2681a5',
|
||||
},
|
||||
{
|
||||
name: 'Special Ops',
|
||||
freq: 1341,
|
||||
color: '#2681a5',
|
||||
},
|
||||
{
|
||||
@@ -106,7 +116,7 @@ export const RADIO_CHANNELS = [
|
||||
},
|
||||
{
|
||||
name: 'AI Private',
|
||||
freq: 1447,
|
||||
freq: 1343,
|
||||
color: '#d65d95',
|
||||
},
|
||||
{
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
import { toFixed } from 'common/math';
|
||||
import { useBackend } from '../backend';
|
||||
import { Button, LabeledList, NumberInput, Section } from '../components';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
export const Electropack = (props, context) => {
|
||||
const { act, data } = useBackend(context);
|
||||
const {
|
||||
power,
|
||||
code,
|
||||
frequency,
|
||||
minFrequency,
|
||||
maxFrequency,
|
||||
} = data;
|
||||
return (
|
||||
<Window>
|
||||
<Window.Content>
|
||||
<Section>
|
||||
<LabeledList>
|
||||
<LabeledList.Item label="Power">
|
||||
<Button
|
||||
icon={power ? 'power-off' : 'times'}
|
||||
content={power ? 'On' : 'Off'}
|
||||
selected={power}
|
||||
onClick={() => act('power')} />
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item
|
||||
label="Frequency"
|
||||
buttons={(
|
||||
<Button
|
||||
icon="sync"
|
||||
content="Reset"
|
||||
onClick={() => act('reset', {
|
||||
reset: "freq",
|
||||
})} />
|
||||
)}>
|
||||
<NumberInput
|
||||
animate
|
||||
unit="kHz"
|
||||
step={0.2}
|
||||
stepPixelSize={6}
|
||||
minValue={minFrequency / 10}
|
||||
maxValue={maxFrequency / 10}
|
||||
value={frequency / 10}
|
||||
format={value => toFixed(value, 1)}
|
||||
width="80px"
|
||||
onChange={(e, value) => act('freq', {
|
||||
freq: value,
|
||||
})} />
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item
|
||||
label="Code"
|
||||
buttons={(
|
||||
<Button
|
||||
icon="sync"
|
||||
content="Reset"
|
||||
onClick={() => act('reset', {
|
||||
reset: "code",
|
||||
})} />
|
||||
)}>
|
||||
<NumberInput
|
||||
animate
|
||||
step={1}
|
||||
stepPixelSize={6}
|
||||
minValue={1}
|
||||
maxValue={100}
|
||||
value={code}
|
||||
width="80px"
|
||||
onChange={(e, value) => act('code', {
|
||||
code: value,
|
||||
})} />
|
||||
</LabeledList.Item>
|
||||
</LabeledList>
|
||||
</Section>
|
||||
</Window.Content>
|
||||
</Window>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,128 @@
|
||||
import { map } from 'common/collections';
|
||||
import { toFixed } from 'common/math';
|
||||
import { useBackend } from '../backend';
|
||||
import { Box, Button, Fragment, LabeledList, NumberInput, Section } from '../components';
|
||||
import { RADIO_CHANNELS } from '../constants';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
export const Radio = (props, context) => {
|
||||
const { act, data } = useBackend(context);
|
||||
const {
|
||||
freqlock,
|
||||
frequency,
|
||||
minFrequency,
|
||||
maxFrequency,
|
||||
canReset,
|
||||
listening,
|
||||
broadcasting,
|
||||
loudspeaker,
|
||||
has_loudspeaker,
|
||||
} = data;
|
||||
const tunedChannel = RADIO_CHANNELS
|
||||
.find(channel => channel.freq === frequency);
|
||||
let colorMap = [];
|
||||
let rc = [];
|
||||
let i = 0;
|
||||
for (i=0; i < RADIO_CHANNELS.length; i++) {
|
||||
rc = RADIO_CHANNELS[i];
|
||||
colorMap[rc["name"]] = rc["color"];
|
||||
}
|
||||
const channels = map((value, key) => ({
|
||||
name: key,
|
||||
status: !!value,
|
||||
}))(data.channels);
|
||||
return (
|
||||
<Window>
|
||||
<Window.Content>
|
||||
<Section>
|
||||
<LabeledList>
|
||||
<LabeledList.Item label="Frequency">
|
||||
{freqlock && (
|
||||
<Box inline color="light-gray">
|
||||
{toFixed(frequency / 10, 1) + ' kHz'}
|
||||
</Box>
|
||||
) || (
|
||||
<Fragment>
|
||||
<NumberInput
|
||||
animate
|
||||
unit="kHz"
|
||||
step={0.2}
|
||||
stepPixelSize={10}
|
||||
minValue={minFrequency / 10}
|
||||
maxValue={maxFrequency / 10}
|
||||
value={frequency / 10}
|
||||
format={value => toFixed(value, 1)}
|
||||
onChange={(e, value) => act('frequency', {
|
||||
adjust: (value - frequency / 10),
|
||||
})} />
|
||||
<Button
|
||||
icon="undo"
|
||||
content=""
|
||||
disabled={!canReset}
|
||||
tooltip="Reset"
|
||||
onClick={() => act('frequency', {
|
||||
tune: 'reset',
|
||||
})} />
|
||||
</Fragment>
|
||||
)}
|
||||
{tunedChannel && (
|
||||
<Box inline color={tunedChannel.color} ml={2}>
|
||||
[{tunedChannel.name}]
|
||||
</Box>
|
||||
)}
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Audio">
|
||||
<Button
|
||||
textAlign="center"
|
||||
width="37px"
|
||||
icon={listening ? 'volume-up' : 'volume-mute'}
|
||||
selected={listening}
|
||||
color={listening ? "" : "bad"}
|
||||
tooltip={listening ? "Disable Incoming" : "Enable Incoming"}
|
||||
onClick={() => act('listen')} />
|
||||
<Button
|
||||
textAlign="center"
|
||||
width="37px"
|
||||
icon={broadcasting ? 'microphone' : 'microphone-slash'}
|
||||
selected={broadcasting}
|
||||
tooltip={broadcasting ? "Disable Hotmic" : "Enable Hotmic"}
|
||||
onClick={() => act('broadcast')} />
|
||||
{!!has_loudspeaker && (
|
||||
<Button
|
||||
ml={1}
|
||||
icon="bullhorn"
|
||||
selected={loudspeaker}
|
||||
content="Loudspeaker"
|
||||
tooltip={
|
||||
loudspeaker ? "Disable Loudspeaker" : "Enable Loudspeaker"
|
||||
}
|
||||
onClick={() => act('loudspeaker')} />
|
||||
)}
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Channels">
|
||||
{channels.length === 0 && (
|
||||
<Box inline color="bad">
|
||||
No encryption keys installed.
|
||||
</Box>
|
||||
)}
|
||||
{channels.map(channel => (
|
||||
<Box key={channel.name}>
|
||||
<Button
|
||||
icon={channel.status ? 'check-square-o' : 'square-o'}
|
||||
selected={channel.status}
|
||||
content=""
|
||||
onClick={() => act('channel', {
|
||||
channel: channel.name,
|
||||
})} />
|
||||
<Box inline color={colorMap[channel.name]}>
|
||||
{channel.name}
|
||||
</Box>
|
||||
</Box>
|
||||
))}
|
||||
</LabeledList.Item>
|
||||
</LabeledList>
|
||||
</Section>
|
||||
</Window.Content>
|
||||
</Window>
|
||||
);
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user