[MIRROR] Reworks the styling of the announcements and expands major announcements to also be colourable. [MDB IGNORE] (#24596)

* Reworks the styling of the announcements and expands major announcements to also be colourable.

* Skyrat edits

* Skyrat edits

---------

Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-10-26 07:22:52 +02:00
committed by GitHub
parent 7134a47470
commit 99da88db82
17 changed files with 472 additions and 116 deletions

View File

@@ -2,14 +2,19 @@
// these four are just text spans that furnish the TEXT itself with the appropriate CSS classes // these four are just text spans that furnish the TEXT itself with the appropriate CSS classes
#define MAJOR_ANNOUNCEMENT_TITLE(string) ("<span class='major_announcement_title'>" + string + "</span>") #define MAJOR_ANNOUNCEMENT_TITLE(string) ("<span class='major_announcement_title'>" + string + "</span>")
#define SUBHEADER_ANNOUNCEMENT_TITLE(string) ("<span class='subheader_announcement_text'>" + string + "</span>")
#define MAJOR_ANNOUNCEMENT_TEXT(string) ("<span class='major_announcement_text'>" + string + "</span>") #define MAJOR_ANNOUNCEMENT_TEXT(string) ("<span class='major_announcement_text'>" + string + "</span>")
#define MINOR_ANNOUNCEMENT_TITLE(string) ("<span class='minor_announcement_title'>" + string + "</span>") #define MINOR_ANNOUNCEMENT_TITLE(string) ("<span class='minor_announcement_title'>" + string + "</span>")
#define MINOR_ANNOUNCEMENT_TEXT(string) ("<span class='minor_announcement_text'>" + string + "</span>") #define MINOR_ANNOUNCEMENT_TEXT(string) ("<span class='minor_announcement_text'>" + string + "</span>")
#define ANNOUNCEMENT_HEADER(string) ("<span class='announcement_header'>" + string + "</span>")
// these two are the ones that actually give the striped background // these two are the ones that actually give the striped background
#define CHAT_ALERT_DEFAULT_SPAN(string) ("<div class='chat_alert_default'>" + string + "</div>") #define CHAT_ALERT_DEFAULT_SPAN(string) ("<div class='chat_alert_default'>" + string + "</div>")
#define CHAT_ALERT_COLORED_SPAN(color, string) ("<div class='chat_alert_" + color + "'>" + string + "</div>") #define CHAT_ALERT_COLORED_SPAN(color, string) ("<div class='chat_alert_" + color + "'>" + string + "</div>")
#define ANNOUNCEMENT_COLORS list("default", "green", "blue", "pink", "yellow", "orange", "red", "purple")
/** /**
* Make a big red text announcement to * Make a big red text announcement to
* *
@@ -32,7 +37,7 @@
* * encode_title - if TRUE, the title will be HTML encoded * * encode_title - if TRUE, the title will be HTML encoded
* * encode_text - if TRUE, the text will be HTML encoded * * encode_text - if TRUE, the text will be HTML encoded
*/ */
/proc/priority_announce(text, title = "", sound, type, sender_override, has_important_message = FALSE, list/mob/players, encode_title = TRUE, encode_text = TRUE) /proc/priority_announce(text, title = "", sound, type, sender_override, has_important_message = FALSE, list/mob/players, encode_title = TRUE, encode_text = TRUE, color_override)
if(!text) if(!text)
return return
@@ -55,7 +60,7 @@
if(ANNOUNCEMENT_TYPE_PRIORITY) if(ANNOUNCEMENT_TYPE_PRIORITY)
header = MAJOR_ANNOUNCEMENT_TITLE("Priority Announcement") header = MAJOR_ANNOUNCEMENT_TITLE("Priority Announcement")
if(length(title) > 0) if(length(title) > 0)
header += MINOR_ANNOUNCEMENT_TITLE(title) header += SUBHEADER_ANNOUNCEMENT_TITLE(title)
if(ANNOUNCEMENT_TYPE_CAPTAIN) if(ANNOUNCEMENT_TYPE_CAPTAIN)
header = MAJOR_ANNOUNCEMENT_TITLE("Captain's Announcement") header = MAJOR_ANNOUNCEMENT_TITLE("Captain's Announcement")
GLOB.news_network.submit_article(text, "Captain's Announcement", "Station Announcements", null) GLOB.news_network.submit_article(text, "Captain's Announcement", "Station Announcements", null)
@@ -64,15 +69,19 @@
else else
header += generate_unique_announcement_header(title, sender_override) header += generate_unique_announcement_header(title, sender_override)
announcement_strings += header announcement_strings += ANNOUNCEMENT_HEADER(header)
///If the announcer overrides alert messages, use that message. ///If the announcer overrides alert messages, use that message.
if(SSstation.announcer.custom_alert_message && !has_important_message) if(SSstation.announcer.custom_alert_message && !has_important_message)
announcement_strings += SSstation.announcer.custom_alert_message announcement_strings += MAJOR_ANNOUNCEMENT_TEXT(SSstation.announcer.custom_alert_message)
else else
announcement_strings += MAJOR_ANNOUNCEMENT_TEXT(text) announcement_strings += MAJOR_ANNOUNCEMENT_TEXT(text)
var/finalized_announcement = CHAT_ALERT_DEFAULT_SPAN(jointext(announcement_strings, "<br>")) var/finalized_announcement
if(color_override)
finalized_announcement = CHAT_ALERT_COLORED_SPAN(color_override, jointext(announcement_strings, ""))
else
finalized_announcement = CHAT_ALERT_DEFAULT_SPAN(jointext(announcement_strings, ""))
dispatch_announcement_to_players(finalized_announcement, players, sound) dispatch_announcement_to_players(finalized_announcement, players, sound)
@@ -118,14 +127,15 @@
message = html_encode(message) message = html_encode(message)
var/list/minor_announcement_strings = list() var/list/minor_announcement_strings = list()
minor_announcement_strings += MINOR_ANNOUNCEMENT_TITLE(title) if(title != null && title != "")
minor_announcement_strings += ANNOUNCEMENT_HEADER(MINOR_ANNOUNCEMENT_TITLE(title))
minor_announcement_strings += MINOR_ANNOUNCEMENT_TEXT(message) minor_announcement_strings += MINOR_ANNOUNCEMENT_TEXT(message)
var/finalized_announcement var/finalized_announcement
if(color_override) if(color_override)
finalized_announcement = CHAT_ALERT_COLORED_SPAN(color_override, jointext(minor_announcement_strings, "<br>")) finalized_announcement = CHAT_ALERT_COLORED_SPAN(color_override, jointext(minor_announcement_strings, ""))
else else
finalized_announcement = CHAT_ALERT_DEFAULT_SPAN(jointext(minor_announcement_strings, "<br>")) finalized_announcement = CHAT_ALERT_DEFAULT_SPAN(jointext(minor_announcement_strings, ""))
var/custom_sound = sound_override || (alert ? 'modular_skyrat/modules/alerts/sound/alerts/alert1.ogg' : 'sound/misc/notice2.ogg') // SKYRAT EDIT CHANGE - CUSTOM ANNOUNCEMENTS - Original: 'sound/misc/notice1.ogg' var/custom_sound = sound_override || (alert ? 'modular_skyrat/modules/alerts/sound/alerts/alert1.ogg' : 'sound/misc/notice2.ogg') // SKYRAT EDIT CHANGE - CUSTOM ANNOUNCEMENTS - Original: 'sound/misc/notice1.ogg'
dispatch_announcement_to_players(finalized_announcement, players, custom_sound, should_play_sound) dispatch_announcement_to_players(finalized_announcement, players, custom_sound, should_play_sound)
@@ -148,10 +158,10 @@
message = selected_level.lowering_to_announcement message = selected_level.lowering_to_announcement
var/list/level_announcement_strings = list() var/list/level_announcement_strings = list()
level_announcement_strings += MINOR_ANNOUNCEMENT_TITLE(title) level_announcement_strings += ANNOUNCEMENT_HEADER(MINOR_ANNOUNCEMENT_TITLE(title))
level_announcement_strings += MINOR_ANNOUNCEMENT_TEXT(message) level_announcement_strings += MINOR_ANNOUNCEMENT_TEXT(message)
var/finalized_announcement = CHAT_ALERT_COLORED_SPAN(current_level_color, jointext(level_announcement_strings, "<br>")) var/finalized_announcement = CHAT_ALERT_COLORED_SPAN(current_level_color, jointext(level_announcement_strings, ""))
dispatch_announcement_to_players(finalized_announcement, GLOB.player_list, current_level_sound) dispatch_announcement_to_players(finalized_announcement, GLOB.player_list, current_level_sound)
@@ -165,9 +175,9 @@
returnable_strings += MAJOR_ANNOUNCEMENT_TITLE(sender_override) returnable_strings += MAJOR_ANNOUNCEMENT_TITLE(sender_override)
if(length(title) > 0) if(length(title) > 0)
returnable_strings += MINOR_ANNOUNCEMENT_TITLE(title) returnable_strings += SUBHEADER_ANNOUNCEMENT_TITLE(title)
return jointext(returnable_strings, "<br>") return jointext(returnable_strings, "")
/// Proc that just dispatches the announcement to our applicable audience. Only the announcement is a mandatory arg. /// Proc that just dispatches the announcement to our applicable audience. Only the announcement is a mandatory arg.
/proc/dispatch_announcement_to_players(announcement, list/players, sound_override = null, should_play_sound = TRUE) /proc/dispatch_announcement_to_players(announcement, list/players, sound_override = null, should_play_sound = TRUE)

View File

@@ -38,7 +38,7 @@ SUBSYSTEM_DEF(communications)
else else
var/list/message_data = user.treat_message(input) var/list/message_data = user.treat_message(input)
if(syndicate) if(syndicate)
priority_announce(html_decode(message_data["message"]), null, 'sound/misc/announce_syndi.ogg', ANNOUNCEMENT_TYPE_SYNDICATE, 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, color_override = "red")
else else
priority_announce(html_decode(message_data["message"]), null, ANNOUNCER_CAPTAIN, ANNOUNCEMENT_TYPE_CAPTAIN, has_important_message = TRUE, players = players) // SKYRAT EDIT CHANGE - 'sound/misc/announce.ogg' to ANNOUNCER_CAPTAIN priority_announce(html_decode(message_data["message"]), null, ANNOUNCER_CAPTAIN, ANNOUNCEMENT_TYPE_CAPTAIN, has_important_message = TRUE, players = players) // SKYRAT EDIT CHANGE - 'sound/misc/announce.ogg' to ANNOUNCER_CAPTAIN
COOLDOWN_START(src, nonsilicon_message_cooldown, COMMUNICATION_COOLDOWN) COOLDOWN_START(src, nonsilicon_message_cooldown, COMMUNICATION_COOLDOWN)

View File

@@ -50,6 +50,10 @@
var/print_report = TRUE var/print_report = TRUE
/// The sound that's going to accompany our message. /// The sound that's going to accompany our message.
var/played_sound = DEFAULT_ANNOUNCEMENT_SOUND var/played_sound = DEFAULT_ANNOUNCEMENT_SOUND
/// The colour of the announcement when sent
var/announcement_color = "default"
/// The subheader to include when sending the announcement. Keep blank to not include a subheader
var/subheader = ""
/// A static list of preset names that can be chosen. /// A static list of preset names that can be chosen.
var/list/preset_names = list(CENTCOM_PRESET, SYNDICATE_PRESET, WIZARD_PRESET, CUSTOM_PRESET) var/list/preset_names = list(CENTCOM_PRESET, SYNDICATE_PRESET, WIZARD_PRESET, CUSTOM_PRESET)
@@ -79,6 +83,8 @@
data["announce_contents"] = announce_contents data["announce_contents"] = announce_contents
data["print_report"] = print_report data["print_report"] = print_report
data["played_sound"] = played_sound data["played_sound"] = played_sound
data["announcement_color"] = announcement_color
data["subheader"] = subheader
return data return data
@@ -86,6 +92,7 @@
var/list/data = list() var/list/data = list()
data["command_name_presets"] = preset_names data["command_name_presets"] = preset_names
data["announcer_sounds"] = list(DEFAULT_ANNOUNCEMENT_SOUND) + GLOB.announcer_keys data["announcer_sounds"] = list(DEFAULT_ANNOUNCEMENT_SOUND) + GLOB.announcer_keys
data["announcement_colors"] = ANNOUNCEMENT_COLORS
return data return data
@@ -108,6 +115,13 @@
announce_contents = !announce_contents announce_contents = !announce_contents
if("toggle_printing") if("toggle_printing")
print_report = !print_report print_report = !print_report
if("update_announcement_color")
var/colors = ANNOUNCEMENT_COLORS
var/chosen_color = params["updated_announcement_color"]
if(chosen_color in colors)
announcement_color = chosen_color
if("set_subheader")
subheader = params["new_subheader"]
if("submit_report") if("submit_report")
if(!command_name) if(!command_name)
to_chat(ui_user, span_danger("You can't send a report with no command name.")) to_chat(ui_user, span_danger("You can't send a report with no command name."))
@@ -136,7 +150,13 @@
report_sound = SSstation.announcer.get_rand_report_sound() report_sound = SSstation.announcer.get_rand_report_sound()
if(announce_contents) if(announce_contents)
priority_announce(command_report_content, null, report_sound, has_important_message = TRUE) var/chosen_color = announcement_color
if(chosen_color == "default")
if(command_name == SYNDICATE_PRESET)
chosen_color = "red"
else if(command_name == WIZARD_PRESET)
chosen_color = "purple"
priority_announce(command_report_content, subheader == ""? null : subheader, report_sound, has_important_message = TRUE, color_override = chosen_color)
if(!announce_contents || print_report) if(!announce_contents || print_report)
print_command_report(command_report_content, "[announce_contents ? "" : "Classified "][command_name] Update", !announce_contents) print_command_report(command_report_content, "[announce_contents ? "" : "Classified "][command_name] Update", !announce_contents)

View File

@@ -73,7 +73,7 @@ GLOBAL_LIST_EMPTY(jam_on_wardec)
war_was_declared(memo = war_declaration) war_was_declared(memo = war_declaration)
/obj/item/nuclear_challenge/proc/war_was_declared(mob/living/user, memo) /obj/item/nuclear_challenge/proc/war_was_declared(mob/living/user, memo)
priority_announce(memo, title = "Declaration of War", sound = 'sound/machines/alarm.ogg', has_important_message = TRUE) priority_announce(memo, title = "Declaration of War", sound = 'sound/machines/alarm.ogg', has_important_message = TRUE, sender_override = "Nuclear Operative Outpost", color_override = "red")
if(user) if(user)
to_chat(user, "You've attracted the attention of powerful forces within the syndicate. \ to_chat(user, "You've attracted the attention of powerful forces within the syndicate. \
A bonus bundle of telecrystals has been granted to your team. Great things await you if you complete the mission.") A bonus bundle of telecrystals has been granted to your team. Great things await you if you complete the mission.")
@@ -168,7 +168,7 @@ GLOBAL_LIST_EMPTY(jam_on_wardec)
return return
#endif #endif
priority_announce(memo, title = "Declaration of War", sound = 'sound/machines/alarm.ogg', has_important_message = TRUE) priority_announce(memo, title = "Declaration of War", sound = 'sound/machines/alarm.ogg', has_important_message = TRUE, sender_override = "Nuclear Operative Outpost", color_override = "red")
/obj/item/nuclear_challenge/literally_just_does_the_message/distribute_tc() /obj/item/nuclear_challenge/literally_just_does_the_message/distribute_tc()
return return

View File

@@ -42,7 +42,7 @@
/proc/pirates_answered(datum/comm_message/threat, datum/pirate_gang/chosen_gang, payoff, initial_send_time) /proc/pirates_answered(datum/comm_message/threat, datum/pirate_gang/chosen_gang, payoff, initial_send_time)
if(world.time > initial_send_time + RESPONSE_MAX_TIME) if(world.time > initial_send_time + RESPONSE_MAX_TIME)
priority_announce(chosen_gang.response_too_late, sender_override = chosen_gang.ship_name) priority_announce(chosen_gang.response_too_late, sender_override = chosen_gang.ship_name, color_override = chosen_gang.announcement_color)
return return
if(!threat?.answered) if(!threat?.answered)
return return
@@ -51,9 +51,9 @@
if(plundered_account) if(plundered_account)
if(plundered_account.adjust_money(-payoff)) if(plundered_account.adjust_money(-payoff))
chosen_gang.paid_off = TRUE chosen_gang.paid_off = TRUE
priority_announce(chosen_gang.response_received, sender_override = chosen_gang.ship_name) priority_announce(chosen_gang.response_received, sender_override = chosen_gang.ship_name, color_override = chosen_gang.announcement_color)
else else
priority_announce(chosen_gang.response_not_enough, sender_override = chosen_gang.ship_name) priority_announce(chosen_gang.response_not_enough, sender_override = chosen_gang.ship_name, color_override = chosen_gang.announcement_color)
/proc/spawn_pirates(datum/comm_message/threat, datum/pirate_gang/chosen_gang) /proc/spawn_pirates(datum/comm_message/threat, datum/pirate_gang/chosen_gang)
if(chosen_gang.paid_off) if(chosen_gang.paid_off)

View File

@@ -47,6 +47,8 @@ GLOBAL_LIST_INIT(heavy_pirate_gangs, init_pirate_gangs(is_heavy = TRUE))
/// Have the pirates been paid off? /// Have the pirates been paid off?
var/paid_off = FALSE var/paid_off = FALSE
/// The colour of their announcements when sent to players
var/announcement_color = "red"
/datum/pirate_gang/New() /datum/pirate_gang/New()
. = ..() . = ..()
@@ -133,6 +135,7 @@ GLOBAL_LIST_INIT(heavy_pirate_gangs, init_pirate_gangs(is_heavy = TRUE))
response_received = "Thank you for your generosity. Your money will not be wasted." response_received = "Thank you for your generosity. Your money will not be wasted."
response_too_late = "We hope you like skin cancer!" response_too_late = "We hope you like skin cancer!"
response_not_enough = "This is not nearly enough for our operations. I'm afraid we'll have to borrow some." response_not_enough = "This is not nearly enough for our operations. I'm afraid we'll have to borrow some."
announcement_color = "purple"
///Previous Nanotrasen Assitant workers fired for many reasons now looking for revenge and your bank account. ///Previous Nanotrasen Assitant workers fired for many reasons now looking for revenge and your bank account.
/datum/pirate_gang/grey /datum/pirate_gang/grey
@@ -150,6 +153,7 @@ GLOBAL_LIST_INIT(heavy_pirate_gangs, init_pirate_gangs(is_heavy = TRUE))
response_received = "Wait, you ACTUALLY gave us the money? Thanks, but we're coming for the rest anyways!" response_received = "Wait, you ACTUALLY gave us the money? Thanks, but we're coming for the rest anyways!"
response_too_late = "Nothing, huh? Looks like the Tide's coming aboard!" response_too_late = "Nothing, huh? Looks like the Tide's coming aboard!"
response_not_enough = "You trying to cheat us? That's fine, we'll take your station as collateral." response_not_enough = "You trying to cheat us? That's fine, we'll take your station as collateral."
announcement_color = "yellow"
///Agents from the space I.R.S. heavily armed to stea- I mean, collect the station's tax dues ///Agents from the space I.R.S. heavily armed to stea- I mean, collect the station's tax dues
@@ -173,6 +177,7 @@ GLOBAL_LIST_INIT(heavy_pirate_gangs, init_pirate_gangs(is_heavy = TRUE))
response_too_late = "Too late, A team has already been sent out resolve this matter directly." response_too_late = "Too late, A team has already been sent out resolve this matter directly."
response_not_enough = "You filed your taxes incorrectly, A team has been sent to assist in liquidating assets and arrest you for tax fraud. \ response_not_enough = "You filed your taxes incorrectly, A team has been sent to assist in liquidating assets and arrest you for tax fraud. \
Nothing personel kid." Nothing personel kid."
announcement_color = "yellow"
//Mutated Ethereals who have adopted bluespace technology in all the wrong ways. //Mutated Ethereals who have adopted bluespace technology in all the wrong ways.
/datum/pirate_gang/lustrous /datum/pirate_gang/lustrous
@@ -191,3 +196,4 @@ GLOBAL_LIST_INIT(heavy_pirate_gangs, init_pirate_gangs(is_heavy = TRUE))
response_received = "An excellent haul, the synthesis shall resume." response_received = "An excellent haul, the synthesis shall resume."
response_too_late = "You were not ready then, and now that time has passed. We can only go forward, never back." response_too_late = "You were not ready then, and now that time has passed. We can only go forward, never back."
response_not_enough = "You have insulted us, but there shall be no feud, only swift justice!" response_not_enough = "You have insulted us, but there shall be no feud, only swift justice!"
announcement_color = "purple"

View File

@@ -14,4 +14,4 @@
target_door.req_one_access = list() target_door.req_one_access = list()
INVOKE_ASYNC(target_door, TYPE_PROC_REF(/obj/machinery/door/airlock, open)) INVOKE_ASYNC(target_door, TYPE_PROC_REF(/obj/machinery/door/airlock, open))
CHECK_TICK CHECK_TICK
priority_announce("AULIE OXIN FIERA!!", null, 'sound/magic/knock.ogg', sender_override = "[invoker.real_name]") priority_announce("AULIE OXIN FIERA!!", null, 'sound/magic/knock.ogg', sender_override = "[invoker.real_name]", color_override = "purple")

View File

@@ -31,7 +31,7 @@
) )
/datum/grand_finale/armageddon/trigger(mob/living/carbon/human/invoker) /datum/grand_finale/armageddon/trigger(mob/living/carbon/human/invoker)
priority_announce(pick(possible_last_words), null, 'sound/magic/voidblink.ogg', sender_override = "[invoker.real_name]") priority_announce(pick(possible_last_words), null, 'sound/magic/voidblink.ogg', sender_override = "[invoker.real_name]", color_override = "purple")
var/turf/current_location = get_turf(invoker) var/turf/current_location = get_turf(invoker)
invoker.gib(DROP_ALL_REMAINS) invoker.gib(DROP_ALL_REMAINS)

