mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Merge pull request #7494 from VOREStation/upstream-merge-6990
[MIRROR] Refactor telecomms and consoles to operate on logical zlevels
This commit is contained in:
@@ -32,7 +32,7 @@
|
|||||||
title = "Security Announcement"
|
title = "Security Announcement"
|
||||||
announcement_type = "Security Announcement"
|
announcement_type = "Security Announcement"
|
||||||
|
|
||||||
/datum/announcement/proc/Announce(var/message as text, var/new_title = "", var/new_sound = null, var/do_newscast = newscast, var/msg_sanitized = 0, zlevel)
|
/datum/announcement/proc/Announce(var/message as text, var/new_title = "", var/new_sound = null, var/do_newscast = newscast, var/msg_sanitized = 0, var/zlevel)
|
||||||
if(!message)
|
if(!message)
|
||||||
return
|
return
|
||||||
var/message_title = new_title ? new_title : title
|
var/message_title = new_title ? new_title : title
|
||||||
@@ -52,11 +52,38 @@
|
|||||||
Sound(message_sound, zlevels)
|
Sound(message_sound, zlevels)
|
||||||
Log(message, message_title)
|
Log(message, message_title)
|
||||||
|
|
||||||
datum/announcement/proc/Message(var/message as text, var/message_title as text, var/list/zlevels)
|
datum/announcement/proc/Message(message as text, message_title as text, var/list/zlevels)
|
||||||
global_announcer.autosay("<span class='alert'>[message_title]:</span> [message]", announcer ? announcer : ANNOUNCER_NAME, zlevels)
|
for(var/mob/M in player_list)
|
||||||
|
if(!istype(M,/mob/new_player) && !isdeaf(M))
|
||||||
|
to_chat(M, "<h2 class='alert'>[title]</h2>")
|
||||||
|
to_chat(M, "<span class='alert'>[message]</span>")
|
||||||
|
if (announcer)
|
||||||
|
to_chat(M, "<span class='alert'> -[html_encode(announcer)]</span>")
|
||||||
|
|
||||||
datum/announcement/minor/Message(var/message as text, var/message_title as text, var/list/zlevels)
|
// You'll need to update these to_world usages if you want to make these z-level specific ~Aro
|
||||||
global_announcer.autosay(message, announcer ? announcer : ANNOUNCER_NAME, zlevels)
|
datum/announcement/minor/Message(message as text, message_title as text)
|
||||||
|
to_world("<b>[message]</b>")
|
||||||
|
|
||||||
|
datum/announcement/priority/Message(message as text, message_title as text)
|
||||||
|
to_world("<h1 class='alert'>[message_title]</h1>")
|
||||||
|
to_world("<span class='alert'>[message]</span>")
|
||||||
|
if(announcer)
|
||||||
|
to_world("<span class='alert'> -[html_encode(announcer)]</span>")
|
||||||
|
to_world("<br>")
|
||||||
|
|
||||||
|
datum/announcement/priority/command/Message(message as text, message_title as text, var/list/zlevels)
|
||||||
|
var/command
|
||||||
|
command += "<h1 class='alert'>[command_name()] Update</h1>"
|
||||||
|
if (message_title)
|
||||||
|
command += "<br><h2 class='alert'>[message_title]</h2>"
|
||||||
|
|
||||||
|
command += "<br><span class='alert'>[message]</span><br>"
|
||||||
|
command += "<br>"
|
||||||
|
for(var/mob/M in player_list)
|
||||||
|
if(zlevels && !(get_z(M) in zlevels))
|
||||||
|
continue
|
||||||
|
if(!istype(M,/mob/new_player) && !isdeaf(M))
|
||||||
|
to_chat(M, command)
|
||||||
|
|
||||||
datum/announcement/priority/Message(var/message as text, var/message_title as text, var/list/zlevels)
|
datum/announcement/priority/Message(var/message as text, var/message_title as text, var/list/zlevels)
|
||||||
global_announcer.autosay("<span class='alert'>[message_title]:</span> [message]", announcer ? announcer : ANNOUNCER_NAME, zlevels)
|
global_announcer.autosay("<span class='alert'>[message_title]:</span> [message]", announcer ? announcer : ANNOUNCER_NAME, zlevels)
|
||||||
|
|||||||
@@ -88,7 +88,6 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
|
|||||||
signal.data["compression"], signal.data["level"], signal.frequency,
|
signal.data["compression"], signal.data["level"], signal.frequency,
|
||||||
signal.data["verb"], forced_radios)
|
signal.data["verb"], forced_radios)
|
||||||
|
|
||||||
|
|
||||||
/** #### - Simple Broadcast - #### **/
|
/** #### - Simple Broadcast - #### **/
|
||||||
|
|
||||||
if(signal.data["type"] == SIGNAL_SIMPLE)
|
if(signal.data["type"] == SIGNAL_SIMPLE)
|
||||||
@@ -346,7 +345,6 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
|
|||||||
var/data, var/compression, var/list/level, var/freq, var/verbage = "says",
|
var/data, var/compression, var/list/level, var/freq, var/verbage = "says",
|
||||||
var/list/forced_radios)
|
var/list/forced_radios)
|
||||||
|
|
||||||
|
|
||||||
/* ###### Prepare the radio connection ###### */
|
/* ###### Prepare the radio connection ###### */
|
||||||
|
|
||||||
var/display_freq = freq
|
var/display_freq = freq
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ var/global/list/default_medbay_channels = list(
|
|||||||
/obj/item/device/radio/proc/autosay(var/message, var/from, var/channel, var/list/zlevels) //BS12 EDIT
|
/obj/item/device/radio/proc/autosay(var/message, var/from, var/channel, var/list/zlevels) //BS12 EDIT
|
||||||
var/datum/radio_frequency/connection = null
|
var/datum/radio_frequency/connection = null
|
||||||
if(channel && channels && channels.len > 0)
|
if(channel && channels && channels.len > 0)
|
||||||
if (channel == "department")
|
if(channel == "department")
|
||||||
channel = channels[1]
|
channel = channels[1]
|
||||||
connection = secure_radio_connections[channel]
|
connection = secure_radio_connections[channel]
|
||||||
else
|
else
|
||||||
@@ -304,7 +304,7 @@ var/global/list/default_medbay_channels = list(
|
|||||||
Broadcast_Message(connection, A,
|
Broadcast_Message(connection, A,
|
||||||
0, "*garbled automated announcement*", src,
|
0, "*garbled automated announcement*", src,
|
||||||
message_to_multilingual(message), from, "Automated Announcement", from, "synthesized voice",
|
message_to_multilingual(message), from, "Automated Announcement", from, "synthesized voice",
|
||||||
4, 0, zlevels, connection.frequency, "states")
|
DATA_FAKE, 0, zlevels, connection.frequency, "states")
|
||||||
|
|
||||||
// Interprets the message mode when talking into a radio, possibly returning a connection datum
|
// Interprets the message mode when talking into a radio, possibly returning a connection datum
|
||||||
/obj/item/device/radio/proc/handle_message_mode(mob/living/M as mob, list/message_pieces, message_mode)
|
/obj/item/device/radio/proc/handle_message_mode(mob/living/M as mob, list/message_pieces, message_mode)
|
||||||
@@ -363,8 +363,8 @@ var/global/list/default_medbay_channels = list(
|
|||||||
if(!istype(message_mode, /datum/radio_frequency))
|
if(!istype(message_mode, /datum/radio_frequency))
|
||||||
return FALSE
|
return FALSE
|
||||||
|
|
||||||
var/datum/radio_frequency/connection = message_mode
|
|
||||||
var/pos_z = get_z(src)
|
var/pos_z = get_z(src)
|
||||||
|
var/datum/radio_frequency/connection = message_mode
|
||||||
|
|
||||||
//#### Tagging the signal with all appropriate identity values ####//
|
//#### Tagging the signal with all appropriate identity values ####//
|
||||||
|
|
||||||
@@ -479,7 +479,6 @@ var/global/list/default_medbay_channels = list(
|
|||||||
signal.transmission_method = TRANSMISSION_SUBSPACE
|
signal.transmission_method = TRANSMISSION_SUBSPACE
|
||||||
|
|
||||||
//#### Sending the signal to all subspace receivers ####//
|
//#### Sending the signal to all subspace receivers ####//
|
||||||
|
|
||||||
for(var/obj/machinery/telecomms/receiver/R in telecomms_list)
|
for(var/obj/machinery/telecomms/receiver/R in telecomms_list)
|
||||||
R.receive_signal(signal)
|
R.receive_signal(signal)
|
||||||
|
|
||||||
@@ -494,7 +493,7 @@ var/global/list/default_medbay_channels = list(
|
|||||||
else if(adhoc_fallback) //Less huzzah, we have to fallback
|
else if(adhoc_fallback) //Less huzzah, we have to fallback
|
||||||
to_chat(loc, "<span class='warning'>\The [src] pings as it falls back to local radio transmission.</span>")
|
to_chat(loc, "<span class='warning'>\The [src] pings as it falls back to local radio transmission.</span>")
|
||||||
subspace_transmission = FALSE
|
subspace_transmission = FALSE
|
||||||
|
|
||||||
else //Oh well
|
else //Oh well
|
||||||
return FALSE
|
return FALSE
|
||||||
|
|
||||||
@@ -536,8 +535,6 @@ var/global/list/default_medbay_channels = list(
|
|||||||
if(get_dist(src, M) <= canhear_range)
|
if(get_dist(src, M) <= canhear_range)
|
||||||
talk_into(M, message_pieces, null, verb)
|
talk_into(M, message_pieces, null, verb)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/obj/item/device/radio/proc/receive_range(freq, level)
|
/obj/item/device/radio/proc/receive_range(freq, level)
|
||||||
// check if this radio can receive on the given frequency, and if so,
|
// check if this radio can receive on the given frequency, and if so,
|
||||||
// what the range is in which mobs will hear the radio
|
// what the range is in which mobs will hear the radio
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
var/list/major_alarms = new()
|
var/list/major_alarms = new()
|
||||||
var/list/map_levels = using_map.get_map_levels(z)
|
var/list/map_levels = using_map.get_map_levels(z)
|
||||||
for(var/datum/alarm/A in visible_alarms())
|
for(var/datum/alarm/A in visible_alarms())
|
||||||
if(z && (z && !(A.origin?.z in map_levels)))
|
if(z && !(A.origin?.z in map_levels))
|
||||||
continue
|
continue
|
||||||
if(A.max_severity() > 1)
|
if(A.max_severity() > 1)
|
||||||
major_alarms.Add(A)
|
major_alarms.Add(A)
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
var/list/minor_alarms = new()
|
var/list/minor_alarms = new()
|
||||||
var/list/map_levels = using_map.get_map_levels(z)
|
var/list/map_levels = using_map.get_map_levels(z)
|
||||||
for(var/datum/alarm/A in visible_alarms())
|
for(var/datum/alarm/A in visible_alarms())
|
||||||
if(z && (z && !(A.origin?.z in map_levels)))
|
if(z && !(A.origin?.z in map_levels))
|
||||||
continue
|
continue
|
||||||
if(A.max_severity() == 1)
|
if(A.max_severity() == 1)
|
||||||
minor_alarms.Add(A)
|
minor_alarms.Add(A)
|
||||||
|
|||||||
@@ -377,7 +377,7 @@
|
|||||||
|
|
||||||
var/turf/T = join_props["turf"]
|
var/turf/T = join_props["turf"]
|
||||||
var/join_message = join_props["msg"]
|
var/join_message = join_props["msg"]
|
||||||
var/announce_channel = join_props["channel"] || "Common" // VOREStation Add
|
var/announce_channel = join_props["channel"] || "Common"
|
||||||
|
|
||||||
if(!T || !join_message)
|
if(!T || !join_message)
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
to_chat(user, "<span class='warning'>The crew monitor doesn't seem like it'll work here.</span>")
|
to_chat(user, "<span class='warning'>The crew monitor doesn't seem like it'll work here.</span>")
|
||||||
if(program)
|
if(program)
|
||||||
program.kill_program()
|
program.kill_program()
|
||||||
else if(ui)
|
if(ui)
|
||||||
ui.close()
|
ui.close()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 103 KiB |
Reference in New Issue
Block a user