Merge 065c8dd3a2 into fd5b16abb3
This commit is contained in:
commit
56e0ea13e1
|
|
@ -0,0 +1,24 @@
|
|||
<controls:FancyWindow xmlns="https://spacestation14.io"
|
||||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
|
||||
Title="{Loc 'content-warning-title'}"
|
||||
MinSize="700 750"
|
||||
MaxSize="750 800"> <!-- DeltaV - increased maximum size -->
|
||||
<BoxContainer Orientation="Vertical" Margin="20">
|
||||
<Label Name="TitleLabel"
|
||||
StyleClasses="LabelBig"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0 0 0 5"
|
||||
Text="{Loc 'content-warning-label'}"/>
|
||||
<PanelContainer Margin="0 0 0 10">
|
||||
<RichTextLabel Name="ContentWarningBody" HorizontalAlignment="Center"/>
|
||||
</PanelContainer>
|
||||
<BoxContainer Orientation="Vertical" VerticalAlignment="Bottom" Margin="0 10 0 0">
|
||||
<Button Name="ContentWarningAccept"
|
||||
MinWidth="75"
|
||||
Text="{ Loc 'content-warning-accept' }"/>
|
||||
<Button Name="ContentWarningReject"
|
||||
MinWidth="75"
|
||||
Text="{ Loc 'content-warning-reject' }"/>
|
||||
</BoxContainer>
|
||||
</BoxContainer>
|
||||
</controls:FancyWindow>
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
using Content.Client.UserInterface.Controls;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.Console;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Client._Funkystation.ContentWarning;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class ContentWarningPopup : FancyWindow
|
||||
{
|
||||
|
||||
public event Action? OnContentWarningAccept;
|
||||
public event Action? OnContentWarningReject;
|
||||
|
||||
public ContentWarningPopup()
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
InitWindow();
|
||||
}
|
||||
|
||||
private void InitWindow()
|
||||
{
|
||||
ContentWarningBody.SetMessage(FormattedMessage.FromMarkupOrThrow(Loc.GetString("content-warning-message")));
|
||||
|
||||
ContentWarningReject.OnPressed += _ =>
|
||||
{
|
||||
OnContentWarningReject?.Invoke();
|
||||
};
|
||||
|
||||
ContentWarningAccept.OnPressed += obj =>
|
||||
{
|
||||
OnContentWarningAccept?.Invoke();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
using Content.Client.Gameplay;
|
||||
using Content.Client.Lobby;
|
||||
using Content.Shared._Funkystation.CCVars;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.Console;
|
||||
using Robust.Client.UserInterface.Controllers;
|
||||
using Robust.Shared.Configuration;
|
||||
|
||||
namespace Content.Client._Funkystation.ContentWarning;
|
||||
|
||||
[UsedImplicitly]
|
||||
public sealed class ContentWarningUIController : UIController, IOnStateEntered<LobbyState>, IOnStateEntered<GameplayState>
|
||||
{
|
||||
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
||||
[Dependency] private readonly IClientConsoleHost _consoleHost = default!;
|
||||
|
||||
private ContentWarningPopup? _window;
|
||||
|
||||
private void AttemptOpenContentWarningPopup()
|
||||
{
|
||||
if (!_cfg.GetCVar(CCVars_Funky.ContentWarningDisplay) || _cfg.GetCVar(CCVars_Funky.ContentWarningAcknowledged))
|
||||
return;
|
||||
|
||||
OpenContentWarningPopup();
|
||||
}
|
||||
|
||||
public void OnStateEntered(LobbyState _)
|
||||
{
|
||||
AttemptOpenContentWarningPopup();
|
||||
}
|
||||
|
||||
public void OnStateEntered(GameplayState _)
|
||||
{
|
||||
AttemptOpenContentWarningPopup();
|
||||
}
|
||||
|
||||
private void OpenContentWarningPopup()
|
||||
{
|
||||
if (_window != null)
|
||||
return;
|
||||
|
||||
_window = new ContentWarningPopup();
|
||||
_window.OpenCentered();
|
||||
_window.OnContentWarningReject += () =>
|
||||
{
|
||||
_window.Close();
|
||||
_window = null;
|
||||
|
||||
if (_cfg.GetCVar(CCVars_Funky.ContentWarningKickOnIgnore))
|
||||
_consoleHost.ExecuteCommand("quit");
|
||||
};
|
||||
_window.OnContentWarningAccept += () =>
|
||||
{
|
||||
_window.Close();
|
||||
_window = null;
|
||||
_cfg.SetCVar(CCVars_Funky.ContentWarningAcknowledged, true);
|
||||
_cfg.SaveToFile();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
using Robust.Shared.Configuration;
|
||||
|
||||
namespace Content.Shared._Funkystation.CCVars;
|
||||
|
||||
[CVarDefs]
|
||||
public sealed class CCVars_Funky
|
||||
{
|
||||
// imp start. Automatically disable content warnings in debug builds. // DeltaV - and tools, too
|
||||
#if DEBUG || TOOLS
|
||||
private static bool _cwOnBuildType;
|
||||
#else
|
||||
private static bool _cwOnBuildType = true;
|
||||
#endif
|
||||
// imp end
|
||||
|
||||
/// <summary>
|
||||
/// If the content warning should be displayed.
|
||||
/// </summary>
|
||||
public static readonly CVarDef<bool> ContentWarningDisplay =
|
||||
CVarDef.Create("cw.display", _cwOnBuildType, CVar.SERVER | CVar.REPLICATED); // imp. Automatically disable content warnings in debug builds.
|
||||
|
||||
/// <summary>
|
||||
/// If ignoring the content warning should kick you from the server.
|
||||
/// </summary>
|
||||
public static readonly CVarDef<bool> ContentWarningKickOnIgnore =
|
||||
CVarDef.Create("cw.kick", true, CVar.SERVER | CVar.REPLICATED);
|
||||
|
||||
/// <summary>
|
||||
/// If the content warning popup was acknowledged.
|
||||
/// </summary>
|
||||
public static readonly CVarDef<bool> ContentWarningAcknowledged =
|
||||
CVarDef.Create("cw.acknowledged.deltav", false, CVar.CLIENTONLY | CVar.ARCHIVE);
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
content-warning-title = Content Warning
|
||||
content-warning-label = CONTENT WARNING: BEFORE YOU PLAY
|
||||
content-warning-accept = I understand.
|
||||
content-warning-reject = This is not the place for me.
|
||||
# imp edits: replace mentions of funky with imp # DeltaV - replace mentions of imp with deltav
|
||||
content-warning-message =
|
||||
Space Station 14 is a game about surviving a disaster with incompetent and cruel people on a space station. The character you create will endure corporate terrorism, hostile interactions with shitty coworkers, and fates worse than death.
|
||||
|
||||
On Delta V, we enjoy telling stories where horrible things happen to ordinary people. With this in mind, we also believe in fully sharing what we consider to be triggering scenarios that may occur in-game.
|
||||
|
||||
Be advised that the following situations may happen without warning at any point in a round:
|
||||
|
||||
- You losing control of your character
|
||||
- Violent crime
|
||||
- Interrogations
|
||||
- Being a victim to violent crime
|
||||
- Your own character dying
|
||||
- Witnessing others dying
|
||||
- Brainwashing
|
||||
- Body horror
|
||||
- You playing someone elses character, or parts of your characters appearance changing
|
||||
- Being framed for a crime that you did not do
|
||||
|
||||
If any of these make you uncomfortable, Delta V may not be the server for you. If you choose to play here anyway, do so with the assumption that these things will happen. Do not make a character who is a stand-in for yourself. Take steps to ensure a healthy separation between what is in-character and what is out-of-character. Understand that if you fail to do this, you may be asked to step away from the game.
|
||||
Loading…
Reference in New Issue