-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add undergarments & "Censor Nudity" toggle to options #33185
base: master
Are you sure you want to change the base?
Add undergarments & "Censor Nudity" toggle to options #33185
Conversation
RSI Diff Bot; head commit a5ecd95 merging into 1ded8e7 Resources/Textures/Mobs/Customization/undergarments.rsi
|
@@ -12,19 +14,32 @@ public sealed class HumanoidAppearanceSystem : SharedHumanoidAppearanceSystem | |||
{ | |||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; | |||
[Dependency] private readonly MarkingManager _markingManager = default!; | |||
[Dependency] private readonly IConfigurationManager _configurationManager = default!; | |||
[Dependency] private readonly IEntityManager _entManager = default!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need a dependency on IEntityManager
, you're in an entity system.
var censorNudity = _configurationManager.GetCVar(CCVars.ClientCensorNudity) || | ||
_configurationManager.GetCVar(CCVars.ClientCensorNudity); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of these should be ServerCensorNudity
?
Content.Shared/CCVar/CCVars.cs
Outdated
/// <summary> | ||
/// If enabled, censors character nudity by forcing clothes markings on characters, selected by the client. | ||
/// Both this and ServerCensorNudity must be false to display nudity on the client. | ||
/// </summary> | ||
public static readonly CVarDef<bool> ClientCensorNudity = | ||
CVarDef.Create("accessibility.censor_nudity", false, CVar.CLIENTONLY | CVar.ARCHIVE); | ||
|
||
/// <summary> | ||
/// If enabled, censors character nudity by forcing clothes markings on characters, selected by the server. | ||
/// Both this and ClientCensorNudity must be false to display nudity on the client. | ||
/// </summary> | ||
public static readonly CVarDef<bool> ServerCensorNudity = | ||
CVarDef.Create("accessibility.server_censor_nudity", false, CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefix both of these C# names with "Accessibility".
_markingManager.TryGetMarking(marking, out var prototype); | ||
if (prototype != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_markingManager.TryGetMarking(marking, out var prototype); | |
if (prototype != null) | |
if (_markingManager.TryGetMarking(marking, out var prototype)) |
_markingManager.TryGetMarking(marking, out var prototype); | ||
if (prototype != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_markingManager.TryGetMarking(marking, out var prototype); | |
if (prototype != null) | |
if (_markingManager.TryGetMarking(marking, out var prototype)) |
Weh-the-weh is in shambles rn |
weh-the-weh will just wear a green jumpsuit, plus their appeal is in their funny face |
Added a "How to test" section in the PR description to help out how to test it. |
are these colourable? |
|
I have concerns that this PR could significantly harm the development of NewMed. Has this issue been discussed with the maintainers? |
It's purely visual and does not have any gameplay implications whatsoever. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
im not sure if anyone has checked this yet, but underclothes should be visually disabled when something's in the jumpsuit slot (except for the "colorful pants" item) as to not mess with clothes such as... other random colorful clothing. huh. |
There might be a need to check for clipping, but afaik the undergarments should follow the shape of the body and any undergarments that is visible underneath another piece of clothing (e.g. the open-chested randomized jumpsuit) just treats it as an undershirt/underpants. |
About the PR
This PR adds the ability to equip undergarments to characters, as well as a Censor Nudity Toggle. This toggle is available as a client option in the Accessibility tab of the Options menu, and as a server variable.
There are 4 top and 3 bottom undergarments added:
These undergarments can be found as markings in the character creator.
The Censor Nudity Toggle is available under the Accessibility tab in Options. If enabled, characters who have not selected a top/bottom undergarment will be outfitted with a default selection (Tanktop + Boxers). This default selection is overridden if another undergarment has been selected to that slot. Note that this option is clientside-only, and will not be replicated on other clients.
Servers have the ability to override the client selection via the CCvar
server_nudity_toggle
, which when set to true makes all clients behave as if they have the Censor Nudity Toggle option selected. If the CCvar is set to false, the client selection will take priority.This PR is inspired by #31221.
Why / Balance
Nudity, even if it is just a single pixel or two, may cause discomfort for some players. This can manifest as discomfort at having their own character bared nude for other players, or other characters being nude around them. A nudity toggle allows for said players to engage with the game without impacting the game for other players.
Streamers may also have issues with nudity due to streaming platform Terms of Services.
Since nudity is not supposed to be a focus in the game (at least upstream) the selection of undergarments have been made intentionally very limited and lacks customization options. The selection should be enough for a player to select undergarments that is suitable for their character's presentation without putting undue focus on using it as a means of expression.
Reptilians and Vox have custom undergarments due to differences in sprites (Vox are self-explanatory, Reptilians have a higher-up crotch area).
Note that the specific sprites are not necessarily final representations, and are open to be resprited.
Technical details
LayerColoringType
has been made nullable, as there was no option for a type that has a single color without a slider that isn't dependent on another property (unlike how eye/skincolor is). If it's null, it just uses the default color and won't allow it to be changed.There's some basic options code and cvars, what's important is what happens in
HumanoidAppearanceSystem.cs
:In
UpdateSprite()
, it checks whether nudity censoring is toggled either client- or serverside; if there already exists a marking that matchesUndergarmentTop
/UndergarmentBottom
all is well and not much more happens, but if one is missingAddUndergarments()
is ran and applies a marking set viaHumanoidAppearanceComponent
. These markings are also added toClientOldMarkings
so that they can be removed should the toggle turn off/a marking be selected in the character menu.Media
Tanktop + Boxers; the default, which displays when Censor Nudity Toggle is enabled:
Classic Bra + Briefs:
Sports Bra + Satin:
Binder + Boxers:
Example lizard clothing, Tanktop + Boxers:
Example vox clothing, Tanktop + Boxers:
How to test
golobby
to go to the lobby.> cvar accessibility.server_censor_nudity True
.Requirements
Breaking changes
Changelog
🆑