Skip to content

Commit 5f5e422

Browse files
taydeofunkystationbot
andauthored
Content warnings (funky-station#2922)
Co-authored-by: funkystationbot <funky@funkystation.org>
1 parent efb310a commit 5f5e422

5 files changed

Lines changed: 175 additions & 0 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<controls:FancyWindow xmlns="https://spacestation14.io"
2+
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
3+
Title="{Loc 'content-warning-title'}"
4+
MinSize="520 750"
5+
MaxSize="520 750">
6+
<BoxContainer Orientation="Vertical" Margin="20">
7+
<Label Name="TitleLabel"
8+
StyleClasses="LabelBig"
9+
HorizontalAlignment="Center"
10+
Margin="0 0 0 5"
11+
Text="{Loc 'content-warning-label'}"/>
12+
<PanelContainer Margin="0 0 0 10">
13+
<RichTextLabel Name="ContentWarningBody" HorizontalAlignment="Center"/>
14+
</PanelContainer>
15+
<BoxContainer Orientation="Vertical" VerticalAlignment="Bottom" Margin="0 10 0 0">
16+
<Button Name="ContentWarningAccept"
17+
MinWidth="75"
18+
Text="{ Loc 'content-warning-accept' }"/>
19+
<Button Name="ContentWarningReject"
20+
MinWidth="75"
21+
Text="{ Loc 'content-warning-reject' }"/>
22+
</BoxContainer>
23+
</BoxContainer>
24+
</controls:FancyWindow>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// SPDX-FileCopyrightText: 2026 taydeo <tay@funkystation.org>
2+
//
3+
// SPDX-License-Identifier: MIT
4+
5+
using Content.Client.UserInterface.Controls;
6+
using Robust.Client.AutoGenerated;
7+
using Robust.Client.Console;
8+
using Robust.Client.UserInterface.XAML;
9+
using Robust.Shared.Configuration;
10+
using Robust.Shared.Timing;
11+
using Robust.Shared.Utility;
12+
13+
namespace Content.Client._Funkystation.ContentWarning;
14+
15+
[GenerateTypedNameReferences]
16+
public sealed partial class ContentWarningPopup : FancyWindow
17+
{
18+
[Dependency] private readonly IClientConsoleHost _consoleHost = default!;
19+
20+
public event Action? OnContentWarningAccept;
21+
public event Action? OnContentWarningReject;
22+
23+
public ContentWarningPopup()
24+
{
25+
IoCManager.InjectDependencies(this);
26+
RobustXamlLoader.Load(this);
27+
28+
InitWindow();
29+
}
30+
31+
private void InitWindow()
32+
{
33+
ContentWarningBody.SetMessage(FormattedMessage.FromMarkupOrThrow(Loc.GetString("content-warning-message")));
34+
35+
ContentWarningReject.OnPressed += _ =>
36+
{
37+
OnContentWarningReject?.Invoke();
38+
};
39+
40+
ContentWarningAccept.OnPressed += obj =>
41+
{
42+
OnContentWarningAccept?.Invoke();
43+
};
44+
}
45+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// SPDX-FileCopyrightText: 2026 taydeo <tay@funkystation.org>
2+
//
3+
// SPDX-License-Identifier: MIT
4+
5+
using Content.Client.Gameplay;
6+
using Content.Client.Lobby;
7+
using Content.Shared._Funkystation.CCVars;
8+
using Robust.Client.Console;
9+
using Robust.Client.UserInterface.Controllers;
10+
using Robust.Shared.Configuration;
11+
12+
namespace Content.Client._Funkystation.ContentWarning;
13+
14+
public sealed partial class ContentWarningUIController : UIController, IOnStateEntered<LobbyState>, IOnStateEntered<GameplayState>
15+
{
16+
[Dependency] private readonly IConfigurationManager _cfg = default!;
17+
[Dependency] private readonly IClientConsoleHost _consoleHost = default!;
18+
19+
private ContentWarningPopup? _window;
20+
21+
private void AttemptOpenContentWarningPopup()
22+
{
23+
if (_cfg.GetCVar(CCVars_Funky.ContentWarningDisplay) || _cfg.GetCVar(CCVars_Funky.ContentWarningAcknowledged))
24+
return;
25+
26+
OpenContentWarningPopup();
27+
}
28+
29+
public void OnStateEntered(LobbyState _)
30+
{
31+
AttemptOpenContentWarningPopup();
32+
}
33+
34+
public void OnStateEntered(GameplayState _)
35+
{
36+
AttemptOpenContentWarningPopup();
37+
}
38+
39+
private void OpenContentWarningPopup()
40+
{
41+
if (_window != null)
42+
return;
43+
44+
_window = new ContentWarningPopup();
45+
_window.OpenCentered();
46+
_window.OnContentWarningReject += () =>
47+
{
48+
_window.Close();
49+
_window = null;
50+
51+
if (_cfg.GetCVar(CCVars_Funky.ContentWarningKickOnIgnore))
52+
_consoleHost.ExecuteCommand("quit");
53+
};
54+
_window.OnContentWarningAccept += () =>
55+
{
56+
_window.Close();
57+
_window = null;
58+
_cfg.SetCVar(CCVars_Funky.ContentWarningAcknowledged, true);
59+
_cfg.SaveToFile();
60+
};
61+
}
62+
}

Content.Shared/_Funkystation/CCVars/CCVars.Funky.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// SPDX-FileCopyrightText: 2026 Steve <marlumpy@gmail.com>
55
// SPDX-FileCopyrightText: 2026 corresp0nd <46357632+corresp0nd@users.noreply.github.com>
66
// SPDX-FileCopyrightText: 2026 marc-pelletier <113944176+marc-pelletier@users.noreply.github.com>
7+
// SPDX-FileCopyrightText: 2026 taydeo <tay@funkystation.org>
78
//
89
// SPDX-License-Identifier: AGPL-3.0-or-later AND MIT
910

@@ -60,4 +61,22 @@ public sealed class CCVars_Funky
6061
/// </summary>
6162
public static readonly CVarDef<bool> PinktextEnabled =
6263
CVarDef.Create("objectives.pink_text_enabled", true, CVar.SERVER | CVar.REPLICATED);
64+
65+
/// <summary>
66+
/// If the content warning should be displayed.
67+
/// </summary>
68+
public static readonly CVarDef<bool> ContentWarningDisplay =
69+
CVarDef.Create("cw.display", true, CVar.SERVER | CVar.REPLICATED);
70+
71+
/// <summary>
72+
/// If ignoring the content warning should kick you from the server.
73+
/// </summary>
74+
public static readonly CVarDef<bool> ContentWarningKickOnIgnore =
75+
CVarDef.Create("cw.kick", true, CVar.SERVER | CVar.REPLICATED);
76+
77+
/// <summary>
78+
/// If the content warning popup was acknowledged.
79+
/// </summary>
80+
public static readonly CVarDef<bool> ContentWarningAcknowledged =
81+
CVarDef.Create("cw.acknowledged", false, CVar.CLIENTONLY | CVar.ARCHIVE);
6382
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
content-warning-title = Content Warning
2+
content-warning-label = CONTENT WARNING: BEFORE YOU PLAY
3+
content-warning-accept = I understand.
4+
content-warning-reject = This is not the place for me.
5+
content-warning-message =
6+
Space Station 14 is a game about surviving a disaster with incompetent and cruel people on a space station.
7+
8+
Your character is not a stand in for yourself. At Funky Station, we believe this is the in-correct way to play the game. With that in-mind, we also believe in fully sharing what we think may be potentially triggering scenarios.
9+
10+
Do not play Funky Station if you are sensitive to:
11+
12+
- You losing control of your character
13+
- Violent crime
14+
- Interrogations
15+
- Being a victim to violent crime
16+
- Your own character dying
17+
- Witnessing others dying
18+
- Brainwashing
19+
- Body horror
20+
- You playing someone elses character, or parts of your characters appearance changing
21+
- Being framed for a crime that you did not do
22+
23+
Do not make a stand in for yourself. If you are not confident in your ability to distinguish what is part of the game and what isn't, do not play here.
24+
25+

0 commit comments

Comments
 (0)