View File

@@ -47,12 +47,12 @@
/datum/round_event/shuttle_insurance/proc/answered() /datum/round_event/shuttle_insurance/proc/answered()
if(EMERGENCY_AT_LEAST_DOCKED) if(EMERGENCY_AT_LEAST_DOCKED)
priority_announce("You are definitely too late to purchase insurance, my friends. Our agents don't work on site.",sender_override = ship_name) priority_announce("You are definitely too late to purchase insurance, my friends. Our agents don't work on site.",sender_override = ship_name, color_override = "red")
return return
if(insurance_message && insurance_message.answered == 1) if(insurance_message && insurance_message.answered == 1)
var/datum/bank_account/station_balance = SSeconomy.get_dep_account(ACCOUNT_CAR) var/datum/bank_account/station_balance = SSeconomy.get_dep_account(ACCOUNT_CAR)
if(!station_balance?.adjust_money(-insurance_evaluation)) if(!station_balance?.adjust_money(-insurance_evaluation))
priority_announce("You didn't send us enough money for shuttle insurance. This, in the space layman's terms, is considered scamming. We're keeping your money, scammers!",sender_override = ship_name) priority_announce("You didn't send us enough money for shuttle insurance. This, in the space layman's terms, is considered scamming. We're keeping your money, scammers!", sender_override = ship_name, color_override = "red")
return return
priority_announce("Thank you for purchasing shuttle insurance!",sender_override = ship_name) priority_announce("Thank you for purchasing shuttle insurance!", sender_override = ship_name, color_override = "red")
SSshuttle.shuttle_insurance = TRUE SSshuttle.shuttle_insurance = TRUE

