mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-21 12:08:55 +01:00
Adds Custom Announcement Dividers (#79071)
This ports a whole bunch of various PRs and commits from https://github.com/effigy-se/effigy-se , with heavy refactoring to keep it fresh for /tg/'s code standards. ## About The Pull Request The whole slew of announcement touchups lately (as in #78995 (37db1ecbf8) / #79052 (12308dbd3d)) have made me realize how much this stuff sucks. The author of these new spans was advertising these in coding general, so I sat down and coded it. Look at the spans, they're much nicer than what we had going on: (ignore the capitalized alert status names, this was removed) <details> <summary>Dark Mode</summary>   </details> <details> <summary>Light Mode</summary>   </details> This PR also features * Major announcement code handling cleanup and refactor! There was a lot of copypasta so let's distill it all down into one proc * Better cacheing! We were doing a shit load of new string generation needlessly! That's fixed now. * Better string concatenation! Lists are better for string tree reasons. It still works just as well, as you can see from the screenshots above. Best of all, no fucking `<br>` dogshit everywhere! * We don't use string equivalency in order to figure out the "type" of an announcement. It's all defines now. This was a bonus that I just coded in since it irritated me. * Minor spellcheck of "announcement". * All of our HTML string mangling stuff is now all span macros! I love macros. ## Why It's Good For The Game In the same vein of adding examine blocks (#67937 (b864589522)) because old examinations tended to blend in with the chat and everything chat-wise used to suck really hard- I think this is a really nice way to draw attention to announcements in the chat box without needing a shit load of line breaks that just really look ugly and have no real consistency. You can look at the PRs/commits I linked above for an idea of just how ugly it could be getting. I haven't audited every announcement in this PR, we can tweak this down the line. ## Changelog 🆑 LT3, san7890 add: Announcements have gotten a fresh coat of paint! They should be popping with splendid new colors and should have a lot less ugly linebreaks, while still managing to keep your attention at the screen. /🆑 I know we didn't need to port all the CSS themes but I added them anyways in case admins wanna have some fun. There can probably be more code improvements, just figured I'd crack it out while I had time. The colors also seem fine, let me know if we need more redness or something. It's okay for stuff to be toned down a bit imo, but that should be done after a hot second. --------- Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com>
This commit is contained in:
@@ -38,9 +38,9 @@ SUBSYSTEM_DEF(communications)
|
||||
else
|
||||
var/list/message_data = user.treat_message(input)
|
||||
if(syndicate)
|
||||
priority_announce(html_decode(message_data["message"]), null, 'sound/misc/announce_syndi.ogg', "Syndicate Captain", has_important_message = TRUE, players = players)
|
||||
priority_announce(html_decode(message_data["message"]), null, 'sound/misc/announce_syndi.ogg', ANNOUNCEMENT_TYPE_SYNDICATE, has_important_message = TRUE, players = players)
|
||||
else
|
||||
priority_announce(html_decode(message_data["message"]), null, 'sound/misc/announce.ogg', "Captain", has_important_message = TRUE, players = players)
|
||||
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.")
|
||||
|
||||
@@ -39,7 +39,7 @@ SUBSYSTEM_DEF(security_level)
|
||||
if(!selected_level)
|
||||
CRASH("set_level was called with an invalid security level([new_level])")
|
||||
|
||||
announce_security_level(selected_level) // We want to announce BEFORE updating to the new level
|
||||
level_announce(selected_level, current_security_level.number_level) // We want to announce BEFORE updating to the new level
|
||||
|
||||
SSsecurity_level.current_security_level = selected_level
|
||||
|
||||
@@ -56,18 +56,6 @@ SUBSYSTEM_DEF(security_level)
|
||||
SSnightshift.check_nightshift()
|
||||
SSblackbox.record_feedback("tally", "security_level_changes", 1, selected_level.name)
|
||||
|
||||
/**
|
||||
* Handles announcements of the newly set security level
|
||||
*
|
||||
* Arguments:
|
||||
* * selected_level - The new security level that has been set
|
||||
*/
|
||||
/datum/controller/subsystem/security_level/proc/announce_security_level(datum/security_level/selected_level)
|
||||
if(selected_level.number_level > current_security_level.number_level) // We are elevating to this level.
|
||||
minor_announce(selected_level.elevating_to_announcemnt, "Attention! Security level elevated to [selected_level.name]:", sound_override = selected_level.sound)
|
||||
else // Going down
|
||||
minor_announce(selected_level.lowering_to_announcement, "Attention! Security level lowered to [selected_level.name]:", sound_override = selected_level.sound)
|
||||
|
||||
/**
|
||||
* Returns the current security level as a number
|
||||
*/
|
||||
|
||||
@@ -505,13 +505,13 @@ SUBSYSTEM_DEF(shuttle)
|
||||
emergency.sound_played = FALSE
|
||||
priority_announce("Hostile environment detected. \
|
||||
Departure has been postponed indefinitely pending \
|
||||
conflict resolution.", null, 'sound/misc/notice1.ogg', "Priority")
|
||||
conflict resolution.", null, 'sound/misc/notice1.ogg', ANNOUNCEMENT_TYPE_PRIORITY)
|
||||
if(!emergency_no_escape && (emergency.mode == SHUTTLE_STRANDED))
|
||||
emergency.mode = SHUTTLE_DOCKED
|
||||
emergency.setTimer(emergency_dock_time)
|
||||
priority_announce("Hostile environment resolved. \
|
||||
You have 3 minutes to board the Emergency Shuttle.",
|
||||
null, ANNOUNCER_SHUTTLEDOCK, "Priority")
|
||||
null, ANNOUNCER_SHUTTLEDOCK, ANNOUNCEMENT_TYPE_PRIORITY)
|
||||
|
||||
//try to move/request to dock_home if possible, otherwise dock_away. Mainly used for admin buttons
|
||||
/datum/controller/subsystem/shuttle/proc/toggleShuttle(shuttle_id, dock_home, dock_away, timed)
|
||||
|
||||
Reference in New Issue
Block a user