Files
Bubberstation/code/controllers/subsystem/communications.dm
Watermelon914 9dcef290ec Reworks the styling of the announcements and expands major announcements to also be colourable. (#79236)
## About The Pull Request
The styling of the announcements has been reworked and major
announcements can now be coloured too. Syndicate and hostile
announcements have been given a red/orange. Wizard federation now has a
purple colour.
Admins can set what colour they want their announcements to be and they
can also set the announcement subheader now.
The colour scheme for darkmode has been changed slightly and the colour
scheme for lightmode has been completely revamped.
Main text body of the announcements are no longer striped to allow for
easier reading.
Rolled back the changes to deadchat notifications, they're now back to
being normal text.

Shuttle-related announcements now have an orange background
<details>
<summary>Light mode pictures</summary>


![image](https://github.com/tgstation/tgstation/assets/37270891/30f56511-5c98-48ae-9f72-605a813b3103)


![image](https://github.com/tgstation/tgstation/assets/37270891/18741f85-834d-40d6-a7d3-b179760cebfa)


![image](https://github.com/tgstation/tgstation/assets/37270891/e6df8e19-8bb7-4aa4-9e44-f5d6d78563e0)


![image](https://github.com/tgstation/tgstation/assets/37270891/d791f0c5-bcc9-4f39-8c49-e6552e3dbfdd)

</details>

<details>
<summary>Dark mode pictures</summary>


![image](https://github.com/tgstation/tgstation/assets/37270891/5c383dd4-b435-4a2e-8e28-b78e73c4da96)


![image](https://github.com/tgstation/tgstation/assets/37270891/46dd1d1a-22b4-4613-85d3-aeb5be26b3b2)


![image](https://github.com/tgstation/tgstation/assets/37270891/e3b28b75-42b7-467a-b23d-748b12e3c093)


![image](https://github.com/tgstation/tgstation/assets/37270891/6a606798-42ac-4c1e-9246-9ff8f478239d)

</details>

## Why It's Good For The Game
The colours for light mode were hard to read due to bad colour
combinations, which caused the foreground and background to have too low
contrast. Additionally, I felt like the styling was less immersive
overall and that there didn't need to be so much noise over the main
text body.

## Changelog
🆑
add: Reworked the colour schemes for the minor and major announcements
as well as their layout
del: Rolled back changes to deadchat notifications
admin: Admins can now select the colour of their announcements as well
as the subheader when creating a command report.
/🆑

---------

Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
2023-10-25 21:42:32 -07:00

65 lines
3.1 KiB
Plaintext

#define COMMUNICATION_COOLDOWN (30 SECONDS)
#define COMMUNICATION_COOLDOWN_AI (30 SECONDS)
#define COMMUNICATION_COOLDOWN_MEETING (5 MINUTES)
SUBSYSTEM_DEF(communications)
name = "Communications"
flags = SS_NO_INIT | SS_NO_FIRE
COOLDOWN_DECLARE(silicon_message_cooldown)
COOLDOWN_DECLARE(nonsilicon_message_cooldown)
/// Are we trying to send a cross-station message that contains soft-filtered words? If so, flip to TRUE to extend the time admins have to cancel the message.
var/soft_filtering = FALSE
/// A list of footnote datums, to be added to the bottom of the roundstart command report.
var/list/command_report_footnotes = list()
/// A counter of conditions that are blocking the command report from printing. Counter incremements up for every blocking condition, and de-incrememnts when it is complete.
var/block_command_report = 0
/// Has a special xenomorph egg been delivered?
var/xenomorph_egg_delivered = FALSE
/// The location where the special xenomorph egg was planted
var/area/captivity_area
/datum/controller/subsystem/communications/proc/can_announce(mob/living/user, is_silicon)
if(is_silicon && COOLDOWN_FINISHED(src, silicon_message_cooldown))
return TRUE
else if(!is_silicon && COOLDOWN_FINISHED(src, nonsilicon_message_cooldown))
return TRUE
else
return FALSE
/datum/controller/subsystem/communications/proc/make_announcement(mob/living/user, is_silicon, input, syndicate, list/players)
if(!can_announce(user, is_silicon))
return FALSE
if(is_silicon)
minor_announce(html_decode(input),"[user.name] announces:", players = players)
COOLDOWN_START(src, silicon_message_cooldown, COMMUNICATION_COOLDOWN_AI)
else
var/list/message_data = user.treat_message(input)
if(syndicate)
priority_announce(html_decode(message_data["message"]), null, 'sound/misc/announce_syndi.ogg', ANNOUNCEMENT_TYPE_SYNDICATE, has_important_message = TRUE, players = players, color_override = "red")
else
priority_announce(html_decode(message_data["message"]), null, 'sound/misc/announce.ogg', ANNOUNCEMENT_TYPE_CAPTAIN, has_important_message = TRUE, players = players)
COOLDOWN_START(src, nonsilicon_message_cooldown, COMMUNICATION_COOLDOWN)
user.log_talk(input, LOG_SAY, tag="priority announcement")
message_admins("[ADMIN_LOOKUPFLW(user)] has made a priority announcement.")
/datum/controller/subsystem/communications/proc/send_message(datum/comm_message/sending,print = TRUE,unique = FALSE)
for(var/obj/machinery/computer/communications/C in GLOB.shuttle_caller_list)
if(!(C.machine_stat & (BROKEN|NOPOWER)) && is_station_level(C.z))
if(unique)
C.add_message(sending)
else //We copy the message for each console, answers and deletions won't be shared
var/datum/comm_message/M = new(sending.title,sending.content,sending.possible_answers.Copy())
C.add_message(M)
if(print)
var/obj/item/paper/printed_paper = new /obj/item/paper(C.loc)
printed_paper.name = "paper - '[sending.title]'"
printed_paper.add_raw_text(sending.content)
printed_paper.update_appearance()
#undef COMMUNICATION_COOLDOWN
#undef COMMUNICATION_COOLDOWN_AI
#undef COMMUNICATION_COOLDOWN_MEETING