From 52628d0393f5da0e78baefdcf860f28403a1270e Mon Sep 17 00:00:00 2001 From: Cinka Date: Fri, 16 Feb 2024 13:22:43 +0300 Subject: [PATCH] - add: change genitals on appearance --- .../Humanoid/HumanoidAppearanceSystem.cs | 9 + .../Preferences/UI/HumanoidProfileEditor.xaml | 5 +- .../UI/HumanoidProfileEditor.xaml.cs | 10 + Content.Client/_Amour/Hole/HoleSystem.cs | 7 - .../GenitalBoxView.xaml | 8 + .../GenitalBoxView.xaml.cs | 25 + .../GenitalController.xaml | 18 + .../GenitalController.xaml.cs | 153 ++ .../HumanoidProfileEditor.Genitals.cs | 68 + .../Tests/Preferences/ServerDbSqliteTests.cs | 2 +- Content.Server/Database/ServerDbBase.cs | 3 +- .../Systems/HumanoidAppearanceSystem.cs | 9 + .../Humanoid/HumanoidCharacterAppearance.cs | 49 +- Content.Shared/_Amour/Hole/Genital.cs | 19 + .../_Amour/Hole/GenitalsGroupPrototype.cs | 10 + .../_Amour/Hole/HoleSystem.Container.cs | 22 +- .../Locale/ru-RU/_amour/genitals/menu.ftl | 9 + .../Prototypes/Entities/Mobs/Species/base.yml | 14 + .../Prototypes/_Amour/Entities/Holes/base.yml | 101 + .../_Amour/Entities/Holes/breasts.yml | 2116 +++++++++++++++++ .../Prototypes/_Amour/Entities/Holes/butt.yml | 96 + .../_Amour/Entities/Holes/genitals.yml | 112 +- .../_Amour/Entities/Holes/penis.yml | 1300 ++++++++++ .../_Amour/Entities/Holes/testicles.yml | 380 +++ .../_Amour/Entities/Holes/vagina.yml | 192 ++ Resources/Prototypes/_Amour/genitalsGroup.yml | 456 ++++ 26 files changed, 5060 insertions(+), 133 deletions(-) create mode 100644 Content.Client/_Amour/HumanoidProfileEditorExt/GenitalBoxView.xaml create mode 100644 Content.Client/_Amour/HumanoidProfileEditorExt/GenitalBoxView.xaml.cs create mode 100644 Content.Client/_Amour/HumanoidProfileEditorExt/GenitalController.xaml create mode 100644 Content.Client/_Amour/HumanoidProfileEditorExt/GenitalController.xaml.cs create mode 100644 Content.Client/_Amour/HumanoidProfileEditorExt/HumanoidProfileEditor.Genitals.cs create mode 100644 Content.Shared/_Amour/Hole/Genital.cs create mode 100644 Content.Shared/_Amour/Hole/GenitalsGroupPrototype.cs create mode 100644 Resources/Locale/ru-RU/_amour/genitals/menu.ftl create mode 100644 Resources/Prototypes/_Amour/Entities/Holes/base.yml create mode 100644 Resources/Prototypes/_Amour/Entities/Holes/breasts.yml create mode 100644 Resources/Prototypes/_Amour/Entities/Holes/butt.yml create mode 100644 Resources/Prototypes/_Amour/Entities/Holes/penis.yml create mode 100644 Resources/Prototypes/_Amour/Entities/Holes/testicles.yml create mode 100644 Resources/Prototypes/_Amour/Entities/Holes/vagina.yml create mode 100644 Resources/Prototypes/_Amour/genitalsGroup.yml diff --git a/Content.Client/Humanoid/HumanoidAppearanceSystem.cs b/Content.Client/Humanoid/HumanoidAppearanceSystem.cs index 5bae35da5b..754aeb84da 100644 --- a/Content.Client/Humanoid/HumanoidAppearanceSystem.cs +++ b/Content.Client/Humanoid/HumanoidAppearanceSystem.cs @@ -1,3 +1,4 @@ +using Content.Client._Amour.Hole; using Content.Shared.Humanoid; using Content.Shared.Humanoid.Markings; using Content.Shared.Humanoid.Prototypes; @@ -12,6 +13,7 @@ public sealed class HumanoidAppearanceSystem : SharedHumanoidAppearanceSystem { [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly MarkingManager _markingManager = default!; + [Dependency] private readonly HoleSystem _holeSystem = default!; public override void Initialize() { @@ -195,6 +197,13 @@ public sealed class HumanoidAppearanceSystem : SharedHumanoidAppearanceSystem humanoid.SkinColor = profile.Appearance.SkinColor; humanoid.EyeColor = profile.Appearance.EyeColor; + //AMOUR + foreach (var genitals in profile.Appearance.Genitals) + { + Log.Debug("CHLEN! " + genitals.GenitalId); + _holeSystem.AddHole(uid,genitals.GenitalId,genitals.Color); + } + UpdateSprite(humanoid, Comp(uid)); } diff --git a/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml b/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml index 1347063c5b..54d992da52 100644 --- a/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml +++ b/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml @@ -2,7 +2,8 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:prefUi="clr-namespace:Content.Client.Preferences.UI" xmlns:humanoid="clr-namespace:Content.Client.Humanoid" - xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls"> + xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls" + xmlns:humanoidProfileEditorExt="clr-namespace:Content.Client._Amour.HumanoidProfileEditorExt"> @@ -141,6 +142,8 @@ + + diff --git a/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs b/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs index eb39674d4c..16df1271e7 100644 --- a/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs +++ b/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs @@ -211,6 +211,12 @@ namespace Content.Client.Preferences.UI #endregion //TTS-End + //AMOUR START + #region Genitals + InitializeGenitals(); + #endregion + //AMOUR END + #region Species //WD EDIT @@ -1239,6 +1245,10 @@ namespace Content.Client.Preferences.UI UpdateTTSVoicesControls(); //WD-EDIT + //Amour edit + UpdateGenitalsControls(); + //Amour edit + _preferenceUnavailableButton.SelectId((int) Profile.PreferenceUnavailable); } diff --git a/Content.Client/_Amour/Hole/HoleSystem.cs b/Content.Client/_Amour/Hole/HoleSystem.cs index e8084ec8de..a0a87ddb93 100644 --- a/Content.Client/_Amour/Hole/HoleSystem.cs +++ b/Content.Client/_Amour/Hole/HoleSystem.cs @@ -3,7 +3,6 @@ using Content.Shared.Humanoid; using Robust.Client.GameObjects; using Robust.Shared.Containers; using Robust.Shared.Reflection; -using Robust.Shared.Serialization.Manager; namespace Content.Client._Amour.Hole; @@ -35,10 +34,6 @@ public sealed class HoleSystem : SharedHoleSystem return; UpdateVisuals(uid); - if(args.Container != component.Slot) - return; - - //UpdateVisual(uid,args.Entity); } private void UpdateVisuals(Entity entity) @@ -78,8 +73,6 @@ public sealed class HoleSystem : SharedHoleSystem spriteComp.LayerSetData(GenitalVisualLayers.DickFront, layer); spriteComp.LayerSetVisible(GenitalVisualLayers.DickFront,true); } - - return; } diff --git a/Content.Client/_Amour/HumanoidProfileEditorExt/GenitalBoxView.xaml b/Content.Client/_Amour/HumanoidProfileEditorExt/GenitalBoxView.xaml new file mode 100644 index 0000000000..a5339636b3 --- /dev/null +++ b/Content.Client/_Amour/HumanoidProfileEditorExt/GenitalBoxView.xaml @@ -0,0 +1,8 @@ + + + + diff --git a/Content.Client/_Amour/HumanoidProfileEditorExt/GenitalBoxView.xaml.cs b/Content.Client/_Amour/HumanoidProfileEditorExt/GenitalBoxView.xaml.cs new file mode 100644 index 0000000000..7d59cacb4f --- /dev/null +++ b/Content.Client/_Amour/HumanoidProfileEditorExt/GenitalBoxView.xaml.cs @@ -0,0 +1,25 @@ +using Robust.Client.AutoGenerated; +using Robust.Client.UserInterface; +using Robust.Client.UserInterface.XAML; + +namespace Content.Client._Amour.HumanoidProfileEditorExt; + +[GenerateTypedNameReferences] +public sealed partial class GenitalBoxView : Control +{ + public GenitalBoxView() + { + RobustXamlLoader.Load(this); + } + + public void AddChild(Control control) + { + Container.AddChild(control); + } + + public void ClearChilds() + { + Container.RemoveAllChildren(); + } +} + diff --git a/Content.Client/_Amour/HumanoidProfileEditorExt/GenitalController.xaml b/Content.Client/_Amour/HumanoidProfileEditorExt/GenitalController.xaml new file mode 100644 index 0000000000..a35f419395 --- /dev/null +++ b/Content.Client/_Amour/HumanoidProfileEditorExt/GenitalController.xaml @@ -0,0 +1,18 @@ + + +