mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-18 04:55:27 +00:00
## 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>     </details> <details> <summary>Dark mode pictures</summary>     </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>
176 lines
6.0 KiB
Plaintext
176 lines
6.0 KiB
Plaintext
/// The default command report announcement sound.
|
|
#define DEFAULT_ANNOUNCEMENT_SOUND "default_announcement"
|
|
|
|
/// Preset central command names to chose from for centcom reports.
|
|
#define CENTCOM_PRESET "Central Command"
|
|
#define SYNDICATE_PRESET "The Syndicate"
|
|
#define WIZARD_PRESET "The Wizard Federation"
|
|
#define CUSTOM_PRESET "Custom Command Name"
|
|
|
|
/// Verb to change the global command name.
|
|
/client/proc/cmd_change_command_name()
|
|
set category = "Admin.Events"
|
|
set name = "Change Command Name"
|
|
|
|
if(!check_rights(R_ADMIN))
|
|
return
|
|
|
|
var/input = input(usr, "Please input a new name for Central Command.", "What?", "") as text|null
|
|
if(!input)
|
|
return
|
|
change_command_name(input)
|
|
message_admins("[key_name_admin(src)] has changed Central Command's name to [input]")
|
|
log_admin("[key_name(src)] has changed the Central Command name to: [input]")
|
|
|
|
/// Verb to open the create command report window and send command reports.
|
|
/client/proc/cmd_admin_create_centcom_report()
|
|
set category = "Admin.Events"
|
|
set name = "Create Command Report"
|
|
|
|
if(!check_rights(R_ADMIN))
|
|
return
|
|
|
|
SSblackbox.record_feedback("tally", "admin_verb", 1, "Create Command Report") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
|
|
var/datum/command_report_menu/tgui = new(usr)
|
|
tgui.ui_interact(usr)
|
|
|
|
/// Datum for holding the TGUI window for command reports.
|
|
/datum/command_report_menu
|
|
/// The mob using the UI.
|
|
var/mob/ui_user
|
|
/// The name of central command that will accompany our report
|
|
var/command_name = CENTCOM_PRESET
|
|
/// Whether we are using a custom name instead of a preset.
|
|
var/custom_name
|
|
/// The actual contents of the report we're going to send.
|
|
var/command_report_content
|
|
/// Whether the report's contents are announced.
|
|
var/announce_contents = TRUE
|
|
/// Whether a copy of the report is printed at every console.
|
|
var/print_report = TRUE
|
|
/// The sound that's going to accompany our message.
|
|
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.
|
|
var/list/preset_names = list(CENTCOM_PRESET, SYNDICATE_PRESET, WIZARD_PRESET, CUSTOM_PRESET)
|
|
|
|
/datum/command_report_menu/New(mob/user)
|
|
ui_user = user
|
|
if(command_name() != CENTCOM_PRESET)
|
|
command_name = command_name()
|
|
preset_names.Insert(1, command_name())
|
|
|
|
/datum/command_report_menu/ui_state(mob/user)
|
|
return GLOB.admin_state
|
|
|
|
/datum/command_report_menu/ui_close()
|
|
qdel(src)
|
|
|
|
/datum/command_report_menu/ui_interact(mob/user, datum/tgui/ui)
|
|
ui = SStgui.try_update_ui(user, src, ui)
|
|
if(!ui)
|
|
ui = new(user, src, "CommandReport")
|
|
ui.open()
|
|
|
|
/datum/command_report_menu/ui_data(mob/user)
|
|
var/list/data = list()
|
|
data["command_name"] = command_name
|
|
data["custom_name"] = custom_name
|
|
data["command_report_content"] = command_report_content
|
|
data["announce_contents"] = announce_contents
|
|
data["print_report"] = print_report
|
|
data["played_sound"] = played_sound
|
|
data["announcement_color"] = announcement_color
|
|
data["subheader"] = subheader
|
|
|
|
return data
|
|
|
|
/datum/command_report_menu/ui_static_data(mob/user)
|
|
var/list/data = list()
|
|
data["command_name_presets"] = preset_names
|
|
data["announcer_sounds"] = list(DEFAULT_ANNOUNCEMENT_SOUND) + GLOB.announcer_keys
|
|
data["announcement_colors"] = ANNOUNCEMENT_COLORS
|
|
|
|
return data
|
|
|
|
/datum/command_report_menu/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
|
. = ..()
|
|
if(.)
|
|
return
|
|
|
|
switch(action)
|
|
if("update_command_name")
|
|
if(params["updated_name"] == CUSTOM_PRESET)
|
|
custom_name = TRUE
|
|
else if (params["updated_name"] in preset_names)
|
|
custom_name = FALSE
|
|
|
|
command_name = params["updated_name"]
|
|
if("set_report_sound")
|
|
played_sound = params["picked_sound"]
|
|
if("toggle_announce")
|
|
announce_contents = !announce_contents
|
|
if("toggle_printing")
|
|
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(!command_name)
|
|
to_chat(ui_user, span_danger("You can't send a report with no command name."))
|
|
return
|
|
if(!params["report"])
|
|
to_chat(ui_user, span_danger("You can't send a report with no contents."))
|
|
return
|
|
command_report_content = params["report"]
|
|
send_announcement()
|
|
|
|
return TRUE
|
|
|
|
/*
|
|
* The actual proc that sends the priority announcement and reports
|
|
*
|
|
* Uses the variables set by the user on our datum as the arguments for the report.
|
|
*/
|
|
/datum/command_report_menu/proc/send_announcement()
|
|
/// Our current command name to swap back to after sending the report.
|
|
var/original_command_name = command_name()
|
|
change_command_name(command_name)
|
|
|
|
/// The sound we're going to play on report.
|
|
var/report_sound = played_sound
|
|
if(played_sound == DEFAULT_ANNOUNCEMENT_SOUND)
|
|
report_sound = SSstation.announcer.get_rand_report_sound()
|
|
|
|
if(announce_contents)
|
|
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)
|
|
print_command_report(command_report_content, "[announce_contents ? "" : "Classified "][command_name] Update", !announce_contents)
|
|
|
|
change_command_name(original_command_name)
|
|
|
|
log_admin("[key_name(ui_user)] has created a command report: \"[command_report_content]\", sent from \"[command_name]\" with the sound \"[played_sound]\".")
|
|
message_admins("[key_name_admin(ui_user)] has created a command report, sent from \"[command_name]\" with the sound \"[played_sound]\"")
|
|
|
|
|
|
#undef DEFAULT_ANNOUNCEMENT_SOUND
|
|
|
|
#undef CENTCOM_PRESET
|
|
#undef SYNDICATE_PRESET
|
|
#undef WIZARD_PRESET
|
|
#undef CUSTOM_PRESET
|