mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 07:08:00 +01:00
[MIRROR] Fixes security level alerts playing the incorrect sounds [MDB IGNORE] (#15116)
* Fixes security level alerts playing the incorrect sounds * Fixes the merge conflict * Slightly improves the code on our end, adds the documentation that we were now missing Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
This commit is contained in:
co-authored by
MrMelbert
GoldenAlpharex
parent
282113a198
commit
ca20cbb5a1
@@ -95,7 +95,19 @@
|
||||
|
||||
SScommunications.send_message(M)
|
||||
|
||||
/proc/minor_announce(message, title = "Attention:", alert, html_encode = TRUE, list/players)
|
||||
/**
|
||||
* Sends a minor annoucement to players.
|
||||
* Minor announcements are large text, with the title in red and message in white.
|
||||
* Only mobs that can hear can see the announcements.
|
||||
*
|
||||
* message - the message contents of the announcement.
|
||||
* title - the title of the announcement, which is often "who sent it".
|
||||
* alert - whether this announcement is an alert, or just a notice. Only changes the sound that is played by default.
|
||||
* html_encode - if TRUE, we will html encode our title and message before sending it, to prevent player input abuse.
|
||||
* players - optional, a list mobs to send the announcement to. If unset, sends to all palyers.
|
||||
* sound_override - optional, use the passed sound file instead of the default notice sounds.
|
||||
*/
|
||||
/proc/minor_announce(message, title = "Attention:", alert, html_encode = TRUE, list/players, sound_override)
|
||||
if(!message)
|
||||
return
|
||||
|
||||
@@ -107,11 +119,13 @@
|
||||
players = GLOB.player_list
|
||||
|
||||
for(var/mob/target in players)
|
||||
if(!isnewplayer(target) && target.can_hear())
|
||||
to_chat(target, "[span_minorannounce("<font color = red>[title]</font color><BR>[message]")]<BR>")
|
||||
if(target.client.prefs.toggles & SOUND_ANNOUNCEMENTS)
|
||||
if(alert)
|
||||
SEND_SOUND(target, sound('sound/misc/notice1.ogg'))
|
||||
else
|
||||
SEND_SOUND(M, sound('sound/misc/notice2.ogg'))
|
||||
*/
|
||||
if(isnewplayer(target))
|
||||
continue
|
||||
if(!target.can_hear())
|
||||
continue
|
||||
|
||||
to_chat(target, "[span_minorannounce("<font color = red>[title]</font color><BR>[message]")]<BR>")
|
||||
if(target.client?.prefs.toggles & SOUND_ANNOUNCEMENTS)
|
||||
var/sound_to_play = sound_override || (alert ? 'sound/misc/notice1.ogg' : 'sound/misc/notice2.ogg')
|
||||
SEND_SOUND(target, sound(sound_to_play))
|
||||
*/ // SKYRAT EDIT REMOVAL END
|
||||
|
||||
@@ -68,11 +68,9 @@ SUBSYSTEM_DEF(security_level)
|
||||
*/
|
||||
/datum/controller/subsystem/security_level/proc/announce_security_level(datum/security_level/selected_level)
|
||||
if(selected_level.number_level > current_security_level.number_level) // We are elevating to this level.
|
||||
minor_announce(selected_level.elevating_to_announcemnt, "Attention! Security level elevated to [selected_level.name]:")
|
||||
minor_announce(selected_level.elevating_to_announcemnt, "Attention! Security level elevated to [selected_level.name]:", sound_override = selected_level.sound)
|
||||
else // Going down
|
||||
minor_announce(selected_level.lowering_to_announcement, "Attention! Security level lowered to [selected_level.name]:")
|
||||
if(selected_level.sound)
|
||||
sound_to_playing_players(selected_level.sound)
|
||||
minor_announce(selected_level.lowering_to_announcement, "Attention! Security level lowered to [selected_level.name]:", sound_override = selected_level.sound)
|
||||
|
||||
/**
|
||||
* Returns the current security level as a number
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
*/
|
||||
/datum/security_level/green
|
||||
name = "green"
|
||||
sound = 'sound/misc/notice2.ogg' // Friendly beep
|
||||
number_level = SEC_LEVEL_GREEN
|
||||
lowering_to_configuration_key = /datum/config_entry/string/alert_green
|
||||
shuttle_call_time_mod = 2
|
||||
@@ -53,6 +54,7 @@
|
||||
*/
|
||||
/datum/security_level/blue
|
||||
name = "blue"
|
||||
sound = 'sound/misc/notice1.ogg' // Angry alarm
|
||||
number_level = SEC_LEVEL_BLUE
|
||||
lowering_to_configuration_key = /datum/config_entry/string/alert_blue_downto
|
||||
elevating_to_configuration_key = /datum/config_entry/string/alert_blue_upto
|
||||
@@ -65,6 +67,7 @@
|
||||
*/
|
||||
/datum/security_level/red
|
||||
name = "red"
|
||||
sound = 'sound/misc/notice1.ogg' // The same angry alarm
|
||||
number_level = SEC_LEVEL_RED
|
||||
lowering_to_configuration_key = /datum/config_entry/string/alert_red_downto
|
||||
elevating_to_configuration_key = /datum/config_entry/string/alert_red_upto
|
||||
@@ -77,6 +80,7 @@
|
||||
*/
|
||||
/datum/security_level/delta
|
||||
name = "delta"
|
||||
sound = 'sound/misc/notice1.ogg' // The same angry alarm, again
|
||||
number_level = SEC_LEVEL_DELTA
|
||||
elevating_to_configuration_key = /datum/config_entry/string/alert_delta
|
||||
shuttle_call_time_mod = 0.25
|
||||
|
||||
@@ -66,8 +66,19 @@
|
||||
|
||||
SScommunications.send_message(M)
|
||||
|
||||
///This proc sends an announcement to all currently playing mobs. Use alert to send a more ominious BEEP. Generally used for updating people on minor things, such as CME locaiton. Use priority_announce for large announcements.
|
||||
/proc/minor_announce(message, title = "Attention:", alert, html_encode = TRUE, list/players, sound, override_volume = FALSE)
|
||||
/**
|
||||
* Sends a minor annoucement to players.
|
||||
* Minor announcements are large text, with the title in red and message in white.
|
||||
* Only mobs that can hear can see the announcements.
|
||||
*
|
||||
* message - the message contents of the announcement.
|
||||
* title - the title of the announcement, which is often "who sent it".
|
||||
* alert - whether this announcement is an alert, or just a notice. Only changes the sound that is played by default.
|
||||
* html_encode - if TRUE, we will html encode our title and message before sending it, to prevent player input abuse.
|
||||
* players - optional, a list mobs to send the announcement to. If unset, sends to all palyers.
|
||||
* sound_override - optional, use the passed sound file instead of the default notice sounds. We're not currently using those on Skyrat, since we use our own sounds.
|
||||
*/
|
||||
/proc/minor_announce(message, title = "Attention:", alert, html_encode = TRUE, list/players, sound_override, sound, override_volume = FALSE)
|
||||
if(!message)
|
||||
return
|
||||
|
||||
@@ -78,9 +89,13 @@
|
||||
if(!players)
|
||||
players = GLOB.player_list
|
||||
|
||||
for(var/mob/M in players)
|
||||
if(!isnewplayer(M) && M.can_hear())
|
||||
to_chat(M, span_minorannounce("<font color = red>[title]</font color><BR>[message]</span><BR>"))
|
||||
for(var/mob/target in players)
|
||||
if(isnewplayer(target))
|
||||
continue
|
||||
if(!target.can_hear())
|
||||
continue
|
||||
|
||||
to_chat(target, "[span_minorannounce("<font color = red>[title]</font color><BR>[message]")]<BR>")
|
||||
|
||||
if(sound)
|
||||
if(SSstation.announcer.event_sounds[sound])
|
||||
|
||||
Reference in New Issue
Block a user