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"
|
||||
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)
|
||||
return
|
||||
var/message_title = new_title ? new_title : title
|
||||
@@ -52,11 +52,38 @@
|
||||
Sound(message_sound, zlevels)
|
||||
Log(message, message_title)
|
||||
|
||||
datum/announcement/proc/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)
|
||||
datum/announcement/proc/Message(message as text, message_title as text, var/list/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)
|
||||
global_announcer.autosay(message, announcer ? announcer : ANNOUNCER_NAME, zlevels)
|
||||
// You'll need to update these to_world usages if you want to make these z-level specific ~Aro
|
||||
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)
|
||||
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["verb"], forced_radios)
|
||||
|
||||
|
||||
/** #### - Simple Broadcast - #### **/
|
||||
|
||||
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/list/forced_radios)
|
||||
|
||||
|
||||
/* ###### Prepare the radio connection ###### */
|
||||
|
||||
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
|
||||
var/datum/radio_frequency/connection = null
|
||||
if(channel && channels && channels.len > 0)
|
||||
if (channel == "department")
|
||||
if(channel == "department")
|
||||
channel = channels[1]
|
||||
connection = secure_radio_connections[channel]
|
||||
else
|
||||
@@ -304,7 +304,7 @@ var/global/list/default_medbay_channels = list(
|
||||
Broadcast_Message(connection, A,
|
||||
0, "*garbled automated announcement*", src,
|
||||
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
|
||||
/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))
|
||||
return FALSE
|
||||
|
||||
var/datum/radio_frequency/connection = message_mode
|
||||
var/pos_z = get_z(src)
|
||||
var/datum/radio_frequency/connection = message_mode
|
||||
|
||||
//#### Tagging the signal with all appropriate identity values ####//
|
||||
|
||||
@@ -479,7 +479,6 @@ var/global/list/default_medbay_channels = list(
|
||||
signal.transmission_method = TRANSMISSION_SUBSPACE
|
||||
|
||||
//#### Sending the signal to all subspace receivers ####//
|
||||
|
||||
for(var/obj/machinery/telecomms/receiver/R in telecomms_list)
|
||||
R.receive_signal(signal)
|
||||
|
||||
@@ -536,8 +535,6 @@ var/global/list/default_medbay_channels = list(
|
||||
if(get_dist(src, M) <= canhear_range)
|
||||
talk_into(M, message_pieces, null, verb)
|
||||
|
||||
|
||||
|
||||
/obj/item/device/radio/proc/receive_range(freq, level)
|
||||
// check if this radio can receive on the given frequency, and if so,
|
||||
// what the range is in which mobs will hear the radio
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
var/list/major_alarms = new()
|
||||
var/list/map_levels = using_map.get_map_levels(z)
|
||||
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
|
||||
if(A.max_severity() > 1)
|
||||
major_alarms.Add(A)
|
||||
@@ -15,7 +15,7 @@
|
||||
var/list/minor_alarms = new()
|
||||
var/list/map_levels = using_map.get_map_levels(z)
|
||||
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
|
||||
if(A.max_severity() == 1)
|
||||
minor_alarms.Add(A)
|
||||
|
||||
@@ -377,7 +377,7 @@
|
||||
|
||||
var/turf/T = join_props["turf"]
|
||||
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)
|
||||
return 0
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
to_chat(user, "<span class='warning'>The crew monitor doesn't seem like it'll work here.</span>")
|
||||
if(program)
|
||||
program.kill_program()
|
||||
else if(ui)
|
||||
if(ui)
|
||||
ui.close()
|
||||
return
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 103 KiB |
Reference in New Issue
Block a user