View File

@@ -268,7 +268,7 @@
flashwindow = TRUE, flashwindow = TRUE,
ignore_mapload = TRUE, ignore_mapload = TRUE,
ignore_key, ignore_key,
header, header = "",
notify_suiciders = TRUE, notify_suiciders = TRUE,
notify_volume = 100 notify_volume = 100
) )

View File

@@ -359,7 +359,7 @@
SSshuttle.emergency_last_call_loc = null SSshuttle.emergency_last_call_loc = null
if(!silent) // SKYRAT EDIT ADDITION if(!silent) // SKYRAT EDIT ADDITION
priority_announce("The emergency shuttle has been called. [red_alert ? "Red Alert state confirmed: Dispatching priority shuttle. " : "" ]It will arrive in [timeLeft(600)] minutes.[reason][SSshuttle.emergency_last_call_loc ? "\n\nCall signal traced. Results can be viewed on any communications console." : "" ][SSshuttle.admin_emergency_no_recall ? "\n\nWarning: Shuttle recall subroutines disabled; Recall not possible." : ""]", null, ANNOUNCER_SHUTTLECALLED, ANNOUNCEMENT_TYPE_PRIORITY) priority_announce("The emergency shuttle has been called. [red_alert ? "Red Alert state confirmed: Dispatching priority shuttle. " : "" ]It will arrive in [timeLeft(600)] minutes.[reason][SSshuttle.emergency_last_call_loc ? "\n\nCall signal traced. Results can be viewed on any communications console." : "" ][SSshuttle.admin_emergency_no_recall ? "\n\nWarning: Shuttle recall subroutines disabled; Recall not possible." : ""]", null, ANNOUNCER_SHUTTLECALLED, ANNOUNCEMENT_TYPE_PRIORITY, color_override = "orange")
/obj/docking_port/mobile/emergency/cancel(area/signalOrigin) /obj/docking_port/mobile/emergency/cancel(area/signalOrigin)
if(mode != SHUTTLE_CALL) if(mode != SHUTTLE_CALL)
@@ -374,7 +374,7 @@
SSshuttle.emergency_last_call_loc = signalOrigin SSshuttle.emergency_last_call_loc = signalOrigin
else else
SSshuttle.emergency_last_call_loc = null SSshuttle.emergency_last_call_loc = null
priority_announce("The emergency shuttle has been recalled.[SSshuttle.emergency_last_call_loc ? " Recall signal traced. Results can be viewed on any communications console." : "" ]", null, ANNOUNCER_SHUTTLERECALLED, ANNOUNCEMENT_TYPE_PRIORITY) priority_announce("The emergency shuttle has been recalled.[SSshuttle.emergency_last_call_loc ? " Recall signal traced. Results can be viewed on any communications console." : "" ]", null, ANNOUNCER_SHUTTLERECALLED, ANNOUNCEMENT_TYPE_PRIORITY, color_override = "orange")
SSticker.emergency_reason = null SSticker.emergency_reason = null
@@ -463,7 +463,7 @@
mode = SHUTTLE_DOCKED mode = SHUTTLE_DOCKED
setTimer(SSshuttle.emergency_dock_time) setTimer(SSshuttle.emergency_dock_time)
send2adminchat("Server", "The Emergency Shuttle has docked with the station.") send2adminchat("Server", "The Emergency Shuttle has docked with the station.")
priority_announce("[SSshuttle.emergency] has docked with the station. You have [timeLeft(600)] minutes to board the Emergency Shuttle.", null, ANNOUNCER_SHUTTLEDOCK, ANNOUNCEMENT_TYPE_PRIORITY) priority_announce("[SSshuttle.emergency] has docked with the station. You have [timeLeft(600)] minutes to board the Emergency Shuttle.", null, ANNOUNCER_SHUTTLEDOCK, ANNOUNCEMENT_TYPE_PRIORITY, color_override = "orange")
ShuttleDBStuff() ShuttleDBStuff()
addtimer(CALLBACK(src, PROC_REF(announce_shuttle_events)), 20 SECONDS) addtimer(CALLBACK(src, PROC_REF(announce_shuttle_events)), 20 SECONDS)
@@ -516,7 +516,7 @@
mode = SHUTTLE_ESCAPE mode = SHUTTLE_ESCAPE
launch_status = ENDGAME_LAUNCHED launch_status = ENDGAME_LAUNCHED
setTimer(SSshuttle.emergency_escape_time * engine_coeff) setTimer(SSshuttle.emergency_escape_time * engine_coeff)
priority_announce("The Emergency Shuttle has left the station. Estimate [timeLeft(600)] minutes until the shuttle docks at Central Command.", null, null, ANNOUNCEMENT_TYPE_PRIORITY) priority_announce("The Emergency Shuttle has left the station. Estimate [timeLeft(600)] minutes until the shuttle docks at Central Command.", null, null, ANNOUNCEMENT_TYPE_PRIORITY, color_override = "orange")
INVOKE_ASYNC(SSticker, TYPE_PROC_REF(/datum/controller/subsystem/ticker, poll_hearts)) INVOKE_ASYNC(SSticker, TYPE_PROC_REF(/datum/controller/subsystem/ticker, poll_hearts))
bolt_all_doors() //SKYRAT EDIT ADDITION bolt_all_doors() //SKYRAT EDIT ADDITION
SSmapping.mapvote() //If no map vote has been run yet, start one. SSmapping.mapvote() //If no map vote has been run yet, start one.
@@ -584,7 +584,7 @@
mode = SHUTTLE_ESCAPE mode = SHUTTLE_ESCAPE
launch_status = ENDGAME_LAUNCHED launch_status = ENDGAME_LAUNCHED
setTimer(SSshuttle.emergency_escape_time) setTimer(SSshuttle.emergency_escape_time)
priority_announce("The Emergency Shuttle is preparing for direct jump. Estimate [timeLeft(600)] minutes until the shuttle docks at Central Command.", null, null, ANNOUNCEMENT_TYPE_PRIORITY) priority_announce("The Emergency Shuttle is preparing for direct jump. Estimate [timeLeft(600)] minutes until the shuttle docks at Central Command.", null, null, ANNOUNCEMENT_TYPE_PRIORITY, color_override = "orange")
///Generate a list of events to run during the departure ///Generate a list of events to run during the departure
/obj/docking_port/mobile/emergency/proc/setup_shuttle_events() /obj/docking_port/mobile/emergency/proc/setup_shuttle_events()

