From 85f4503d339b57f4c328c51ffc499af067515540 Mon Sep 17 00:00:00 2001 From: warriorstar-orion Date: Wed, 2 Nov 2022 15:31:37 -0400 Subject: [PATCH] Refactor announcements. (#19459) * Refactor announcements. * Actually make this a unit test * Dumb * Remove unnecessary 'as text' * Reviews: - Make CSS class a recognizable word - Flip the defaults for logging Also: - Style fixes (default null in fields) - Fix emergency/crew-transfer shuttle announcement titles --- code/__DEFINES/announce.dm | 8 + code/controllers/subsystem/nightshift.dm | 2 +- code/datums/spells/knock.dm | 8 +- .../weather/weather_types/radiation_storm.dm | 2 +- code/defines/procs/announce.dm | 203 +++++++++--------- code/game/gamemodes/blob/blob_report.dm | 2 +- code/game/gamemodes/cult/cult.dm | 2 +- code/game/gamemodes/cult/cult_items.dm | 2 +- code/game/gamemodes/cult/ritual.dm | 2 +- .../gamemodes/malfunction/Malf_Modules.dm | 4 +- code/game/gamemodes/revolution/revolution.dm | 2 +- code/game/jobs/job/supervisor.dm | 4 +- .../game/machinery/computer/communications.dm | 10 +- code/game/machinery/requests_console.dm | 10 +- code/modules/admin/verbs/randomverbs.dm | 24 +-- code/modules/events/radiation_storm.dm | 2 +- code/modules/events/spider_terror.dm | 2 +- code/modules/mob/living/silicon/ai/ai.dm | 12 +- code/modules/mob/living/silicon/ai/death.dm | 2 +- .../security_levels/security_levels.dm | 19 +- code/modules/shuttle/emergency.dm | 54 +++-- code/modules/station_goals/station_goal.dm | 2 +- code/modules/unit_tests/_unit_tests.dm | 1 + code/modules/unit_tests/announcements.dm | 54 +++++ goon/browserassets/css/browserOutput-dark.css | 11 +- goon/browserassets/css/browserOutput.css | 11 +- paradise.dme | 1 + 27 files changed, 278 insertions(+), 178 deletions(-) create mode 100644 code/__DEFINES/announce.dm create mode 100644 code/modules/unit_tests/announcements.dm diff --git a/code/__DEFINES/announce.dm b/code/__DEFINES/announce.dm new file mode 100644 index 00000000000..9e6b7a6a78e --- /dev/null +++ b/code/__DEFINES/announce.dm @@ -0,0 +1,8 @@ +/// These values are used when logging user-initiated announcements. +#define ANNOUNCE_KIND_DEFAULT "Announcement" +#define ANNOUNCE_KIND_MINOR "Minor Announcement" +#define ANNOUNCE_KIND_PRIORITY "Priority Announcement" +#define ANNOUNCE_KIND_SECURITY "Security Announcement" +#define ANNOUNCE_KIND_MAJOR "NAS Trurl Update" +#define ANNOUNCE_KIND_EVENT "NAS Trurl Update" // Intentionally the same as above +#define ANNOUNCE_KIND_AI "A.I. Announcement" diff --git a/code/controllers/subsystem/nightshift.dm b/code/controllers/subsystem/nightshift.dm index fe5d17dccd4..8494c5527c4 100644 --- a/code/controllers/subsystem/nightshift.dm +++ b/code/controllers/subsystem/nightshift.dm @@ -26,7 +26,7 @@ SUBSYSTEM_DEF(nightshift) check_nightshift() /datum/controller/subsystem/nightshift/proc/announce(message) - GLOB.priority_announcement.Announce(message, new_sound = 'sound/misc/notice2.ogg', new_title = "Automated Lighting System Announcement") + GLOB.major_announcement.Announce(message, new_sound = 'sound/misc/notice2.ogg', new_title = "Automated Lighting System Announcement") /datum/controller/subsystem/nightshift/proc/check_nightshift(check_canfire=FALSE) if(check_canfire && !can_fire) diff --git a/code/datums/spells/knock.dm b/code/datums/spells/knock.dm index 5e1c8eb798c..488498508c8 100644 --- a/code/datums/spells/knock.dm +++ b/code/datums/spells/knock.dm @@ -62,11 +62,11 @@ if(is_station_level(A.z)) A.req_access = list() A.req_one_access = list() - GLOB.command_announcement.Announce( + GLOB.major_announcement.Announce( message = "We have removed all access requirements on your station's airlocks. You can thank us later!", - new_title = "Greetings!", - new_sound = 'sound/misc/notice2.ogg', - from = "Space Wizard Federation Message" + new_title = "Space Wizard Federation Message", + new_subtitle = "Greetings!", + new_sound = 'sound/misc/notice2.ogg' ) else ..() diff --git a/code/datums/weather/weather_types/radiation_storm.dm b/code/datums/weather/weather_types/radiation_storm.dm index 4d5b1796762..2360e3cd2d2 100644 --- a/code/datums/weather/weather_types/radiation_storm.dm +++ b/code/datums/weather/weather_types/radiation_storm.dm @@ -60,7 +60,7 @@ /datum/weather/rad_storm/end() if(..()) return - GLOB.priority_announcement.Announce("The radiation threat has passed. Please return to your workplaces.", "Anomaly Alert") + GLOB.major_announcement.Announce("The radiation threat has passed. Please return to your workplaces.", "Anomaly Alert") status_alarm(FALSE) if(!pre_maint_all_access) revoke_maint_all_access() diff --git a/code/defines/procs/announce.dm b/code/defines/procs/announce.dm index f1775c155b6..28a28433358 100644 --- a/code/defines/procs/announce.dm +++ b/code/defines/procs/announce.dm @@ -1,62 +1,52 @@ -GLOBAL_DATUM_INIT(minor_announcement, /datum/announcement/minor, new()) -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)) +GLOBAL_DATUM_INIT(minor_announcement, /datum/announcer, new(config_type = /datum/announcement_configuration/minor)) +GLOBAL_DATUM_INIT(major_announcement, /datum/announcer, new(config_type = /datum/announcement_configuration/major)) +GLOBAL_DATUM_INIT(event_announcement, /datum/announcer, new(config_type = /datum/announcement_configuration/event)) -/datum/announcement - var/title = "Attention" - var/announcer = "" - var/log = FALSE - var/sound - var/channel_name = "Station Announcements" - var/announcement_type = "Announcement" - 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 +/datum/announcement_configuration + var/default_title = "Attention" + /// The name used when describing the announcement type in logs. + var/log_name = ANNOUNCE_KIND_DEFAULT + /// Whether or not to log the announcement when made. + var/add_log = FALSE + /// Global announcements are received regardless of being in range of a + /// radio, unless you're in the lobby, to prevent metagaming. + var/global_announcement = FALSE + /// What sound to play when the announcement is made. + var/sound/sound + /// A CSS class name. + var/style + +/datum/announcer + // The default configuration for new announcements. + var/datum/announcement_configuration/config + /// The name used to sign off on announcements. + var/author var/language = "Galactic Common" -/datum/announcement/New(do_log = FALSE, new_sound = null) - sound = new_sound - log = do_log +/datum/announcer/New(config_type = null) + config = config_type ? new config_type : new -/datum/announcement/minor/New(do_log = FALSE, new_sound = sound('sound/misc/notice2.ogg')) - ..(do_log, new_sound) - title = "Attention" - announcement_type = "Minor Announcement" +// TODO: Make new_sound+new_sound2 a list to clean things up more +/datum/announcer/proc/Announce( + message, + new_title = null, + new_sound = null, + msg_sanitized = FALSE, + msg_language, + new_sound2 = null, + new_subtitle = null + ) -/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 = 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 = TRUE, new_sound = sound('sound/misc/notice2.ogg')) - ..(do_log, new_sound) - admin_announcement = FALSE - -/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, msg_sanitized = FALSE, from, msg_language, new_sound2 = null) if(!message) return - var/message_title = new_title ? new_title : title - var/message_sound = new_sound ? sound(new_sound) : sound - var/message_sound2 = new_sound2 ? sound(new_sound2) : sound + var/title = html_encode(new_title || config.default_title) + var/subtitle = new_subtitle ? html_encode(new_subtitle) : null + var/message_sound = new_sound ? sound(new_sound) : config.sound + var/message_sound2 = new_sound2 ? sound(new_sound2) : null if(!msg_sanitized) message = trim_strip_html_properly(message, allow_lines = TRUE) - message_title = html_encode(message_title) - - var/message_announcer = null - if(announcer) - message_announcer = html_encode(announcer) var/datum/language/message_language = GLOB.all_languages[msg_language ? msg_language : language] @@ -64,20 +54,27 @@ GLOBAL_DATUM_INIT(event_announcement, /datum/announcement/priority/command/event var/list/receivers = combined_receivers[1] var/list/garbled_receivers = combined_receivers[2] - var/formatted_message = Format_Message(message, message_title, message_announcer, from) - var/garbled_formatted_message = Format_Message(message_language.scramble(message), message_language.scramble(message_title), message_language.scramble(message_announcer), message_language.scramble(from)) + var/formatted_message = Format(message, title, subtitle) + var/garbled_formatted_message = Format( + message_language.scramble(message), + message_language.scramble(title), + message_language.scramble(subtitle) + ) Message(formatted_message, garbled_formatted_message, receivers, garbled_receivers) Sound(message_sound, combined_receivers[1] + combined_receivers[2]) - Sound(message_sound2, combined_receivers[1] + combined_receivers[2]) - Log(message, message_title) + if(message_sound2) + Sound(message_sound2, combined_receivers[1] + combined_receivers[2]) -/datum/announcement/proc/Get_Receivers(datum/language/message_language) + if(config.add_log) + Log(message, title) + +/datum/announcer/proc/Get_Receivers(datum/language/message_language) var/list/receivers = list() var/list/garbled_receivers = list() - if(admin_announcement) + if(config.global_announcement) for(var/mob/M in GLOB.player_list) if(!isnewplayer(M) && M.client) receivers |= M @@ -97,66 +94,74 @@ GLOBAL_DATUM_INIT(event_announcement, /datum/announcement/priority/command/event return list(receivers, garbled_receivers) -/datum/announcement/proc/Message(message, garbled_message, receivers, garbled_receivers) +/datum/announcer/proc/Message(message, garbled_message, receivers, garbled_receivers) for(var/mob/M in receivers) to_chat(M, message) for(var/mob/M in garbled_receivers) to_chat(M, garbled_message) -/datum/announcement/proc/Format_Message(message, message_title, message_announcer, from) +/datum/announcer/proc/Format(message, title, subtitle = null) var/formatted_message - formatted_message += "

[message_title]

" - formatted_message += "
[message]" - if(message_announcer) - formatted_message += "
-[message_announcer]" + var/style = config.style ? "announce [config.style]" : "announce" + + formatted_message += "
" + formatted_message += "

[title]

" + + if(subtitle) + formatted_message += "

[subtitle]

" + + formatted_message += "

[message]

" + + if(author) + formatted_message += "

- [html_encode(author)]

" + + formatted_message += "
" return formatted_message -/datum/announcement/minor/Format_Message(message, message_title, message_announcer, from) - var/formatted_message - formatted_message += "[message_title]" - formatted_message += "
[message]" - - return formatted_message - -/datum/announcement/priority/Format_Message(message, message_title, message_announcer, from) - var/formatted_message - formatted_message += "

[message_title]

" - formatted_message += "
[message]" - if(message_announcer) - formatted_message += "
-[message_announcer]" - formatted_message += "
" - - return formatted_message - -/datum/announcement/priority/command/Format_Message(message, message_title, message_announcer, from) - var/formatted_message - formatted_message += "

[from]

" - if(message_title) - formatted_message += "

[message_title]

" - formatted_message += "
[message]
" - formatted_message += "
" - - return formatted_message - -/datum/announcement/priority/security/Format_Message(message, message_title, message_announcer, from) - var/formatted_message - formatted_message += "[message_title]" - formatted_message += "
[message]" - - return formatted_message - -/datum/announcement/proc/Sound(message_sound, receivers) +/datum/announcer/proc/Sound(message_sound, receivers) if(!message_sound) return for(var/mob/M in receivers) SEND_SOUND(M, message_sound) -/datum/announcement/proc/Log(message as text, message_title as text) - if(log) - log_game("[key_name(usr)] has made \a [announcement_type]: [message_title] - [message] - [announcer]") - message_admins("[key_name_admin(usr)] has made \a [announcement_type].", 1) +/datum/announcer/proc/Log(message, message_title) + log_game("[key_name(usr)] has made \a [config.log_name]: [message_title] - [message] - [author]") + message_admins("[key_name_admin(usr)] has made \a [config.log_name].", 1) /proc/GetNameAndAssignmentFromId(obj/item/card/id/I) // Format currently matches that of newscaster feeds: Registered Name (Assigned Rank) return I.assignment ? "[I.registered_name] ([I.assignment])" : I.registered_name + +/datum/announcement_configuration/event + default_title = ANNOUNCE_KIND_EVENT + sound = sound('sound/misc/notice2.ogg') + style = "minor" + +/datum/announcement_configuration/major + default_title = ANNOUNCE_KIND_MAJOR + global_announcement = TRUE + sound = sound('sound/misc/notice2.ogg') + +/datum/announcement_configuration/security + default_title = ANNOUNCE_KIND_SECURITY + sound = sound('sound/misc/notice2.ogg') + style = "sec" + +/datum/announcement_configuration/minor + sound = sound('sound/misc/notice2.ogg') + style = "minor" + +/datum/announcement_configuration/requests_console + style = "minor" + +/datum/announcement_configuration/comms_console + default_title = "Priority Announcement" + add_log = TRUE + log_name = ANNOUNCE_KIND_PRIORITY + sound = sound('sound/misc/notice2.ogg') + +/datum/announcement_configuration/ai + default_title = ANNOUNCE_KIND_AI + add_log = TRUE + log_name = ANNOUNCE_KIND_AI diff --git a/code/game/gamemodes/blob/blob_report.dm b/code/game/gamemodes/blob/blob_report.dm index 296e3f53cd9..261e78aba93 100644 --- a/code/game/gamemodes/blob/blob_report.dm +++ b/code/game/gamemodes/blob/blob_report.dm @@ -32,7 +32,7 @@ log_admin("The station AI has received a new law zero due to a blob round continuing for over 50 minutes after initial burst. Zero Law: [law]") print_command_report(intercepttext, interceptname, FALSE) - GLOB.event_announcement.Announce("A report has been downloaded and printed out at all communications consoles.", "Incoming Classified Message", 'sound/AI/commandreport.ogg', from = "NAS Trurl Update") + GLOB.event_announcement.Announce("A report has been downloaded and printed out at all communications consoles.", "Incoming Classified Message", 'sound/AI/commandreport.ogg', new_subtitle = "NAS Trurl Update") /datum/station_state var/floor = 0 diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm index fa1f72012f2..bff66176594 100644 --- a/code/game/gamemodes/cult/cult.dm +++ b/code/game/gamemodes/cult/cult.dm @@ -274,7 +274,7 @@ GLOBAL_LIST_EMPTY(all_cults) SEND_SOUND(M.current, sound('sound/hallucinations/im_here1.ogg')) to_chat(M.current, "Your cult is ascendant and the red harvest approaches - you cannot hide your true nature for much longer!") addtimer(CALLBACK(src, .proc/ascend, M.current), 20 SECONDS) - GLOB.command_announcement.Announce("Picking up extradimensional activity related to the Cult of [SSticker.cultdat ? SSticker.cultdat.entity_name : "Nar'Sie"] from your station. Data suggests that about [ascend_percent * 100]% of the station has been converted. Security staff are authorized to use lethal force freely against cultists. Non-security staff should be prepared to defend themselves and their work areas from hostile cultists. Self defense permits non-security staff to use lethal force as a last resort, but non-security staff should be defending their work areas, not hunting down cultists. Dead crewmembers must be revived and deconverted once the situation is under control.", "Central Command Higher Dimensional Affairs", 'sound/AI/commandreport.ogg') + GLOB.major_announcement.Announce("Picking up extradimensional activity related to the Cult of [SSticker.cultdat ? SSticker.cultdat.entity_name : "Nar'Sie"] from your station. Data suggests that about [ascend_percent * 100]% of the station has been converted. Security staff are authorized to use lethal force freely against cultists. Non-security staff should be prepared to defend themselves and their work areas from hostile cultists. Self defense permits non-security staff to use lethal force as a last resort, but non-security staff should be defending their work areas, not hunting down cultists. Dead crewmembers must be revived and deconverted once the situation is under control.", "Central Command Higher Dimensional Affairs", 'sound/AI/commandreport.ogg') /datum/game_mode/proc/rise(cultist) diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm index 9d025440d35..d9fd0f1b073 100644 --- a/code/game/gamemodes/cult/cult_items.dm +++ b/code/game/gamemodes/cult/cult_items.dm @@ -315,7 +315,7 @@ playsound(user.loc, 'sound/effects/glassbr1.ogg', 50, TRUE) curselimit++ var/message = pick(CULT_CURSES) - GLOB.command_announcement.Announce("[message] The shuttle will be delayed by [cursetime / 600] minute\s.", "System Failure", 'sound/misc/notice1.ogg') + GLOB.major_announcement.Announce("[message] The shuttle will be delayed by [cursetime / 600] minute\s.", "System Failure", 'sound/misc/notice1.ogg') qdel(src) /obj/item/cult_shift diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm index e368f661175..979e93e4261 100644 --- a/code/game/gamemodes/cult/ritual.dm +++ b/code/game/gamemodes/cult/ritual.dm @@ -156,7 +156,7 @@ if(!(A in summon_areas)) // Check again to make sure they didn't move to_chat(user, "The ritual can only begin where the veil is weak - in [english_list(summon_areas)]!") return - GLOB.command_announcement.Announce("Figments from an eldritch god are being summoned into the [A.map_name] from an unknown dimension. Disrupt the ritual at all costs, before the station is destroyed! Space law and SOP are suspended. The entire crew must kill cultists on sight.", "Central Command Higher Dimensional Affairs", 'sound/AI/spanomalies.ogg') + GLOB.major_announcement.Announce("Figments from an eldritch god are being summoned into the [A.map_name] from an unknown dimension. Disrupt the ritual at all costs, before the station is destroyed! Space law and SOP are suspended. The entire crew must kill cultists on sight.", "Central Command Higher Dimensional Affairs", 'sound/AI/spanomalies.ogg') for(var/I in spiral_range_turfs(1, user, 1)) var/turf/T = I var/obj/machinery/shield/cult/narsie/N = new(T) diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm index 25c5a5284be..1f11f2da31b 100644 --- a/code/game/gamemodes/malfunction/Malf_Modules.dm +++ b/code/game/gamemodes/malfunction/Malf_Modules.dm @@ -276,7 +276,7 @@ if(SSshuttle.emergency.mode == SHUTTLE_STRANDED) SSshuttle.emergency.mode = SHUTTLE_DOCKED SSshuttle.emergency.timer = world.time - GLOB.priority_announcement.Announce("Hostile environment resolved. You have 3 minutes to board the Emergency Shuttle.", "Priority Announcement", 'sound/AI/eshuttle_dock.ogg') + GLOB.major_announcement.Announce("Hostile environment resolved. You have 3 minutes to board the Emergency Shuttle.", "Priority Announcement", 'sound/AI/eshuttle_dock.ogg') return ..() /obj/machinery/doomsday_device/proc/start() @@ -296,7 +296,7 @@ if(SSshuttle.emergency.mode == SHUTTLE_STRANDED) SSshuttle.emergency.mode = SHUTTLE_DOCKED SSshuttle.emergency.timer = world.time - GLOB.priority_announcement.Announce("Hostile environment resolved. You have 3 minutes to board the Emergency Shuttle.", "Priority Announcement", 'sound/AI/eshuttle_dock.ogg') + GLOB.major_announcement.Announce("Hostile environment resolved. You have 3 minutes to board the Emergency Shuttle.", "Priority Announcement", 'sound/AI/eshuttle_dock.ogg') qdel(src) if(!timing) STOP_PROCESSING(SSfastprocess, src) diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm index e5a4d7085ad..8d73308e180 100644 --- a/code/game/gamemodes/revolution/revolution.dm +++ b/code/game/gamemodes/revolution/revolution.dm @@ -220,7 +220,7 @@ if(SSshuttle.emergency.mode == SHUTTLE_STRANDED) SSshuttle.emergency.mode = SHUTTLE_DOCKED SSshuttle.emergency.timer = world.time - GLOB.command_announcement.Announce("Hostile enviroment resolved. You have 3 minutes to board the Emergency Shuttle.", null, 'sound/AI/eshuttle_dock.ogg') + GLOB.major_announcement.Announce("Hostile enviroment resolved. You have 3 minutes to board the Emergency Shuttle.", null, 'sound/AI/eshuttle_dock.ogg') return ..() if(finished != 0) return TRUE diff --git a/code/game/jobs/job/supervisor.dm b/code/game/jobs/job/supervisor.dm index 3b4885c4681..85e9733ed97 100644 --- a/code/game/jobs/job/supervisor.dm +++ b/code/game/jobs/job/supervisor.dm @@ -1,4 +1,3 @@ -GLOBAL_DATUM_INIT(captain_announcement, /datum/announcement/minor, new()) // Why the hell are captain announcements minor /datum/job/captain title = "Captain" flag = JOB_CAPTAIN @@ -23,7 +22,8 @@ GLOBAL_DATUM_INIT(captain_announcement, /datum/announcement/minor, new()) // Why /datum/job/captain/announce(mob/living/carbon/human/H) . = ..() - GLOB.captain_announcement.Announce("All hands, Captain [H.real_name] on deck!") + // Why the hell are captain announcements minor + GLOB.minor_announcement.Announce("All hands, Captain [H.real_name] on deck!") /datum/outfit/job/captain name = "Captain" diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 0afa278c673..b1f0b2e648f 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -36,7 +36,7 @@ var/display_type = STATUS_DISPLAY_TIME var/display_icon - var/datum/announcement/priority/crew_announcement = new + var/datum/announcer/announcer = new(config_type = /datum/announcement_configuration/comms_console) light_color = LIGHT_COLOR_LIGHTBLUE @@ -87,7 +87,7 @@ // Logout function. if(authenticated != COMM_AUTHENTICATION_NONE) authenticated = COMM_AUTHENTICATION_NONE - crew_announcement.announcer = null + announcer.author = null setMenuState(usr, COMM_SCREEN_MAIN) return // Login function. @@ -99,7 +99,7 @@ var/mob/living/carbon/human/H = usr var/obj/item/card/id = H.get_idcard(TRUE) if(istype(id)) - crew_announcement.announcer = GetNameAndAssignmentFromId(id) + announcer.author = GetNameAndAssignmentFromId(id) if(authenticated == COMM_AUTHENTICATION_NONE) to_chat(usr, "You need to wear a command or Captain-level ID.") return @@ -145,7 +145,7 @@ if(length(input) < COMM_MSGLEN_MINIMUM) to_chat(usr, "Message '[input]' is too short. [COMM_MSGLEN_MINIMUM] character minimum.") return - crew_announcement.Announce(input) + announcer.Announce(input) message_cooldown = world.time + 600 //One minute if("callshuttle") @@ -232,7 +232,7 @@ Nuke_request(input, usr) to_chat(usr, "Request sent.") log_game("[key_name(usr)] has requested the nuclear codes from Centcomm") - GLOB.priority_announcement.Announce("The codes for the on-station nuclear self-destruct have been requested by [usr]. Confirmation or denial of this request will be sent shortly.", "Nuclear Self Destruct Codes Requested",'sound/AI/commandreport.ogg') + GLOB.major_announcement.Announce("The codes for the on-station nuclear self-destruct have been requested by [usr]. Confirmation or denial of this request will be sent shortly.", "Nuclear Self Destruct Codes Requested",'sound/AI/commandreport.ogg') centcomm_message_cooldown = world.time + 6000 // 10 minutes setMenuState(usr, COMM_SCREEN_MAIN) diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm index 0fcf5aa73cb..49f7c47879b 100644 --- a/code/game/machinery/requests_console.dm +++ b/code/game/machinery/requests_console.dm @@ -63,7 +63,7 @@ GLOBAL_LIST_EMPTY(allRequestConsoles) var/recipient = ""; //the department which will be receiving the message var/priority = -1 ; //Priority of the message being sent light_range = 0 - var/datum/announcement/announcement = new + var/datum/announcer/announcer = new(config_type = /datum/announcement_configuration/requests_console) var/list/shipping_log = list() var/ship_tag_name = "" var/ship_tag_index = 0 @@ -106,7 +106,7 @@ GLOBAL_LIST_EMPTY(allRequestConsoles) Radio.follow_target = src . = ..() - announcement.title = "[department] announcement" + announcer.config.default_title = "[department] announcement" name = "[department] Requests Console" GLOB.allRequestConsoles += src @@ -218,7 +218,7 @@ GLOBAL_LIST_EMPTY(allRequestConsoles) if("sendAnnouncement") if(!announcementConsole) return - announcement.Announce(message) + announcer.Announce(message) reset_message(TRUE) if("department") @@ -309,7 +309,7 @@ GLOBAL_LIST_EMPTY(allRequestConsoles) var/obj/item/card/id/ID = I if(ACCESS_RC_ANNOUNCE in ID.GetAccess()) announceAuth = 1 - announcement.announcer = ID.assignment ? "[ID.assignment] [ID.registered_name]" : ID.registered_name + announcer.author = ID.assignment ? "[ID.assignment] [ID.registered_name]" : ID.registered_name else reset_message() to_chat(user, "You are not authorized to send announcements.") @@ -335,7 +335,7 @@ GLOBAL_LIST_EMPTY(allRequestConsoles) msgVerified = "" msgStamped = "" announceAuth = FALSE - announcement.announcer = "" + announcer.author = "" ship_tag_name = "" ship_tag_index = FALSE if(mainmenu) diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 7f1c804a52b..3f89e6ba038 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -629,32 +629,32 @@ Traitors and the like can also be revived with the previous role mostly intact. if(type == "Custom") type = clean_input("What would you like the report type to be?", "Report Type", "Encrypted Transmission") - var/customname = input(usr, "Pick a title for the report.", "Title", MsgType[type]) as text|null - if(!customname) + var/subtitle = input(usr, "Pick a title for the report.", "Title", MsgType[type]) as text|null + if(!subtitle) return - var/input = input(usr, "Please enter anything you want. Anything. Serious.", "What's the message?") as message|null - if(!input) + var/message = input(usr, "Please enter anything you want. Anything. Serious.", "What's the message?") as message|null + if(!message) return switch(alert("Should this be announced to the general population?",,"Yes","No", "Cancel")) if("Yes") var/beepsound = input(usr, "What sound should the announcement make?", "Announcement Sound", "") as anything in MsgSound - GLOB.command_announcement.Announce( - message = input, - new_title = customname, - new_sound = MsgSound[beepsound], - from = type + GLOB.major_announcement.Announce( + message, + new_title = type, + new_subtitle = subtitle, + new_sound = MsgSound[beepsound] ) - print_command_report(input, customname) + print_command_report(message, subtitle) if("No") //same thing as the blob stuff - it's not public, so it's classified, dammit GLOB.command_announcer.autosay("A classified message has been printed out at all communication consoles.") - print_command_report(input, "Classified: [customname]") + print_command_report(message, "Classified: [subtitle]") else return - log_admin("[key_name(src)] has created a communications report: [input]") + log_admin("[key_name(src)] has created a communications report: [message]") message_admins("[key_name_admin(src)] has created a communications report", 1) SSblackbox.record_feedback("tally", "admin_verb", 1, "Create Comms Report") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/events/radiation_storm.dm b/code/modules/events/radiation_storm.dm index a880d7d1f3d..86f0d5bb3dd 100644 --- a/code/modules/events/radiation_storm.dm +++ b/code/modules/events/radiation_storm.dm @@ -4,7 +4,7 @@ announceWhen = 1 /datum/event/radiation_storm/announce() - GLOB.priority_announcement.Announce("High levels of radiation detected near the station. Maintenance is best shielded from radiation.", "Anomaly Alert", 'sound/AI/radiation.ogg') + GLOB.major_announcement.Announce("High levels of radiation detected near the station. Maintenance is best shielded from radiation.", "Anomaly Alert", 'sound/AI/radiation.ogg') //sound not longer matches the text, but an audible warning is probably good /datum/event/radiation_storm/start() diff --git a/code/modules/events/spider_terror.dm b/code/modules/events/spider_terror.dm index 09e4783ecc0..82eecebe37f 100644 --- a/code/modules/events/spider_terror.dm +++ b/code/modules/events/spider_terror.dm @@ -16,7 +16,7 @@ /datum/event/spider_terror/announce() if(successSpawn) - GLOB.command_announcement.Announce("Confirmed outbreak of level 3 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", 'sound/effects/siren-spooky.ogg', new_sound2 = 'sound/AI/outbreak3.ogg') + GLOB.major_announcement.Announce("Confirmed outbreak of level 3 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", 'sound/effects/siren-spooky.ogg', new_sound2 = 'sound/AI/outbreak3.ogg') else log_and_message_admins("Warning: Could not spawn any mobs for event Terror Spiders") diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 2aa7282fe3d..55bd1a8b5bd 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -91,7 +91,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list( var/last_paper_seen = null var/can_shunt = TRUE var/last_announcement = "" - var/datum/announcement/priority/announcement + var/datum/announcer/announcer var/mob/living/simple_animal/bot/Bot var/turf/waypoint //Holds the turf of the currently selected waypoint. var/waypoint_mode = FALSE //Waypoint mode is for selecting a turf via clicking. @@ -126,10 +126,8 @@ GLOBAL_LIST_INIT(ai_verbs_default, list( verbs -= silicon_subsystems /mob/living/silicon/ai/New(loc, datum/ai_laws/L, obj/item/mmi/B, safety = 0) - announcement = new() - announcement.title = "A.I. Announcement" - announcement.announcement_type = "A.I. Announcement" - announcement.announcer = name + announcer = new(config_type = /datum/announcement_configuration/ai) + announcer.author = name var/list/possibleNames = GLOB.ai_names @@ -330,7 +328,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list( return FALSE if(oldname != real_name) - announcement.announcer = name + announcer.author = name if(eyeobj) eyeobj.name = "[newname] (AI Eye)" @@ -570,7 +568,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list( if(check_unable(AI_CHECK_WIRELESS | AI_CHECK_RADIO)) return - announcement.Announce(input) + announcer.Announce(input) next_text_announcement = world.time + TEXT_ANNOUNCEMENT_COOLDOWN /mob/living/silicon/ai/proc/ai_call_shuttle() diff --git a/code/modules/mob/living/silicon/ai/death.dm b/code/modules/mob/living/silicon/ai/death.dm index fcfa1f800fb..657c6d938aa 100644 --- a/code/modules/mob/living/silicon/ai/death.dm +++ b/code/modules/mob/living/silicon/ai/death.dm @@ -27,7 +27,7 @@ if(SSshuttle.emergency.mode == SHUTTLE_STRANDED) SSshuttle.emergency.mode = SHUTTLE_DOCKED SSshuttle.emergency.timer = world.time - GLOB.priority_announcement.Announce("Hostile environment resolved. You have 3 minutes to board the Emergency Shuttle.", "Priority Announcement", 'sound/AI/eshuttle_dock.ogg') + GLOB.major_announcement.Announce("Hostile environment resolved. You have 3 minutes to board the Emergency Shuttle.", "Priority Announcement", 'sound/AI/eshuttle_dock.ogg') qdel(doomsday_device) if(explosive) diff --git a/code/modules/security_levels/security_levels.dm b/code/modules/security_levels/security_levels.dm index 74faa0baa58..e75f034942c 100644 --- a/code/modules/security_levels/security_levels.dm +++ b/code/modules/security_levels/security_levels.dm @@ -7,8 +7,7 @@ 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 = FALSE, new_sound = sound('sound/misc/notice1.ogg'))) -GLOBAL_DATUM_INIT(security_announcement_down, /datum/announcement/priority/security, new(do_log = FALSE)) +GLOBAL_DATUM_INIT(security_announcement, /datum/announcer, new(config_type = /datum/announcement_configuration/security)) /proc/set_security_level(level) switch(level) @@ -33,7 +32,7 @@ GLOBAL_DATUM_INIT(security_announcement_down, /datum/announcement/priority/secur switch(level) if(SEC_LEVEL_GREEN) - GLOB.security_announcement_down.Announce("All threats to the station have passed. All weapons need to be holstered and privacy laws are once again fully enforced.","Attention! Security level lowered to green.", 'sound/AI/green.ogg') + GLOB.security_announcement.Announce("All threats to the station have passed. All weapons need to be holstered and privacy laws are once again fully enforced.","Attention! Security level lowered to green.", 'sound/AI/green.ogg') GLOB.security_level = SEC_LEVEL_GREEN unset_stationwide_emergency_lighting() post_status(STATUS_DISPLAY_TRANSFER_SHUTTLE_TIME) @@ -41,9 +40,9 @@ GLOBAL_DATUM_INIT(security_announcement_down, /datum/announcement/priority/secur if(SEC_LEVEL_BLUE) if(GLOB.security_level < SEC_LEVEL_BLUE) - GLOB.security_announcement_up.Announce("The station has received reliable information about possible hostile activity on the station. Security staff may have weapons visible and random searches are permitted.","Attention! Security level elevated to blue.", 'sound/AI/blue.ogg') + GLOB.security_announcement.Announce("The station has received reliable information about possible hostile activity on the station. Security staff may have weapons visible and random searches are permitted.","Attention! Security level elevated to blue.", 'sound/AI/blue.ogg') else - GLOB.security_announcement_down.Announce("The immediate threat has passed. Security may no longer have weapons drawn at all times, but may continue to have them visible. Random searches are still allowed.","Attention! Security level lowered to blue.", 'sound/AI/blue.ogg') + GLOB.security_announcement.Announce("The immediate threat has passed. Security may no longer have weapons drawn at all times, but may continue to have them visible. Random searches are still allowed.","Attention! Security level lowered to blue.", 'sound/AI/blue.ogg') GLOB.security_level = SEC_LEVEL_BLUE post_status(STATUS_DISPLAY_TRANSFER_SHUTTLE_TIME) @@ -52,9 +51,9 @@ GLOBAL_DATUM_INIT(security_announcement_down, /datum/announcement/priority/secur if(SEC_LEVEL_RED) if(GLOB.security_level < SEC_LEVEL_RED) - GLOB.security_announcement_up.Announce("There is an immediate and serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised.","Attention! Code Red!", 'sound/AI/red.ogg') + GLOB.security_announcement.Announce("There is an immediate and serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised.","Attention! Code Red!", 'sound/AI/red.ogg') else - GLOB.security_announcement_down.Announce("The station's self-destruct mechanism has been deactivated, but there is still an immediate and serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised.","Attention! Code Red!", 'sound/AI/red.ogg') + GLOB.security_announcement.Announce("The station's self-destruct mechanism has been deactivated, but there is still an immediate and serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised.","Attention! Code Red!", 'sound/AI/red.ogg') unset_stationwide_emergency_lighting() GLOB.security_level = SEC_LEVEL_RED @@ -66,7 +65,7 @@ GLOBAL_DATUM_INIT(security_announcement_down, /datum/announcement/priority/secur update_firealarms() if(SEC_LEVEL_GAMMA) - GLOB.security_announcement_up.Announce("Central Command has ordered the Gamma security level on the station. Security is to have weapons equipped at all times, and all civilians are to immediately seek their nearest head for transportation to a secure location.", "Attention! Gamma security level activated!", 'sound/effects/new_siren.ogg', new_sound2 = 'sound/AI/gamma.ogg') + GLOB.security_announcement.Announce("Central Command has ordered the Gamma security level on the station. Security is to have weapons equipped at all times, and all civilians are to immediately seek their nearest head for transportation to a secure location.", "Attention! Gamma security level activated!", 'sound/effects/new_siren.ogg', new_sound2 = 'sound/AI/gamma.ogg') GLOB.security_level = SEC_LEVEL_GAMMA if(GLOB.security_level < SEC_LEVEL_RED) @@ -89,7 +88,7 @@ GLOBAL_DATUM_INIT(security_announcement_down, /datum/announcement/priority/secur return if(SEC_LEVEL_DELTA) - GLOB.security_announcement_up.Announce("The station's self-destruct mechanism has been engaged. All crew are instructed to obey all instructions given by heads of staff. Any violations of these orders can be punished by death. This is not a drill.","Attention! Delta security level reached!", 'sound/effects/deltaalarm.ogg', new_sound2 = 'sound/AI/delta.ogg') + GLOB.security_announcement.Announce("The station's self-destruct mechanism has been engaged. All crew are instructed to obey all instructions given by heads of staff. Any violations of these orders can be punished by death. This is not a drill.","Attention! Delta security level reached!", 'sound/effects/deltaalarm.ogg', new_sound2 = 'sound/AI/delta.ogg') GLOB.security_level = SEC_LEVEL_DELTA post_status(STATUS_DISPLAY_ALERT, "deltaalert") @@ -204,7 +203,7 @@ GLOBAL_DATUM_INIT(security_announcement_down, /datum/announcement/priority/secur INVOKE_ASYNC(L, /obj/machinery/light/.proc/update, FALSE) /proc/epsilon_process() - GLOB.security_announcement_up.Announce("Central Command has ordered the Epsilon security level on the station. Consider all contracts terminated.", "Attention! Epsilon security level activated!", 'sound/effects/purge_siren.ogg') + GLOB.security_announcement.Announce("Central Command has ordered the Epsilon security level on the station. Consider all contracts terminated.", "Attention! Epsilon security level activated!", 'sound/effects/purge_siren.ogg') GLOB.security_level = SEC_LEVEL_EPSILON post_status(STATUS_DISPLAY_ALERT, "epsilonalert") for(var/area/A as anything in GLOB.all_areas) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index d242c5a17bc..39ea952e00d 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -202,15 +202,7 @@ travelDir = 0 var/sound_played = 0 //If the launch sound has been sent to all players on the shuttle itself - var/datum/announcement/priority/emergency_shuttle_docked = new(0, new_sound = sound('sound/AI/eshuttle_dock.ogg')) - var/datum/announcement/priority/emergency_shuttle_called = new(0, new_sound = sound('sound/AI/eshuttle_call.ogg')) - var/datum/announcement/priority/emergency_shuttle_recalled = new(0, new_sound = sound('sound/AI/eshuttle_recall.ogg')) - var/canRecall = TRUE //no bad condom, do not recall the crew transfer shuttle! - - var/datum/announcement/priority/crew_shuttle_called = new(0, new_sound = sound('sound/AI/cshuttle.ogg')) - var/datum/announcement/priority/crew_shuttle_docked = new(0, new_sound = sound('sound/AI/cshuttle_dock.ogg')) - ///State of the emergency shuttles hijack status. var/hijack_status = NOT_BEGUN @@ -268,9 +260,17 @@ else SSshuttle.emergencyLastCallLoc = null if(canRecall) - emergency_shuttle_called.Announce("The emergency shuttle has been called. [redAlert ? "Red Alert state confirmed: Dispatching priority shuttle. " : "" ]It will arrive in [timeLeft(600)] minutes.[reason][SSshuttle.emergencyLastCallLoc ? "\n\nCall signal traced. Results can be viewed on any communications console." : "" ]") + GLOB.major_announcement.Announce( + "The emergency shuttle has been called. [redAlert ? "Red Alert state confirmed: Dispatching priority shuttle. " : "" ]It will arrive in [timeLeft(600)] minutes.[reason][SSshuttle.emergencyLastCallLoc ? "\n\nCall signal traced. Results can be viewed on any communications console." : "" ]", + new_title = "Priority Announcement", + new_sound = sound('sound/AI/eshuttle_call.ogg') + ) else - crew_shuttle_called.Announce("The crew transfer shuttle has been called. [redAlert ? "Red Alert state confirmed: Dispatching priority shuttle. " : "" ]It will arrive in [timeLeft(600)] minutes.[reason]") + GLOB.major_announcement.Announce( + "The crew transfer shuttle has been called. [redAlert ? "Red Alert state confirmed: Dispatching priority shuttle. " : "" ]It will arrive in [timeLeft(600)] minutes.[reason]", + new_title = "Priority Announcement", + new_sound = sound('sound/AI/cshuttle.ogg') + ) /obj/docking_port/mobile/emergency/cancel(area/signalOrigin) if(!canRecall) @@ -286,7 +286,11 @@ SSshuttle.emergencyLastCallLoc = signalOrigin else SSshuttle.emergencyLastCallLoc = null - emergency_shuttle_recalled.Announce("The emergency shuttle has been recalled.[SSshuttle.emergencyLastCallLoc ? " Recall signal traced. Results can be viewed on any communications console." : "" ]") + GLOB.major_announcement.Announce( + "The emergency shuttle has been recalled.[SSshuttle.emergencyLastCallLoc ? " Recall signal traced. Results can be viewed on any communications console." : "" ]", + new_title = "Priority Announcement", + new_sound = sound('sound/AI/eshuttle_recall.ogg') + ) /obj/docking_port/mobile/emergency/proc/is_hijacked(fullcheck = FALSE) if(hijack_status == HIJACKED && !fullcheck) //Don't even bother if it was done via computer. @@ -355,10 +359,17 @@ mode = SHUTTLE_DOCKED timer = world.time if(canRecall) - emergency_shuttle_docked.Announce("The emergency shuttle has docked with the station. You have [timeLeft(600)] minutes to board the emergency shuttle.") + GLOB.major_announcement.Announce( + "The emergency shuttle has docked with the station. You have [timeLeft(600)] minutes to board the emergency shuttle.", + new_title = "Priority Announcement", + new_sound = sound('sound/AI/eshuttle_dock.ogg') + ) else - crew_shuttle_docked.Announce("The crew transfer shuttle has docked with the station. You have [timeLeft(600)] minutes to board the crew transfer shuttle.") - + GLOB.major_announcement.Announce( + "The crew transfer shuttle has docked with the station. You have [timeLeft(600)] minutes to board the crew transfer shuttle.", + new_title = "Priority Announcement", + new_sound = sound('sound/AI/cshuttle_dock.ogg') + ) /* //Gangs only have one attempt left if the shuttle has docked with the station to prevent suffering from dominator delays for(var/datum/gang/G in ticker.mode.gangs) @@ -370,7 +381,10 @@ if(SHUTTLE_DOCKED) if(time_left <= 0 && SSshuttle.emergencyNoEscape) - GLOB.priority_announcement.Announce("Hostile environment detected. Departure has been postponed indefinitely pending conflict resolution.") + GLOB.major_announcement.Announce( + "Hostile environment detected. Departure has been postponed indefinitely pending conflict resolution.", + new_title = "Priority Announcement" + ) sound_played = 0 mode = SHUTTLE_STRANDED @@ -392,7 +406,10 @@ enterTransit() mode = SHUTTLE_ESCAPE timer = world.time - GLOB.priority_announcement.Announce("The Emergency Shuttle has left the station. Estimate [timeLeft(600)] minutes until the shuttle docks at Central Command.") + GLOB.major_announcement.Announce( + "The Emergency Shuttle has left the station. Estimate [timeLeft(600)] minutes until the shuttle docks at Central Command.", + new_title = "Priority Announcement" + ) for(var/mob/M in GLOB.player_list) if(!isnewplayer(M) && !(M.client.ckey in GLOB.karma_spenders) && !M.get_preference(PREFTOGGLE_DISABLE_KARMA_REMINDER)) to_chat(M, "You have not yet spent your karma for the round; was there a player worthy of receiving your reward? Look under Special Verbs tab, Award Karma.") @@ -412,7 +429,10 @@ var/destination_dock = "emergency_away" if(is_hijacked()) destination_dock = "emergency_syndicate" - GLOB.priority_announcement.Announce("Corruption detected in shuttle navigation protocols. Please contact your supervisor.") + GLOB.major_announcement.Announce( + "Corruption detected in shuttle navigation protocols. Please contact your supervisor.", + new_title = "Priority Announcement" + ) dock_id(destination_dock) diff --git a/code/modules/station_goals/station_goal.dm b/code/modules/station_goals/station_goal.dm index 6dd6fc2f2b2..f74413e8072 100644 --- a/code/modules/station_goals/station_goal.dm +++ b/code/modules/station_goals/station_goal.dm @@ -12,7 +12,7 @@ var/report_message = "Complete this goal." /datum/station_goal/proc/send_report() - GLOB.priority_announcement.Announce("Priority Nanotrasen directive received. Project \"[name]\" details inbound.", "Incoming Priority Message", 'sound/AI/commandreport.ogg') + GLOB.major_announcement.Announce("Priority Nanotrasen directive received. Project \"[name]\" details inbound.", "Incoming Priority Message", 'sound/AI/commandreport.ogg') print_command_report(get_report(), "Nanotrasen Directive [pick(GLOB.phonetic_alphabet)] \Roman[rand(1,50)]", FALSE) on_report() diff --git a/code/modules/unit_tests/_unit_tests.dm b/code/modules/unit_tests/_unit_tests.dm index c61977b24be..f085af33153 100644 --- a/code/modules/unit_tests/_unit_tests.dm +++ b/code/modules/unit_tests/_unit_tests.dm @@ -2,6 +2,7 @@ //Keep this sorted alphabetically #ifdef UNIT_TESTS +#include "announcements.dm" #include "component_tests.dm" #include "config_sanity.dm" #include "crafting_lists.dm" diff --git a/code/modules/unit_tests/announcements.dm b/code/modules/unit_tests/announcements.dm new file mode 100644 index 00000000000..a8eef14efcb --- /dev/null +++ b/code/modules/unit_tests/announcements.dm @@ -0,0 +1,54 @@ +/// This test exists largely to ensure that no runtimes occur when announcements +/// are made, so there are no explicit Fail calls. It either works or runtimes. +/datum/unit_test/announcements + +/datum/unit_test/announcements/Run() + GLOB.major_announcement.Announce("Figments from an eldritch god are being summoned into the NSS Cyberiad from an unknown dimension. Disrupt the ritual at all costs, before the station is destroyed! Space law and SOP are suspended. The entire crew must kill cultists on sight.", "Central Command Higher Dimensional Affairs", 'sound/AI/spanomalies.ogg') + + GLOB.major_announcement.Announce( + message = "We have removed all access requirements on your station's airlocks. You can thank us later!", + new_title = "Space Wizard Federation Message", + new_subtitle = "Greetings!", + new_sound = 'sound/misc/notice2.ogg' + ) + + var/datum/announcer/requests_console = new(config_type = /datum/announcement_configuration/requests_console) + requests_console.config.default_title = "Science announcement" + requests_console.Announce("Request console announcement") + + var/datum/announcer/comms_console = new(config_type = /datum/announcement_configuration/comms_console) + + comms_console.author = "Foo Bar" + comms_console.Announce("This is a test of the communications console announcement.") + + var/title = "Nanotrasen Update" + var/message = "This is an admin report." + var/subtitle = "NAS Trurl Update" + GLOB.major_announcement.Announce( + message, + new_title = title, + new_subtitle = subtitle, + new_sound = 'sound/misc/notice2.ogg' + ) + + GLOB.event_announcement.Announce("Bioscans indicate that lizards have been breeding in the kitchen. Clear them out, before this starts to affect productivity.", "Lifesign Alert") + + var/datum/announcer/ai_announcer = new(config_type = /datum/announcement_configuration/ai) + ai_announcer.author = "AI-NAME-0345" + ai_announcer.Announce("AI only get one input box so here ya go") + + set_security_level(SEC_LEVEL_RED) + set_security_level(SEC_LEVEL_GAMMA) + set_security_level(SEC_LEVEL_EPSILON) + set_security_level(SEC_LEVEL_RED) + set_security_level(SEC_LEVEL_BLUE) + set_security_level(SEC_LEVEL_GREEN) + + var/reason = "We're getting the fuck out of here" + var/redAlert = TRUE + GLOB.major_announcement.Announce( + message = "The emergency shuttle has been called. [redAlert ? "Red Alert state confirmed: Dispatching priority shuttle. " : "" ]It will arrive in 10 minutes.[reason]", + new_title = "Priority Announcement", + new_sound = sound('sound/AI/eshuttle_call.ogg') + ) + diff --git a/goon/browserassets/css/browserOutput-dark.css b/goon/browserassets/css/browserOutput-dark.css index 525816fddb2..2495b1a9418 100644 --- a/goon/browserassets/css/browserOutput-dark.css +++ b/goon/browserassets/css/browserOutput-dark.css @@ -289,8 +289,6 @@ em {font-style: normal;font-weight: bold;} .djradio {color: #996600;} .binaryradio {color: #1B00FB;font-family: 'Courier New', Courier, monospace;} .mommiradio {color: #6685f5;} -.alert {color: #d82020;} -h1.alert, h2.alert {color: #FFF;} .ghostalert {color: #cc00c6;font-style: italic; font-weight: bold;} .emote {font-style: italic;} .selecteddna {color: #FFFFFF; background-color: #001B1B} @@ -427,3 +425,12 @@ h1.alert, h2.alert {color: #FFF;} /* Syndicate codewords */ span.body .codephrases {color: #5555FF;} span.body .coderesponses {color: #FF3333;} + +.announce { font-size: 24pt; } +.announce h1, .announce h2 { color: #fff; } +.announce p { color: #d82020; font-size: 12pt; } +.announce h1 { font-size: 100%; } +.announce h2 { font-size: 90%; } +.announce.minor h1 { font-size: 80%; } +.announce.minor h2 { font-size: 70%; } +.announce.sec h1 { color: #f00; font-size: 80%; font-family: Verdana, sans-serif; } diff --git a/goon/browserassets/css/browserOutput.css b/goon/browserassets/css/browserOutput.css index 6a097783a02..6d2676cc317 100644 --- a/goon/browserassets/css/browserOutput.css +++ b/goon/browserassets/css/browserOutput.css @@ -286,8 +286,6 @@ em {font-style: normal; font-weight: bold;} .djradio {color: #663300;} .binaryradio {color: #0B0050; font-family: 'Courier New', Courier, monospace;} .mommiradio {color: navy;} -.alert {color: #ff0000;} -h1.alert, h2.alert {color: #000000;} .ghostalert {color: #5c00e6; font-style: italic; font-weight: bold;} .emote { font-style: italic;} .selecteddna {color: #FFFFFF; background-color: #001B1B} @@ -427,3 +425,12 @@ h1.alert, h2.alert {color: #000000;} /* Syndicate codewords */ span.body .codephrases {color: #0000FF;} span.body .coderesponses {color: #FF0000;} + +.announce { font-size: 24pt; } +.announce h1, .announce h2 { color: #000; } +.announce p { color: #d82020; font-size: 12pt; } +.announce h1 { font-size: 100%; } +.announce h2 { font-size: 90%; } +.announce.minor h1 { font-size: 80%; } +.announce.minor h2 { font-size: 70%; } +.announce.sec h1 { color: #f00; font-size: 80%; font-family: Verdana, sans-serif; } diff --git a/paradise.dme b/paradise.dme index 8834b13034f..b2ea175cd50 100644 --- a/paradise.dme +++ b/paradise.dme @@ -27,6 +27,7 @@ #include "code\__DEFINES\_versions.dm" #include "code\__DEFINES\access.dm" #include "code\__DEFINES\admin.dm" +#include "code\__DEFINES\announce.dm" #include "code\__DEFINES\antagonists.dm" #include "code\__DEFINES\armour.dm" #include "code\__DEFINES\atmospherics.dm"