diff --git a/code/modules/admin/verbs/commandreport.dm b/code/modules/admin/verbs/commandreport.dm index 635cb28cbb2..badf3babb66 100644 --- a/code/modules/admin/verbs/commandreport.dm +++ b/code/modules/admin/verbs/commandreport.dm @@ -46,6 +46,8 @@ 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 /// A static list of preset names that can be chosen. @@ -75,6 +77,7 @@ 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 return data @@ -103,6 +106,8 @@ played_sound = params["picked_sound"] if("toggle_announce") announce_contents = !announce_contents + if("toggle_printing") + print_report = !print_report if("submit_report") if(!command_name) to_chat(ui_user, span_danger("You can't send a report with no command name.")) @@ -132,7 +137,9 @@ if(announce_contents) priority_announce(command_report_content, null, report_sound, has_important_message = TRUE) - print_command_report(command_report_content, "[announce_contents ? "" : "Classified "][command_name] Update", !announce_contents) + + 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) diff --git a/tgui/packages/tgui/interfaces/CommandReport.tsx b/tgui/packages/tgui/interfaces/CommandReport.tsx index 8ec0a6f8949..f299e25a709 100644 --- a/tgui/packages/tgui/interfaces/CommandReport.tsx +++ b/tgui/packages/tgui/interfaces/CommandReport.tsx @@ -10,6 +10,7 @@ type Data = { command_report_content: string; custom_name: string; played_sound: string; + print_report: string; }; export const CommandReport = () => { @@ -94,7 +95,7 @@ const AnnouncementSound = (props, context) => { /** Creates the report textarea with a submit button. */ const ReportText = (props, context) => { const { act, data } = useBackend(context); - const { announce_contents, command_report_content } = data; + const { announce_contents, print_report, command_report_content } = data; const [commandReport, setCommandReport] = useLocalState( context, 'textArea', @@ -117,6 +118,18 @@ const ReportText = (props, context) => { onClick={() => act('toggle_announce')}> Announce Contents + act('toggle_printing')} + tooltip={ + !announce_contents && + "Printing the report is required since we aren't announcing its contents." + } + tooltipPosition="top"> + Print Report +