View File

@@ -4,7 +4,7 @@
/datum/controller/subsystem/shuttle/proc/autoEnd() /datum/controller/subsystem/shuttle/proc/autoEnd()
if(EMERGENCY_IDLE_OR_RECALLED) if(EMERGENCY_IDLE_OR_RECALLED)
SSshuttle.emergency.request(silent = TRUE) SSshuttle.emergency.request(silent = TRUE)
priority_announce("The shift has come to an end and the shuttle called. [SSsecurity_level.get_current_level_as_number() == SEC_LEVEL_RED ? "Red Alert state confirmed: Dispatching priority shuttle. " : "" ]It will arrive in [emergency.timeLeft(600)] minutes.", null, ANNOUNCER_SHUTTLECALLED, "Priority") priority_announce("The shift has come to an end and the shuttle called. [SSsecurity_level.get_current_level_as_number() == SEC_LEVEL_RED ? "Red Alert state confirmed: Dispatching priority shuttle. " : "" ]It will arrive in [emergency.timeLeft(600)] minutes.", null, ANNOUNCER_SHUTTLECALLED, "Priority", color_override = "orange")
log_game("Round end vote passed. Shuttle has been auto-called.") log_game("Round end vote passed. Shuttle has been auto-called.")
message_admins("Round end vote passed. Shuttle has been auto-called.") message_admins("Round end vote passed. Shuttle has been auto-called.")
emergency_no_recall = TRUE emergency_no_recall = TRUE

