Skip to content

Commit

Permalink
The Create Command Report verb has the option to prevent printing rep…
Browse files Browse the repository at this point in the history
…orts now (tgstation#78208)

## About The Pull Request

Title summarizes all.
## Why It's Good For The Game

<details>


![image](https://github.com/tgstation/tgstation/assets/47710522/ae71a6f9-b22d-467a-8da9-6a0bec576215)

</details>

Prevents this nightmare on a comms console during an event with
particularly high centcom announcement traffic.

No, don't come at me with "it's soul", it's just highly annoying to deal
with and having the option to prevent it is better. If you leave a
downvote and tell me in the comments that I'm "taking" soul out of the
game then I will come find you and actually take your soul out of your
body.
## Changelog
:cl:
admin: The "Create Command Report" verb now has the option to not print
report papers at communications consoles.
/:cl:
  • Loading branch information
distributivgesetz authored Sep 9, 2023
1 parent 773d80b commit d1ef1ec
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
9 changes: 8 additions & 1 deletion code/modules/admin/verbs/commandreport.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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."))
Expand Down Expand Up @@ -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)

Expand Down
15 changes: 14 additions & 1 deletion tgui/packages/tgui/interfaces/CommandReport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type Data = {
command_report_content: string;
custom_name: string;
played_sound: string;
print_report: string;
};

export const CommandReport = () => {
Expand Down Expand Up @@ -94,7 +95,7 @@ const AnnouncementSound = (props, context) => {
/** Creates the report textarea with a submit button. */
const ReportText = (props, context) => {
const { act, data } = useBackend<Data>(context);
const { announce_contents, command_report_content } = data;
const { announce_contents, print_report, command_report_content } = data;
const [commandReport, setCommandReport] = useLocalState<string>(
context,
'textArea',
Expand All @@ -117,6 +118,18 @@ const ReportText = (props, context) => {
onClick={() => act('toggle_announce')}>
Announce Contents
</Button.Checkbox>
<Button.Checkbox
fluid
checked={print_report || !announce_contents}
disabled={!announce_contents}
onClick={() => act('toggle_printing')}
tooltip={
!announce_contents &&
"Printing the report is required since we aren't announcing its contents."
}
tooltipPosition="top">
Print Report
</Button.Checkbox>
</Stack.Item>
<Stack.Item>
<Button.Confirm
Expand Down

0 comments on commit d1ef1ec

Please sign in to comment.