mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 06:00:16 +01:00
Telecomms Update: Ability to change existing radio channels and create new ones (#91647)
## About The Pull Request I have added the ability to create and edit station radio channels through the existing telecommunications system. You can change the name of the radio channel and its color. The channel settings are changed and created through the servers (Frequencies Settings)  Here i created my own channel: 1) Add frequency at Receiver (you will not see channel name):  2) Add frequency at Bus (you will not see channel name):  3) Add frequency at Server 4) Add settings for your frequency  5) See the result:  Important Notes: 1) Headsets, radios, and intercoms will not see a change in telecommunications, but will use standard names (Common, Security etc.). 2) There are still reserved names that cannot be used: CentComm, Syndicate, Uplink, CTFs channels 3) Servers must filter frequency for applying settings on them ## Why It's Good For The Game Now telecommunication channels names and colors depends on the settings of the network servers, which makes it more flexible and logical. It is also useful for foreign language servers, as you can translate channel names. ## Changelog 🆑 add: Added ability to change existing radio channels and create new qol: Added color for some buttons in Telecomms UI /🆑
This commit is contained in:
@@ -62,7 +62,7 @@ GLOBAL_LIST_INIT(channel_tokens, list(
|
||||
for(var/i in 1 to length(channels))
|
||||
var/channel_name = channels[i]
|
||||
var/channel_token = GLOB.channel_tokens[channel_name]
|
||||
var/channel_span_class = get_radio_span(GLOB.radiochannels[channel_name])
|
||||
var/channel_span_class = get_radio_span(GLOB.default_radio_channels[channel_name])
|
||||
|
||||
if(i == 1)
|
||||
available_channels += "<li><b>[span_class(channel_span_class, MODE_TOKEN_DEPARTMENT)]</b> or <b>[span_class(channel_span_class, channel_token)]</b> for <b>[span_class(channel_span_class, channel_name)]</b></li>"
|
||||
@@ -450,7 +450,7 @@ GLOBAL_LIST_INIT(channel_tokens, list(
|
||||
/obj/item/radio/headset/screwdriver_act(mob/living/user, obj/item/tool)
|
||||
if(keyslot || keyslot2)
|
||||
for(var/ch_name in channels)
|
||||
SSradio.remove_object(src, GLOB.radiochannels[ch_name])
|
||||
SSradio.remove_object(src, GLOB.default_radio_channels[ch_name])
|
||||
secure_radio_connections[ch_name] = null
|
||||
|
||||
if(keyslot)
|
||||
@@ -499,7 +499,7 @@ GLOBAL_LIST_INIT(channel_tokens, list(
|
||||
special_channels |= keyslot2.special_channels
|
||||
|
||||
for(var/ch_name in channels)
|
||||
secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
|
||||
secure_radio_connections[ch_name] = add_radio(src, GLOB.default_radio_channels[ch_name])
|
||||
|
||||
// Updates radio languages entirely for the mob wearing the headset
|
||||
var/mob/mob_loc = loc
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
|
||||
return TRUE
|
||||
|
||||
/obj/item/radio/intercom/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, list/spans, list/message_mods = list(), message_range)
|
||||
/obj/item/radio/intercom/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, radio_freq_name, radio_freq_color, list/spans, list/message_mods = list(), message_range)
|
||||
if(message_mods[RADIO_EXTENSION] == MODE_INTERCOM)
|
||||
return // Avoid hearing the same thing twice
|
||||
return ..()
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
if(ispath(keyslot))
|
||||
keyslot = new keyslot()
|
||||
for(var/ch_name in channels)
|
||||
secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
|
||||
secure_radio_connections[ch_name] = add_radio(src, GLOB.default_radio_channels[ch_name])
|
||||
|
||||
perform_update_icon = FALSE
|
||||
set_listening(listening)
|
||||
@@ -155,7 +155,7 @@
|
||||
special_channels = keyslot.special_channels
|
||||
|
||||
for(var/channel_name in channels)
|
||||
secure_radio_connections[channel_name] = add_radio(src, GLOB.radiochannels[channel_name])
|
||||
secure_radio_connections[channel_name] = add_radio(src, GLOB.default_radio_channels[channel_name])
|
||||
|
||||
if(!listening)
|
||||
remove_radio_all(src)
|
||||
@@ -169,7 +169,7 @@
|
||||
///goes through all radio channels we should be listening for and readds them to the global list
|
||||
/obj/item/radio/proc/readd_listening_radio_channels()
|
||||
for(var/channel_name in channels)
|
||||
add_radio(src, GLOB.radiochannels[channel_name])
|
||||
add_radio(src, GLOB.default_radio_channels[channel_name])
|
||||
|
||||
add_radio(src, frequency)
|
||||
|
||||
@@ -381,7 +381,7 @@
|
||||
signal.levels = SSmapping.get_connected_levels(T)
|
||||
signal.broadcast()
|
||||
|
||||
/obj/item/radio/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, list/message_mods = list(), message_range)
|
||||
/obj/item/radio/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, radio_freq_name, radio_freq_color, list/spans, list/message_mods = list(), message_range)
|
||||
. = ..()
|
||||
if(radio_freq || !broadcasting || get_dist(src, speaker) > canhear_range || message_mods[MODE_RELAY])
|
||||
return
|
||||
@@ -422,7 +422,7 @@
|
||||
return TRUE
|
||||
for(var/ch_name in channels)
|
||||
if(channels[ch_name] & FREQ_LISTENING)
|
||||
if(GLOB.radiochannels[ch_name] == text2num(input_frequency) || special_channels & RADIO_SPECIAL_SYNDIE)
|
||||
if(GLOB.default_radio_channels[ch_name] == text2num(input_frequency) || special_channels & RADIO_SPECIAL_SYNDIE)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
@@ -635,7 +635,7 @@
|
||||
return
|
||||
|
||||
for(var/ch_name in channels)
|
||||
SSradio.remove_object(src, GLOB.radiochannels[ch_name])
|
||||
SSradio.remove_object(src, GLOB.default_radio_channels[ch_name])
|
||||
secure_radio_connections[ch_name] = null
|
||||
|
||||
if (!user.put_in_hands(keyslot))
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/taperecorder/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, spans, list/message_mods = list(), message_range)
|
||||
/obj/item/taperecorder/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, radio_freq_name, radio_freq_color, spans, list/message_mods = list(), message_range)
|
||||
. = ..()
|
||||
if(message_mods[MODE_RELAY] || !mytape || istype(speaker, /obj/item/taperecorder))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user