View File

@@ -59,6 +59,7 @@ GLOBAL_VAR(first_officer)
response_received = "Should be it, thank you for cooperation. Novaya Rossiyskaya Imperiya collegial secretary out." response_received = "Should be it, thank you for cooperation. Novaya Rossiyskaya Imperiya collegial secretary out."
response_too_late = "Your response was very delayed. We have been instructed to send in the patrol ship for second attempt negotiations, stand by." response_too_late = "Your response was very delayed. We have been instructed to send in the patrol ship for second attempt negotiations, stand by."
response_not_enough = "Your bank balance does not hold enough money at the moment or the system has been overriden. We are sending a patrol ship for second attempt negotiations, stand by." response_not_enough = "Your bank balance does not hold enough money at the moment or the system has been overriden. We are sending a patrol ship for second attempt negotiations, stand by."
announcement_color = "purple"
/datum/pirate_gang/nri_raiders/generate_message(payoff) /datum/pirate_gang/nri_raiders/generate_message(payoff)
var/number = rand(1,99) var/number = rand(1,99)
@@ -520,9 +521,9 @@ GLOBAL_VAR(first_officer)
/obj/machinery/shuttle_scrambler/nri/send_notification() /obj/machinery/shuttle_scrambler/nri/send_notification()
if(active) if(active)
priority_announce("We're intercepting all of the current and future supply deliveries until you're more cooperative with the dispatch. So, please do be.","NRI IAC HQ",ANNOUNCER_NRI_RAIDERS,"Priority") priority_announce("We're intercepting all of the current and future supply deliveries until you're more cooperative with the dispatch. So, please do be.","NRI IAC HQ",ANNOUNCER_NRI_RAIDERS,"Priority", color_override = "purple")
else else
priority_announce("We've received a signal to stop the blockade; you're once again free to do whatever you were doing before.","NRI IAC HQ",ANNOUNCER_NRI_RAIDERS,"Priority") priority_announce("We've received a signal to stop the blockade; you're once again free to do whatever you were doing before.","NRI IAC HQ",ANNOUNCER_NRI_RAIDERS,"Priority", color_override = "purple")
/datum/antagonist/cop /datum/antagonist/cop
name = "\improper NRI Police Officer" name = "\improper NRI Police Officer"

