From 3c67a092a37db2f8c389db8662efcb026063b450 Mon Sep 17 00:00:00 2001 From: SpicyDarkFox Date: Tue, 3 Sep 2024 21:27:49 +0300 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=20=D1=80=D0=B5=D0=B4?= =?UTF-8?q?=D0=B0=D0=BA=D1=82=D0=BE=D1=80=D0=B0=20=D0=BF=D0=B5=D1=80=D1=81?= =?UTF-8?q?=D0=BE=D0=BD=D0=B0=D0=B6=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Client/Humanoid/MarkingPicker.xaml.cs | 17 ++++++++++++++++ .../Humanoid/SingleMarkingPicker.xaml.cs | 17 ++++++++++++++++ .../Preferences/UI/CharacterSetupGui.xaml.cs | 20 +++++++++---------- .../Preferences/UI/HumanoidProfileEditor.xaml | 12 +++++------ .../UI/HumanoidProfileEditor.xaml.cs | 2 +- .../Mobs/Customization/Markings/cat_parts.yml | 2 ++ Resources/Prototypes/Species/human.yml | 8 ++++---- 7 files changed, 57 insertions(+), 21 deletions(-) diff --git a/Content.Client/Humanoid/MarkingPicker.xaml.cs b/Content.Client/Humanoid/MarkingPicker.xaml.cs index 0e0b9dd384..76a0b74213 100644 --- a/Content.Client/Humanoid/MarkingPicker.xaml.cs +++ b/Content.Client/Humanoid/MarkingPicker.xaml.cs @@ -10,6 +10,9 @@ using Robust.Shared.Prototypes; using Robust.Shared.Utility; using static Robust.Client.UserInterface.Controls.BoxContainer; +#if LPP_Sponsors // _LostParadise-Sponsors +using Content.Client._LostParadise.Sponsors; +#endif namespace Content.Client.Humanoid; @@ -18,6 +21,9 @@ public sealed partial class MarkingPicker : Control { [Dependency] private readonly MarkingManager _markingManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!; +#if LPP_Sponsors // _LostParadise-Sponsors + [Dependency] private readonly SponsorsManager _sponsorsManager = default!; +#endif public Action? OnMarkingAdded; public Action? OnMarkingRemoved; @@ -224,6 +230,17 @@ public void Populate(string filter) var item = CMarkingsUnused.AddItem($"{GetMarkingName(marking)}", marking.Sprites[0].Frame0()); item.Metadata = marking; + +#if LPP_Sponsors // _LostParadise-Sponsors + if (marking.SponsorOnly) + { + item.Disabled = true; + if (_sponsorsManager.TryGetInfo(out var sponsor)) + { + item.Disabled = !(sponsor.AllowedMarkings.Contains(marking.ID) || sponsor.AllowedMarkings.Contains("ALL")); + } + } +#endif } CMarkingPoints.Visible = _currentMarkings.PointsLeft(_selectedMarkingCategory) != -1; diff --git a/Content.Client/Humanoid/SingleMarkingPicker.xaml.cs b/Content.Client/Humanoid/SingleMarkingPicker.xaml.cs index be3130a58b..3c53f0e4a8 100644 --- a/Content.Client/Humanoid/SingleMarkingPicker.xaml.cs +++ b/Content.Client/Humanoid/SingleMarkingPicker.xaml.cs @@ -4,6 +4,9 @@ using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.XAML; using Robust.Client.Utility; +#if LPP_Sponsors // _LostParadise-Sponsors +using Content.Client._LostParadise.Sponsors; +#endif namespace Content.Client.Humanoid; @@ -11,6 +14,9 @@ namespace Content.Client.Humanoid; public sealed partial class SingleMarkingPicker : BoxContainer { [Dependency] private readonly MarkingManager _markingManager = default!; +#if LPP_Sponsors // _LostParadise-Sponsors + [Dependency] private readonly SponsorsManager _sponsorsManager = default!; +#endif /// /// What happens if a marking is selected. @@ -191,6 +197,17 @@ public void PopulateList(string filter) var item = MarkingList.AddItem(Loc.GetString($"marking-{id}"), marking.Sprites[0].Frame0()); item.Metadata = marking.ID; +#if LPP_Sponsors // _LostParadise-Sponsors + if (marking.SponsorOnly) + { + item.Disabled = true; + if (_sponsorsManager.TryGetInfo(out var sponsor)) + { + item.Disabled = !(sponsor.AllowedMarkings.Contains(marking.ID) || sponsor.AllowedMarkings.Contains("ALL")); + } + } +#endif + if (_markings[Slot].MarkingId == id) { _ignoreItemSelected = true; diff --git a/Content.Client/Preferences/UI/CharacterSetupGui.xaml.cs b/Content.Client/Preferences/UI/CharacterSetupGui.xaml.cs index e474c5b7f9..359dfbb7d9 100644 --- a/Content.Client/Preferences/UI/CharacterSetupGui.xaml.cs +++ b/Content.Client/Preferences/UI/CharacterSetupGui.xaml.cs @@ -111,9 +111,9 @@ private void UpdateUI() Loc.GetString("character-setup-gui-create-new-character-button-tooltip", ("maxCharacters", _preferencesManager.Settings!.MaxCharacterSlots)); - #if LPP_Sponsors - var isDisplayedMaxSlots = false; // _LostParadise-Sponsors возможно использование дополнительных слотов - #endif +#if LPP_Sponsors + var isDisplayedMaxSlots = false; // _LostParadise-Sponsors возможно использование дополнительных слотов +#endif foreach (var (slot, character) in _preferencesManager.Preferences!.Characters) { @@ -122,10 +122,10 @@ private void UpdateUI() continue; } - #if LPP_Sponsors // _LostParadise-Sponsors + #if LPP_Sponsors // _LostParadise-Sponsors isDisplayedMaxSlots = numberOfFullSlots >= _preferencesManager.Settings.MaxCharacterSlots; - if (isDisplayedMaxSlots) break; - #endif + if (isDisplayedMaxSlots) break; +#endif numberOfFullSlots++; var characterPickerButton = new CharacterPickerButton(_entityManager, @@ -147,12 +147,12 @@ private void UpdateUI() }; } - #if LPP_Sponsors // _LostParadise-Sponsors - _createNewCharacterButton.Disabled = isDisplayedMaxSlots; - #else +#if LPP_Sponsors // _LostParadise-Sponsors + _createNewCharacterButton.Disabled = isDisplayedMaxSlots; +#else _createNewCharacterButton.Disabled = numberOfFullSlots >= _preferencesManager.Settings.MaxCharacterSlots; - #endif +#endif Characters.AddChild(_createNewCharacterButton); // TODO: Move this shit to the Lobby UI controller } diff --git a/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml b/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml index de57753db7..173e44a797 100644 --- a/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml +++ b/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml @@ -191,12 +191,6 @@ - - - - - - @@ -205,6 +199,12 @@ + + + + + + diff --git a/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs b/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs index f5a2ceb394..ada7b39f79 100644 --- a/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs +++ b/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs @@ -555,7 +555,7 @@ public HumanoidProfileEditor(IClientPreferencesManager preferencesManager, IProt #endregion Save #region Markings - _tabContainer.SetTabTitle(5, Loc.GetString("humanoid-profile-editor-markings-tab")); + _tabContainer.SetTabTitle(6, Loc.GetString("humanoid-profile-editor-markings-tab")); CMarkings.OnMarkingAdded += OnMarkingChange; CMarkings.OnMarkingRemoved += OnMarkingChange; diff --git a/Resources/Prototypes/Entities/Mobs/Customization/Markings/cat_parts.yml b/Resources/Prototypes/Entities/Mobs/Customization/Markings/cat_parts.yml index de88a17fd7..7a348944f0 100644 --- a/Resources/Prototypes/Entities/Mobs/Customization/Markings/cat_parts.yml +++ b/Resources/Prototypes/Entities/Mobs/Customization/Markings/cat_parts.yml @@ -3,6 +3,7 @@ bodyPart: HeadTop markingCategory: HeadTop speciesRestriction: [Human] + sponsorOnly: true coloring: default: type: @@ -26,6 +27,7 @@ bodyPart: Tail markingCategory: Tail speciesRestriction: [Human] + sponsorOnly: true coloring: default: type: diff --git a/Resources/Prototypes/Species/human.yml b/Resources/Prototypes/Species/human.yml index 99ec35da2e..ac864877bf 100644 --- a/Resources/Prototypes/Species/human.yml +++ b/Resources/Prototypes/Species/human.yml @@ -48,19 +48,19 @@ points: 1 required: false Tail: # the cat tail joke - points: 0 + points: 1 required: false HeadTop: # the cat ear joke - points: 0 + points: 1 required: false Chest: points: 1 required: false Legs: - points: 6 + points: 4 required: false Arms: - points: 6 + points: 4 required: false - type: humanoidBaseSprite