From c254efbcdfe6f3cdf748fd5484847f25be464cb9 Mon Sep 17 00:00:00 2001 From: warriorstar-orion Date: Fri, 21 Oct 2022 13:59:36 -0400 Subject: [PATCH] Remove unused newscast ability from announcements. (#19442) * Remove unused newscast ability from announcements. * Switch from 0/1 to FALSE/TRUE in modified code. --- code/defines/procs/announce.dm | 57 +++++++------------ code/game/jobs/job/supervisor.dm | 2 +- .../game/machinery/computer/communications.dm | 1 - code/game/machinery/requests_console.dm | 1 - code/modules/mob/living/silicon/ai/ai.dm | 1 - .../security_levels/security_levels.dm | 4 +- 6 files changed, 23 insertions(+), 43 deletions(-) diff --git a/code/defines/procs/announce.dm b/code/defines/procs/announce.dm index 301ed685d46..f1775c155b6 100644 --- a/code/defines/procs/announce.dm +++ b/code/defines/procs/announce.dm @@ -1,50 +1,48 @@ GLOBAL_DATUM_INIT(minor_announcement, /datum/announcement/minor, new()) -GLOBAL_DATUM_INIT(priority_announcement, /datum/announcement/priority, new(do_log = 0)) -GLOBAL_DATUM_INIT(command_announcement, /datum/announcement/priority/command, new(do_log = 0, do_newscast = 0)) -GLOBAL_DATUM_INIT(event_announcement, /datum/announcement/priority/command/event, new(do_log = 0, do_newscast = 0)) +GLOBAL_DATUM_INIT(priority_announcement, /datum/announcement/priority, new(do_log = FALSE)) +GLOBAL_DATUM_INIT(command_announcement, /datum/announcement/priority/command, new(do_log = FALSE)) +GLOBAL_DATUM_INIT(event_announcement, /datum/announcement/priority/command/event, new(do_log = FALSE)) /datum/announcement var/title = "Attention" var/announcer = "" - var/log = 0 + var/log = FALSE var/sound - var/newscast = 0 var/channel_name = "Station Announcements" var/announcement_type = "Announcement" - var/admin_announcement = 0 // Admin announcements are received regardless of being in range of a radio, unless you're in the lobby to prevent metagaming + var/admin_announcement = FALSE // Admin announcements are received regardless of being in range of a radio, unless you're in the lobby to prevent metagaming var/language = "Galactic Common" -/datum/announcement/New(do_log = 0, new_sound = null, do_newscast = 0) +/datum/announcement/New(do_log = FALSE, new_sound = null) sound = new_sound log = do_log - newscast = do_newscast -/datum/announcement/minor/New(do_log = 0, new_sound = sound('sound/misc/notice2.ogg'), do_newscast = 0) - ..(do_log, new_sound, do_newscast) +/datum/announcement/minor/New(do_log = FALSE, new_sound = sound('sound/misc/notice2.ogg')) + ..(do_log, new_sound) title = "Attention" announcement_type = "Minor Announcement" -/datum/announcement/priority/New(do_log = 1, new_sound = sound('sound/misc/notice2.ogg'), do_newscast = 0) - ..(do_log, new_sound, do_newscast) +/datum/announcement/priority/New(do_log = TRUE, new_sound = sound('sound/misc/notice2.ogg')) + ..(do_log, new_sound) title = "Priority Announcement" announcement_type = "Priority Announcement" -/datum/announcement/priority/command/New(do_log = 1, new_sound = sound('sound/misc/notice2.ogg'), do_newscast = 0) - ..(do_log, new_sound, do_newscast) - admin_announcement = 1 +/datum/announcement/priority/command/New(do_log = TRUE, new_sound = sound('sound/misc/notice2.ogg')) + ..(do_log, new_sound) + admin_announcement = TRUE title = "NAS Trurl Update" announcement_type = "NAS Trurl Update" -/datum/announcement/priority/command/event/New(do_log = 1, new_sound = sound('sound/misc/notice2.ogg'), do_newscast = 0) - ..(do_log, new_sound, do_newscast) - admin_announcement = 0 +/datum/announcement/priority/command/event/New(do_log = TRUE, new_sound = sound('sound/misc/notice2.ogg')) + ..(do_log, new_sound) + admin_announcement = FALSE -/datum/announcement/priority/security/New(do_log = 1, new_sound = sound('sound/misc/notice2.ogg'), do_newscast = 0) - ..(do_log, new_sound, do_newscast) +/datum/announcement/priority/security/New(do_log = TRUE, new_sound = sound('sound/misc/notice2.ogg')) + ..(do_log, new_sound) title = "Security Announcement" announcement_type = "Security Announcement" -/datum/announcement/proc/Announce(message as text, new_title = "", new_sound = null, do_newscast = newscast, msg_sanitized = 0, from, msg_language, new_sound2 = null) +/datum/announcement/proc/Announce(message as text, new_title = "", new_sound = null, msg_sanitized = FALSE, from, msg_language, new_sound2 = null) if(!message) return @@ -53,7 +51,7 @@ GLOBAL_DATUM_INIT(event_announcement, /datum/announcement/priority/command/event var/message_sound2 = new_sound2 ? sound(new_sound2) : sound if(!msg_sanitized) - message = trim_strip_html_properly(message, allow_lines = 1) + message = trim_strip_html_properly(message, allow_lines = TRUE) message_title = html_encode(message_title) var/message_announcer = null @@ -71,9 +69,6 @@ GLOBAL_DATUM_INIT(event_announcement, /datum/announcement/priority/command/event Message(formatted_message, garbled_formatted_message, receivers, garbled_receivers) - if(do_newscast) - NewsCast(message, message_title) - Sound(message_sound, combined_receivers[1] + combined_receivers[2]) Sound(message_sound2, combined_receivers[1] + combined_receivers[2]) Log(message, message_title) @@ -151,18 +146,6 @@ GLOBAL_DATUM_INIT(event_announcement, /datum/announcement/priority/command/event return formatted_message -/datum/announcement/proc/NewsCast(message as text, message_title as text) - if(!newscast) - return - - var/datum/news_announcement/news = new - news.channel_name = channel_name - news.author = announcer - news.message = message - news.message_type = announcement_type - news.can_be_redacted = 0 - announce_newscaster_news(news) - /datum/announcement/proc/Sound(message_sound, receivers) if(!message_sound) return diff --git a/code/game/jobs/job/supervisor.dm b/code/game/jobs/job/supervisor.dm index e3b10fae422..3b4885c4681 100644 --- a/code/game/jobs/job/supervisor.dm +++ b/code/game/jobs/job/supervisor.dm @@ -1,4 +1,4 @@ -GLOBAL_DATUM_INIT(captain_announcement, /datum/announcement/minor, new(do_newscast = 0)) // Why the hell are captain announcements minor +GLOBAL_DATUM_INIT(captain_announcement, /datum/announcement/minor, new()) // Why the hell are captain announcements minor /datum/job/captain title = "Captain" flag = JOB_CAPTAIN diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 5c493bf4506..0afa278c673 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -46,7 +46,6 @@ /obj/machinery/computer/communications/Initialize(mapload) . = ..() - crew_announcement.newscast = 0 /obj/machinery/computer/communications/proc/is_authenticated(mob/user, message = 1) if(user.can_admin_interact()) diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm index 80e15d74d3d..0fcf5aa73cb 100644 --- a/code/game/machinery/requests_console.dm +++ b/code/game/machinery/requests_console.dm @@ -107,7 +107,6 @@ GLOBAL_LIST_EMPTY(allRequestConsoles) . = ..() announcement.title = "[department] announcement" - announcement.newscast = FALSE name = "[department] Requests Console" GLOB.allRequestConsoles += src diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index e9bd2265a5e..2aa7282fe3d 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -130,7 +130,6 @@ GLOBAL_LIST_INIT(ai_verbs_default, list( announcement.title = "A.I. Announcement" announcement.announcement_type = "A.I. Announcement" announcement.announcer = name - announcement.newscast = 0 var/list/possibleNames = GLOB.ai_names diff --git a/code/modules/security_levels/security_levels.dm b/code/modules/security_levels/security_levels.dm index c93730be2ce..74faa0baa58 100644 --- a/code/modules/security_levels/security_levels.dm +++ b/code/modules/security_levels/security_levels.dm @@ -7,8 +7,8 @@ GLOBAL_VAR_INIT(security_level, 0) //5 = code delta //config.alert_desc_blue_downto -GLOBAL_DATUM_INIT(security_announcement_up, /datum/announcement/priority/security, new(do_log = 0, do_newscast = 0, new_sound = sound('sound/misc/notice1.ogg'))) -GLOBAL_DATUM_INIT(security_announcement_down, /datum/announcement/priority/security, new(do_log = 0, do_newscast = 0)) +GLOBAL_DATUM_INIT(security_announcement_up, /datum/announcement/priority/security, new(do_log = FALSE, new_sound = sound('sound/misc/notice1.ogg'))) +GLOBAL_DATUM_INIT(security_announcement_down, /datum/announcement/priority/security, new(do_log = FALSE)) /proc/set_security_level(level) switch(level)