View File

@@ -142,7 +142,7 @@ GLOBAL_LIST_INIT(call911_do_and_do_not, list(
poll_question = "The station has ordered $35,000 in pizza. Will you deliver?" poll_question = "The station has ordered $35,000 in pizza. Will you deliver?"
cell_phone_number = "Dogginos" cell_phone_number = "Dogginos"
list_to_use = "dogginos" list_to_use = "dogginos"
priority_announce(announcement_message, announcer, 'sound/effects/families_police.ogg', has_important_message=TRUE) priority_announce(announcement_message, announcer, 'sound/effects/families_police.ogg', has_important_message=TRUE, color_override = "yellow")
var/list/candidates = poll_ghost_candidates(poll_question, "deathsquad") var/list/candidates = poll_ghost_candidates(poll_question, "deathsquad")
if(candidates.len) if(candidates.len)
@@ -565,7 +565,7 @@ GLOBAL_LIST_INIT(call911_do_and_do_not, list(
var/datum/bank_account/station_balance = SSeconomy.get_dep_account(ACCOUNT_CAR) var/datum/bank_account/station_balance = SSeconomy.get_dep_account(ACCOUNT_CAR)
station_balance?.adjust_money(SOLFED_FINE_AMOUNT) // paying for the gas to drive all the fuckin' way out to the frontier station_balance?.adjust_money(SOLFED_FINE_AMOUNT) // paying for the gas to drive all the fuckin' way out to the frontier
priority_announce(announcement_message, announcement_source, 'sound/effects/families_police.ogg', has_important_message = TRUE) priority_announce(announcement_message, announcement_source, 'sound/effects/families_police.ogg', has_important_message = TRUE, color_override = "yellow")
var/list/candidates = poll_ghost_candidates(ghost_poll_msg, jobban_to_check) var/list/candidates = poll_ghost_candidates(ghost_poll_msg, jobban_to_check)
if(candidates.len) if(candidates.len)

View File

@@ -4,6 +4,7 @@
*/ */
@use 'sass:map'; @use 'sass:map';
@use 'sass:color';
em { em {
font-style: normal; font-style: normal;
@@ -1044,70 +1045,201 @@ em {
border-bottom: 1px dashed #fff; border-bottom: 1px dashed #fff;
} }
.major_announcement_title { // SKYRAT EDIT CHANGE BEGIN - Remove neon colors, replaced with less saturated
color: #cc0000; // SKYRAT EDIT CHANGE - ORIGINAL: color: #ff0066 /*
text-decoration: underline;
font-weight: bold;
font-size: 175%;
}
.major_announcement_text {
color: #eaeaea;
font-weight: bold;
font-size: 125%;
}
.minor_announcement_title {
color: #33d5ff;
font-weight: bold;
font-size: 150%;
}
.minor_announcement_text {
color: #eaeaea;
font-size: 125%;
}
$alert-stripe-colors: ( $alert-stripe-colors: (
'default': #292929, 'default': #00283a,
'green': #003d00, 'green': #003d00,
'blue': #00283a, 'blue': #00283a,
'pink': #30001b, 'pink': #30001b,
'yellow': #574a00, 'yellow': #574a00,
'orange': #593400, 'orange': #593400,
'red': #540000, 'red': #420000,
'purple': #2c0030, 'purple': #2c0030,
); );
$alert-background-colors: ( $alert-stripe-alternate-colors: (
'default': #252525, 'default': #003045,
'green': #003800, 'green': #004700,
'blue': #003045, 'blue': #003045,
'pink': #400025, 'pink': #400025,
'yellow': #4d4100, 'yellow': #4d4100,
'orange': #6b4200, 'orange': #6b4200,
'red': #6b0000, 'red': #520000,
'purple': #3a0040, 'purple': #38003d,
); );
$alert-major-header-colors: (
'default': #33d5ff,
'green': #00ff80,
'blue': #33d5ff,
'pink': #ff80b3,
'yellow': #fff4e0,
'orange': #feefe7,
'red': #ffa8c4,
'purple': #c7a1f7,
);
$alert-subheader-header-colors: (
'default': #ff9ebb,
'green': #ffb3c9,
'blue': #ff9ebb,
'pink': #75e3ff,
'yellow': #75e3ff,
'orange': #bdf1ff,
'red': #75e3ff,
'purple': #75e3ff,
);
*/
$alert-stripe-colors: (
'default': #0e152c,
'green': #0f2e0f,
'blue': #121c3a,
'pink': #240c19,
'yellow': #574a00,
'orange': #431b16,
'red': #420000,
'purple': #220c24,
);
$alert-stripe-alternate-colors: (
'default': #111934,
'green': #123512,
'blue': #151f41,
'pink': #301022,
'yellow': #4d4100,
'orange': #50211b,
'red': #520000,
'purple': #2b0f2e,
);
$alert-major-header-colors: (
'default': #94a5db,
'green': #00a854,
'blue': #94a5db,
'pink': #e990c3,
'yellow': #e6af4c,
'orange': #e79f79,
'red': #ff4542,
'purple': #bf9cde,
);
$alert-subheader-header-colors: (
'default': #c5ba7c,
'green': #d5a0a0,
'blue': #c5ba7c,
'pink': #f7cfcf,
'yellow': #ffddbd,
'orange': #ffddbd,
'red': #e9aa72,
'purple': #f7cfcf,
);
// SKYRAT EDIT CHANGE END
$border-width: 4;
$border-width-px: $border-width * 1px;
.major_announcement_title {
font-size: 175%;
padding: 0rem 0.5rem;
line-height: 100%;
text-align: left;
text-decoration: none;
width: 100%;
}
.subheader_announcement_text {
font-weight: bold;
padding: 0 0.5rem;
padding-top: 0.25rem;
line-height: 100%;
width: 100%;
height: 100%;
text-align: left;
font-size: 125%;
}
.major_announcement_text {
color: #eaeaea;
background-color: #131313;
font-weight: bold;
font-size: 100%;
text-align: left;
padding: 0.5rem 0.5rem;
width: 100%;
height: 100%;
}
.minor_announcement_title {
font-weight: bold;
padding: 0 0.5rem;
padding-top: 0;
line-height: 100%;
width: 100%;
height: 100%;
text-align: left;
font-size: 150%;
}
.minor_announcement_text {
background-color: #202020;
color: #eaeaea;
padding: 0.5rem 0.5rem;
text-align: left;
font-size: 100%;
}
.announcement_header {
padding: 0.5rem 0;
display: flex;
flex-direction: column;
}
@each $color-name, $color-value in $alert-stripe-colors { @each $color-name, $color-value in $alert-stripe-colors {
.chat_alert_#{$color-name} { .chat_alert_#{$color-name} {
color: #ffffff; color: #ffffff;
padding: 0.5em 0.5em; padding: 0.5rem 0.5rem;
margin-bottom: 0.5em;
box-shadow: none; box-shadow: none;
font-weight: bold; font-weight: bold;
border: 1px solid $color-value; margin: 1rem 0 1rem 0;
margin: 0.5em 0 0.5em 0; padding: 0;
padding: 0.5em 0.75em; display: flex;
background-color: map.get($alert-background-colors, $color-name); flex-direction: column;
background-image: repeating-linear-gradient( border-image: repeating-linear-gradient(
-45deg, -45deg,
transparent, map.get($alert-stripe-alternate-colors, $color-name),
transparent 10px, map.get($alert-stripe-alternate-colors, $color-name) 10px,
$color-value 10px, $color-value 10px,
$color-value 20px $color-value 20px
); );
border-image-slice: $border-width fill;
border-width: $border-width-px;
border-image-width: $border-width-px;
border-image-outset: 0 0 0 0;
border-image-repeat: repeat repeat;
border-style: solid;
}
.chat_alert_#{$color-name} .major_announcement_title {
color: map.get($alert-major-header-colors, $color-name);
}
.chat_alert_#{$color-name} .minor_announcement_title {
color: map.get($alert-major-header-colors, $color-name);
}
.chat_alert_#{$color-name} .subheader_announcement_text {
color: map.get($alert-subheader-header-colors, $color-name);
}
.chat_alert_#{$color-name} .minor_announcement_text {
background-color: darken(map.get($alert-stripe-colors, $color-name), 5);
}
.chat_alert_#{$color-name} .major_announcement_text {
background-color: darken(map.get($alert-stripe-colors, $color-name), 5);
} }
} }

