diff --git a/code/defines/procs/announce.dm b/code/defines/procs/announce.dm index e07becd161e..b0713762c20 100644 --- a/code/defines/procs/announce.dm +++ b/code/defines/procs/announce.dm @@ -42,49 +42,46 @@ message = sanitize(message, extra = 0) message_title = sanitizeSafe(message_title) - Message(message, message_title) + MessageAndSound(message, message_title, message_sound) if(do_newscast) NewsCast(message, message_title) if(do_print) post_comm_message(message_title, message) - Sound(message_sound) Log(message, message_title) -datum/announcement/proc/Message(message as text, message_title as text) +/datum/announcement/proc/MessageAndSound(var/message as text, var/message_title as text, var/message_sound) for(var/mob/M in player_list) if(!istype(M,/mob/abstract/new_player) && !isdeaf(M)) - to_chat(M, "

[title]

") - to_chat(M, "[message]") - if (announcer) - to_chat(M, " -[html_encode(announcer)]") + var/turf/T = get_turf(M) + if(T && isStationLevel(T.z)) + to_chat(M, "

[title]

") + to_chat(M, "[message]") + if (announcer) + to_chat(M, " -[html_encode(announcer)]") + if(message_sound && !isdeaf(M) && (M.client.prefs.asfx_togs & ASFX_VOX)) + sound_to(M, message_sound) -datum/announcement/minor/Message(message as text, message_title as text) +/datum/announcement/minor/MessageAndSound(var/message as text, var/message_title as text) to_world("[message]") -datum/announcement/priority/Message(message as text, message_title as text) - to_world("

[message_title]

") - to_world("[message]") - if(announcer) - to_world(" -[html_encode(announcer)]") - to_world("
") - -datum/announcement/priority/command/Message(message as text, message_title as text) - var/command - command += "

[current_map.boss_name] Update

" +/datum/announcement/priority/command/MessageAndSound(var/message as text, var/message_title as text, var/message_sound) + var/command_title + command_title += "

[current_map.boss_name] Update

" if (message_title) - command += "

[message_title]

" + command_title += "

[message_title]

" - command += "
[message]
" - command += "
" - for(var/mob/M in player_list) - if(!istype(M,/mob/abstract/new_player) && !isdeaf(M)) - to_chat(M, command) + var/command_body + command_body += "
[message]
" + command_body += "
" + . = ..(command_body, command_title, message_sound) -datum/announcement/priority/security/Message(message as text, message_title as text) +/datum/announcement/priority/security/MessageAndSound(var/message as text, var/message_title as text, var/message_sound) to_world("[message_title]") to_world("[message]") + if(message_sound) + to_world(message_sound) -datum/announcement/proc/NewsCast(message as text, message_title as text) +/datum/announcement/proc/NewsCast(message as text, message_title as text) if(!newscast) return @@ -96,24 +93,7 @@ datum/announcement/proc/NewsCast(message as text, message_title as text) news.can_be_redacted = 0 announce_newscaster_news(news) -datum/announcement/proc/PlaySound(var/message_sound) - if(!message_sound) - return - for(var/mob/M in player_list) - if(!istype(M,/mob/abstract/new_player) && !isdeaf(M) && (M.client.prefs.asfx_togs & ASFX_VOX)) - to_chat(M, message_sound) - -datum/announcement/proc/Sound(var/message_sound) - PlaySound(message_sound) - -datum/announcement/priority/Sound(var/message_sound) - if(message_sound) - to_world(message_sound) - -datum/announcement/priority/command/Sound(var/message_sound) - PlaySound(message_sound) - -datum/announcement/proc/Log(message as text, message_title as text) +/datum/announcement/proc/Log(message as text, message_title as text) if(log) log_say("[key_name(usr)] has made \a [announcement_type]: [message_title] - [message] - [announcer]",ckey=key_name(usr)) message_admins("[key_name_admin(usr)] has made \a [announcement_type].", 1) diff --git a/html/changelogs/arrow768-station-announcements.yml b/html/changelogs/arrow768-station-announcements.yml new file mode 100644 index 00000000000..16e088801f8 --- /dev/null +++ b/html/changelogs/arrow768-station-announcements.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: Arrow768 + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - tweak: "Announcemnts (except alert level changes) are only visible on station levels."