Skip to content

Commit 5f32895

Browse files
DevilishMilkfunkystationbot
andauthored
canAlert - adjust whether or not comms consoles can set alert levels (funky-station#1618)
Co-authored-by: funkystationbot <funky@funkystation.org>
1 parent e24d8cd commit 5f32895

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

Content.Server/Communications/CommunicationsConsoleComponent.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
// SPDX-FileCopyrightText: 2023 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2626
// SPDX-FileCopyrightText: 2024 Justin Pfeifler <jrpl101998@gmail.com>
2727
// SPDX-FileCopyrightText: 2024 avery <51971268+graevy@users.noreply.github.com>
28+
// SPDX-FileCopyrightText: 2025 DevilishMilk <michaellapjr@gmail.com>
2829
// SPDX-FileCopyrightText: 2025 taydeo <td12233a@gmail.com>
2930
//
3031
// SPDX-License-Identifier: MIT
@@ -87,6 +88,13 @@ public sealed partial class CommunicationsConsoleComponent : SharedCommunication
8788
[DataField]
8889
public bool CanShuttle = true;
8990

91+
/// <summary>
92+
/// FUNKY - Can set alert levels
93+
/// </summary>
94+
[ViewVariables]
95+
[DataField]
96+
public bool CanAlert = true;
97+
9098
/// <summary>
9199
/// Announce on all grids (for nukies)
92100
/// </summary>

Content.Server/Communications/CommunicationsConsoleSystem.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
// SPDX-FileCopyrightText: 2024 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2424
// SPDX-FileCopyrightText: 2024 nikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com>
2525
// SPDX-FileCopyrightText: 2024 superjj18 <gagnonjake@gmail.com>
26+
// SPDX-FileCopyrightText: 2025 DevilishMilk <michaellapjr@gmail.com>
2627
// SPDX-FileCopyrightText: 2025 Tay <td12233a@gmail.com>
2728
// SPDX-FileCopyrightText: 2025 pa.pecherskij <pa.pecherskij@interfax.ru>
2829
// SPDX-FileCopyrightText: 2025 slarticodefast <161409025+slarticodefast@users.noreply.github.com>
@@ -246,7 +247,7 @@ private void OnSelectAlertLevelMessage(EntityUid uid, CommunicationsConsoleCompo
246247
if (message.Actor is not { Valid: true } mob)
247248
return;
248249

249-
if (!CanUse(mob, uid))
250+
if (!CanUse(mob, uid) || !comp.CanAlert) // funky - canAlert
250251
{
251252
_popupSystem.PopupCursor(Loc.GetString("comms-console-permission-denied"), message.Actor, PopupType.Medium);
252253
return;
@@ -295,7 +296,7 @@ private void OnAnnounceMessage(EntityUid uid, CommunicationsConsoleComponent com
295296
// allow admemes with vv
296297
Loc.TryGetString(comp.Title, out var title);
297298
title ??= comp.Title;
298-
299+
299300
Console.WriteLine(comp.Title);
300301

301302
List<string> announcementWords = new List<string>{};

Resources/Prototypes/Entities/Structures/Machines/Computers/computers.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@
8989
# SPDX-FileCopyrightText: 2024 icekot8 <93311212+icekot8@users.noreply.github.com>
9090
# SPDX-FileCopyrightText: 2024 lzk <124214523+lzk228@users.noreply.github.com>
9191
# SPDX-FileCopyrightText: 2024 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
92+
# SPDX-FileCopyrightText: 2025 DevilishMilk <michaellapjr@gmail.com>
9293
# SPDX-FileCopyrightText: 2025 Kip <tfraser520@gmail.com>
9394
# SPDX-FileCopyrightText: 2025 Lyndomen <49795619+Lyndomen@users.noreply.github.com>
95+
# SPDX-FileCopyrightText: 2025 Minerva <218184747+mnva0@users.noreply.github.com>
9496
# SPDX-FileCopyrightText: 2025 Mish <bluscout78@yahoo.com>
9597
# SPDX-FileCopyrightText: 2025 Tay <td12233a@gmail.com>
9698
# SPDX-FileCopyrightText: 2025 corresp0nd <46357632+corresp0nd@users.noreply.github.com>
@@ -883,6 +885,7 @@
883885
title: comms-console-announcement-title-nukie
884886
color: "#ff0000"
885887
canShuttle: false
888+
canAlert: false #funky
886889
global: true #announce to everyone they're about to fuck shit up
887890
sound: /Audio/Announcements/war.ogg
888891
- type: Computer
@@ -916,6 +919,7 @@
916919
title: comms-console-announcement-title-wizard
917920
color: "#ff00ff"
918921
canShuttle: false
922+
canAlert: false #funky
919923
global: true #announce to everyone they're about to fuck shit up
920924
sound: /Audio/Announcements/war.ogg
921925
- type: Computer

0 commit comments

Comments
 (0)