View File

@@ -4,6 +4,7 @@
*/ */
@use 'sass:map'; @use 'sass:map';
@use 'sass:color';
html, html,
body { body {
@@ -977,70 +978,207 @@ h2.alert {
border-bottom: 1px dashed #000; border-bottom: 1px dashed #000;
} }
// SKYRAT EDIT CHANGE BEGIN - Remove neon colors, replaced with less saturated
/*
$alert-stripe-colors: (
'default': #b3bfff,
'green': #adffad,
'blue': #b3bfff,
'pink': #ffb3df,
'yellow': #fff3b3,
'orange': #ffe2b3,
'red': #ffb3b3,
'purple': #fac2ff,
);
$alert-stripe-alternate-colors: (
'default': #bdc8ff,
'green': #bdffbd,
'blue': #bdc8ff,
'pink': #ffc2e5,
'yellow': #fff5c2,
'orange': #ffe8c2,
'red': #ffc2c2,
'purple': #fbd1ff,
);
$alert-major-header-colors: (
'default': #003061,
'green': #005229,
'blue': #003061,
'pink': #800033,
'yellow': #754900,
'orange': #823208,
'red': #800029,
'purple': #450d8c,
);
$alert-subheader-header-colors: (
'default': #6b0020,
'green': #6b0020,
'blue': #6b0020,
'pink': #002c85,
'yellow': #002c85,
'orange': #002c85,
'red': #002c85,
'purple': #002c85,
);
*/
$alert-stripe-colors: (
'default': #c6ccec,
'green': #ceebc2,
'blue': #c6ccec,
'pink': #ecc6d9,
'yellow': #fff3b3,
'orange': #ffe2b3,
'red': #ffbbb3,
'purple': #e6d1f0,
);
$alert-stripe-alternate-colors: (
'default': #ced3ef,
'green': #d8efce,
'blue': #ced3ef,
'pink': #f0d1e1,
'yellow': #fff5c2,
'orange': #ffe8c2,
'red': #ffc8c2,
'purple': #ead9f2,
);
$alert-major-header-colors: (
'default': #003061,
'green': #1f440e,
'blue': #003061,
'pink': #602040,
'yellow': #990f00,
'orange': #b14810,
'red': #a80e00,
'purple': #5b2673,
);
$alert-subheader-header-colors: (
'default': #991200,
'green': #002c85,
'blue': #991200,
'pink': #002c85,
'yellow': #214164,
'orange': #002c85,
'red': #483c3c,
'purple': #991200,
);
// SKYRAT EDIT CHANGE END
$border-width: 4;
$border-width-px: $border-width * 1px;
.major_announcement_title { .major_announcement_title {
color: #cc0000; // SKYRAT EDIT CHANGE - ORIGINAL: color: #ff0066
text-decoration: underline;
font-weight: bold;
font-size: 175%; font-size: 175%;
padding: 0rem 0.5rem;
line-height: 100%;
text-align: left;
text-decoration: none;
width: 100%;
} }
.major_announcement_text { .subheader_announcement_text {
color: #202020;
font-weight: bold; font-weight: bold;
padding: 0 0.5rem;
padding-top: 0.25rem;
line-height: 100%;
width: 100%;
height: 100%;
text-align: left;
font-size: 125%; font-size: 125%;
} }
.minor_announcement_title { .major_announcement_text {
color: #007ee6; color: #131313;
background-color: #eaeaea;
font-weight: bold; font-weight: bold;
font-size: 100%;
text-align: left;
padding: 0.5rem 0.5rem;
width: 100%;
height: 100%;
}
.minor_announcement_title {
font-weight: bold;
padding: 0 0.5rem;
padding-top: 0;
line-height: 100%;
width: 100%;
height: 100%;
text-align: left;
font-size: 150%; font-size: 150%;
} }
.minor_announcement_text { .minor_announcement_text {
background-color: #eaeaea;
color: #202020; color: #202020;
font-size: 125%; padding: 0.5rem 0.5rem;
text-align: left;
font-size: 100%;
} }
$alert-stripe-colors: ( .announcement_header {
'default': #dedede, padding: 0.5rem 0;
'green': #c2ffcc, display: flex;
'blue': #b8e6ff, flex-direction: column;
'pink': #ffc2f4, }
'yellow': #ffe880,
'orange': #ffbb99,
'red': #ff99aa,
'purple': #d7c2ff,
);
$alert-background-colors: (
'default': #d1d1d1,
'green': #a8ffb7,
'blue': #a8e1ff,
'pink': #ffb3f3,
'yellow': #fff0ad,
'orange': #ffc9ad,
'red': #ffadbb,
'purple': #ccb3ff,
);
@each $color-name, $color-value in $alert-stripe-colors { @each $color-name, $color-value in $alert-stripe-colors {
.chat_alert_#{$color-name} { .chat_alert_#{$color-name} {
color: #ffffff; color: #ffffff;
padding: 0.5em 0.5em; padding: 0.5rem 0.5rem;
margin-bottom: 0.5em;
box-shadow: none; box-shadow: none;
font-weight: bold; font-weight: bold;
border: 1px solid $color-value; margin: 1rem 0 1rem 0;
margin: 0.5em 0 0.5em 0; padding: 0;
padding: 0.5em 0.75em; display: flex;
background-color: map.get($alert-background-colors, $color-name); flex-direction: column;
background-image: repeating-linear-gradient( border-image: repeating-linear-gradient(
-45deg, -45deg,
transparent, map.get($alert-stripe-alternate-colors, $color-name),
transparent 10px, map.get($alert-stripe-alternate-colors, $color-name) 10px,
$color-value 10px, $color-value 10px,
$color-value 20px $color-value 20px
); );
border-image-slice: $border-width fill;
border-width: $border-width-px;
border-image-width: $border-width-px;
border-image-outset: 0 0 0 0;
border-image-repeat: repeat repeat;
border-style: solid;
}
.chat_alert_#{$color-name} .major_announcement_title {
color: map.get($alert-major-header-colors, $color-name);
}
.chat_alert_#{$color-name} .minor_announcement_title {
color: map.get($alert-major-header-colors, $color-name);
}
.chat_alert_#{$color-name} .subheader_announcement_text {
color: map.get($alert-subheader-header-colors, $color-name);
}
.chat_alert_#{$color-name} .minor_announcement_text {
background-color: lighten(
map.get($alert-stripe-alternate-colors, $color-name),
5
);
}
.chat_alert_#{$color-name} .major_announcement_text {
background-color: lighten(
map.get($alert-stripe-alternate-colors, $color-name),
5
);
} }
} }

