Announcement system refactoring.

Turns announcements into a datum based system to allow a variety of configurations.
Current configuration options include:
Admin logging
Which sound that should play when announced, if any
If the announcement should be stored as a newscast

Request console/standard announcements currently match priority announcements, but have a smaller style/footprint.
Player announcements now include the assignment and name of the person (or the id rather) who made it.

Have currently only updated the request console and all announcements which previously used captain_announce().
Affected automated announcements, such as shuttle messages, should be exactly the same as before.
This commit is contained in:
PsiOmega
2014-08-20 23:07:21 +02:00
parent a2253617cf
commit 68bf885e6b
13 changed files with 175 additions and 64 deletions
@@ -43,6 +43,12 @@
var/stat_msg1
var/stat_msg2
var/datum/announcement/priority/crew_announcement = new
New()
..()
crew_announcement.newscast = 1
Reset()
..()
authenticated = 0
@@ -68,11 +74,13 @@
authenticated = 1
if(access_captain in I.GetAccess())
authenticated = 2
crew_announcement.announcer = GetNameAndAssignmentFromId(I)
if(istype(I,/obj/item/weapon/card/emag))
authenticated = 2
computer.emagged = 1
if("logout" in href_list)
authenticated = 0
crew_announcement.announcer = ""
if("swipeidseclevel" in href_list)
var/mob/M = usr
@@ -104,13 +112,13 @@
usr << "You need to swipe your ID."
if("announce" in href_list)
if(authenticated==2)
if(message_cooldown) return
var/input = stripped_input(usr, "Please choose a message to announce to the station crew.", "What?")
if(message_cooldown)
usr << "Please allow at least one minute to pass between announcements"
return
var/input = stripped_input(usr, "Please write a message to announce to the station crew.", "Priority Announcement")
if(!input || !interactable())
return
captain_announce(input)//This should really tell who is, IE HoP, CE, HoS, RD, Captain
log_say("[key_name(usr)] has made a captain announcement: [input]")
message_admins("[key_name_admin(usr)] has made a captain announcement.", 1)
crew_announcement.Announce(input)
message_cooldown = 1
spawn(600)//One minute cooldown
message_cooldown = 0