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
This commit is contained in:
warriorstar-orion
2022-11-02 20:31:37 +01:00
committed by GitHub
parent e63526cfdd
commit 85f4503d33
27 changed files with 278 additions and 178 deletions
+12 -12
View File
@@ -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!