Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TTS only for announcement body #1023

Merged
merged 11 commits into from
Jan 19, 2025
15 changes: 9 additions & 6 deletions code/__HELPERS/priority_announce.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@
else
finalized_announcement = CHAT_ALERT_DEFAULT_SPAN(jointext(announcement_strings, ""))

AyIong marked this conversation as resolved.
Show resolved Hide resolved
dispatch_announcement_to_players(finalized_announcement, players, sound, tts_override = tts_override) // Bandastation Addition: "tts_override = tts_override"
// BANDASTATION EDIT - START
AyIong marked this conversation as resolved.
Show resolved Hide resolved
var/tts_message = (SSstation.announcer.custom_alert_message && !has_important_message) ? SSstation.announcer.custom_alert_message : text
dispatch_announcement_to_players(finalized_announcement, players, sound, tts_override = tts_override, tts_message = tts_message)
// BANDASTATION EDIT - END

if(isnull(sender_override) && players == GLOB.player_list)
if(length(title) > 0)
Expand Down Expand Up @@ -123,7 +126,7 @@
* should_play_sound - Whether the notice sound should be played or not. This can also be a callback, if you only want mobs to hear the sound based off of specific criteria.
* color_override - optional, use the passed color instead of the default notice color.
*/
/proc/minor_announce(message, title = "Attention:", alert = FALSE, html_encode = TRUE, list/players, sound_override, should_play_sound = TRUE, color_override)
/proc/minor_announce(message, title = "Attention:", alert = FALSE, html_encode = TRUE, list/players, sound_override, should_play_sound = TRUE, color_override, tts_override)
AyIong marked this conversation as resolved.
Show resolved Hide resolved
if(!message)
return

Expand All @@ -143,7 +146,7 @@
finalized_announcement = CHAT_ALERT_DEFAULT_SPAN(jointext(minor_announcement_strings, ""))

var/custom_sound = sound_override || (alert ? 'sound/announcer/notice/notice1.ogg' : 'sound/announcer/notice/notice2.ogg')
dispatch_announcement_to_players(finalized_announcement, players, custom_sound, should_play_sound)
dispatch_announcement_to_players(finalized_announcement, players, custom_sound, should_play_sound, tts_override = tts_override, tts_message = message) // BANDASTATION ADDITION - "tts_override" & "tts_message"

/// Sends an announcement about the level changing to players. Uses the passed in datum and the subsystem's previous security level to generate the message.
/proc/level_announce(datum/security_level/selected_level, previous_level_number)
Expand All @@ -168,7 +171,7 @@

var/finalized_announcement = CHAT_ALERT_COLORED_SPAN(current_level_color, jointext(level_announcement_strings, ""))

dispatch_announcement_to_players(finalized_announcement, GLOB.player_list, current_level_sound)
dispatch_announcement_to_players(finalized_announcement, GLOB.player_list, current_level_sound, tts_message = finalized_announcement) // BANDASTATION ADDITION - "tts_message = finalized_announcement"

/// Proc that just generates a custom header based on variables fed into `priority_announce()`
/// Will return a string.
Expand All @@ -186,7 +189,7 @@

/// Proc that just dispatches the announcement to our applicable audience. Only the announcement is a mandatory arg.
/// `should_play_sound` can also be a callback, if you want to only play the sound to specific players.
/proc/dispatch_announcement_to_players(announcement, list/players = GLOB.player_list, sound_override = null, should_play_sound = TRUE, datum/component/tts_component/tts_override = null) // Bandastation Addition: "datum/component/tts_component/tts_override = null"
/proc/dispatch_announcement_to_players(announcement, list/players = GLOB.player_list, sound_override = null, should_play_sound = TRUE, datum/component/tts_component/tts_override = null, tts_message = "") // Bandastation Addition: "datum/component/tts_component/tts_override = null" & "tts_message"
AyIong marked this conversation as resolved.
Show resolved Hide resolved
var/sound_to_play = !isnull(sound_override) ? sound_override : 'sound/announcer/notice/notice2.ogg'

// note for later: low-hanging fruit to convert to astype() behind an experiment define whenever the 516 beta releases
Expand Down Expand Up @@ -216,7 +219,7 @@
TYPE_PROC_REF(/datum/controller/subsystem/tts220, get_tts), \
null, \
target, \
announcement, \
tts_message, \
AyIong marked this conversation as resolved.
Show resolved Hide resolved
announcement_tts_seed, \
FALSE, \
list(/datum/singleton/sound_effect/announcement), \
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/requests_console.dm
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ GLOBAL_LIST_EMPTY(req_console_ckey_departments)
var/mob/living/L = usr
message = L.treat_message(message)["message"]

minor_announce(message, "[department] Announcement:", html_encode = FALSE, sound_override = 'sound/announcer/announcement/announce_dig.ogg')
minor_announce(message, "[department] Announcement:", html_encode = FALSE, sound_override = 'sound/announcer/announcement/announce_dig.ogg', tts_override = usr.GetComponent(/datum/component/tts_component)) // BANDASTATION ADDITION: "tts_override"
GLOB.news_network.submit_article(message, department, "Station Announcements", null)
usr.log_talk(message, LOG_SAY, tag="station announcement from [src]")
message_admins("[ADMIN_LOOKUPFLW(usr)] has made a station announcement from [src] at [AREACOORD(usr)].")
Expand Down
Loading