View File

@@ -1,5 +1,5 @@
import { useBackend, useLocalState } from '../backend'; import { useBackend, useLocalState } from '../backend';
import { Button, Dropdown, Input, Section, Stack, TextArea } from '../components'; import { Box, Button, Dropdown, Input, Section, Stack, TextArea } from '../components';
import { Window } from '../layouts'; import { Window } from '../layouts';
type Data = { type Data = {
@@ -8,6 +8,9 @@ type Data = {
command_name: string; command_name: string;
command_name_presets: string[]; command_name_presets: string[];
command_report_content: string; command_report_content: string;
announcement_color: string;
announcement_colors: string[];
subheader: string;
custom_name: string; custom_name: string;
played_sound: string; played_sound: string;
print_report: string; print_report: string;
@@ -18,15 +21,17 @@ export const CommandReport = () => {
<Window <Window
title="Create Command Report" title="Create Command Report"
width={325} width={325}
height={525} height={685}
theme="admin"> theme="admin">
<Window.Content> <Window.Content>
<Stack fill vertical> <Stack fill vertical>
<Stack.Item> <Stack.Item>
<CentComName /> <CentComName />
<AnnouncementColor />
<AnnouncementSound />
</Stack.Item> </Stack.Item>
<Stack.Item> <Stack.Item>
<AnnouncementSound /> <SubHeader />
</Stack.Item> </Stack.Item>
<Stack.Item> <Stack.Item>
<ReportText /> <ReportText />
@@ -71,6 +76,50 @@ const CentComName = (props, context) => {
); );
}; };
/** Allows the user to set the "sender" of the message via dropdown */
const SubHeader = (props, context) => {
const { act, data } = useBackend<Data>(context);
const { subheader } = data;
return (
<Section title="Set report subheader" textAlign="center">
<Box>Keep blank to not include a subheader</Box>
<Input
width="100%"
mt={1}
value={subheader}
placeholder={subheader}
onChange={(_, value) =>
act('set_subheader', {
new_subheader: value,
})
}
/>
</Section>
);
};
/** Features a section with dropdown for the announcement colour. */
const AnnouncementColor = (props, context) => {
const { act, data } = useBackend<Data>(context);
const { announcement_colors = [], announcement_color } = data;
return (
<Section title="Set announcement color" textAlign="center">
<Dropdown
width="100%"
displayText={announcement_color}
options={announcement_colors}
onSelected={(value) =>
act('update_announcement_color', {
updated_announcement_color: value,
})
}
/>
</Section>
);
};
/** Features a section with dropdown for sounds. */ /** Features a section with dropdown for sounds. */
const AnnouncementSound = (props, context) => { const AnnouncementSound = (props, context) => {
const { act, data } = useBackend<Data>(context); const { act, data } = useBackend<Data>(context);