Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

SlamBamActionman
Copy link
Member

@SlamBamActionman SlamBamActionman commented Nov 6, 2024

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:

Tanktop (default with toggle)
Binder
Classic Bra
Sports Bra

Boxers (default with toggle)
Briefs
Satin

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 matches UndergarmentTop/UndergarmentBottom all is well and not much more happens, but if one is missing AddUndergarments() is ran and applies a marking set via HumanoidAppearanceComponent. These markings are also added to ClientOldMarkings 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:
imageimageimage

Classic Bra + Briefs:
image

Sports Bra + Satin:
image

Binder + Boxers:
image

Example lizard clothing, Tanktop + Boxers:
image

Example vox clothing, Tanktop + Boxers:
image

image
image

How to test

  1. Boot up Dev map
  2. Go into Options menu, Accessibility tab, toggle Censor Nudity Toggle on.
  3. Observe how Urists in the Dev map have clothing.
  4. Use the Command golobby to go to the lobby.
  5. Enter character creation, select Hide Clothes and go to the Markings tab
  6. Select a combination of undergarments and notice how they override the default clothing.
  7. Save, go back to Options and toggle it off. Notice how the selected undergarments remain.
  8. Go back into the Dev map, see that Urists are naked.
  9. Type the Command > cvar accessibility.server_censor_nudity True.
  10. Observe how Urists in the Dev map have clothing again.

Requirements

Breaking changes

Changelog

🆑

  • add: Added top and bottom undergarments, which can be found in the Markings tab of the character creator.
  • add: Added a Censor Nudity Toggle under the Accessibility tab of Options, which adds undergarments to all characters on your client. Undergarments selected in the character creator take priority.

@github-actions github-actions bot added Changes: UI Can be reviewed or fixed by people who are knowledgeable with UI design Changes: Sprites Should be reviewed or fixed by people who are knowledgeable with spriting or visual design. Status: Needs Review This PR requires new reviews before it can be merged. labels Nov 6, 2024
Copy link
Contributor

github-actions bot commented Nov 6, 2024

RSI Diff Bot; head commit a5ecd95 merging into 1ded8e7
This PR makes changes to 1 or more RSIs. Here is a summary of all changes:

Resources/Textures/Mobs/Customization/undergarments.rsi

State Old New Status
binder Added
binder_vox Added
boxers Added
boxers_reptilian Added
boxers_vox Added
briefs Added
briefs_reptilian Added
briefs_vox Added
classic Added
classic_vox Added
satin Added
satin_reptilian Added
satin_vox Added
sports Added
sports_vox Added
tanktop Added
tanktop_vox Added

Edit: diff updated after a5ecd95

@@ -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!;
Copy link
Member

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.

Comment on lines 225 to 226
var censorNudity = _configurationManager.GetCVar(CCVars.ClientCensorNudity) ||
_configurationManager.GetCVar(CCVars.ClientCensorNudity);
Copy link
Member

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?

Comment on lines 1861 to 1873
/// <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);
Copy link
Member

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".

Comment on lines 302 to 303
_markingManager.TryGetMarking(marking, out var prototype);
if (prototype != null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_markingManager.TryGetMarking(marking, out var prototype);
if (prototype != null)
if (_markingManager.TryGetMarking(marking, out var prototype))

Comment on lines 314 to 315
_markingManager.TryGetMarking(marking, out var prototype);
if (prototype != null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_markingManager.TryGetMarking(marking, out var prototype);
if (prototype != null)
if (_markingManager.TryGetMarking(marking, out var prototype))

@PaulRuddsAssFuzz
Copy link

Weh-the-weh is in shambles rn
(Why not only have it in the Decal menu for reasons like that?)

@K-Dynamic
Copy link
Contributor

Weh-the-weh is in shambles rn (Why not only have it in the Decal menu for reasons like that?)

weh-the-weh will just wear a green jumpsuit, plus their appeal is in their funny face

@SlamBamActionman
Copy link
Member Author

Added a "How to test" section in the PR description to help out how to test it.

@SpaceLizardSky
Copy link
Contributor

are these colourable?

@SlamBamActionman
Copy link
Member Author

are these colourable?

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.

@Morp9x
Copy link

Morp9x commented Nov 6, 2024

I have concerns that this PR could significantly harm the development of NewMed. Has this issue been discussed with the maintainers?

@SlamBamActionman
Copy link
Member Author

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.

Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the Merge Conflict This PR currently has conflicts that need to be addressed. label Nov 13, 2024
@bruhmogus
Copy link

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.

@SlamBamActionman
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changes: Sprites Should be reviewed or fixed by people who are knowledgeable with spriting or visual design. Changes: UI Can be reviewed or fixed by people who are knowledgeable with UI design Merge Conflict This PR currently has conflicts that need to be addressed. Status: Needs Review This PR requires new reviews before it can be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants