Skip to content

Commit

Permalink
Merge branch 'master' into BLcorp-Fixs
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgencheg authored Sep 29, 2024
2 parents 9f301f2 + 0844764 commit 991d3d8
Show file tree
Hide file tree
Showing 71 changed files with 5,221 additions and 426 deletions.
19 changes: 11 additions & 8 deletions Content.Client/Preferences/UI/CharacterSetupGui.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
using Robust.Shared.Prototypes;
using static Robust.Client.UserInterface.Controls.BoxContainer;
using Direction = Robust.Shared.Maths.Direction;
#if LPP_Sponsors
using Content.Client._LostParadise.Sponsors;
#endif

namespace Content.Client.Preferences.UI
{
Expand Down Expand Up @@ -107,22 +110,22 @@ private void UpdateUI()
if (!_preferencesManager.ServerDataLoaded)
return;

_createNewCharacterButton.ToolTip =
Loc.GetString("character-setup-gui-create-new-character-button-tooltip",
("maxCharacters", _preferencesManager.Settings!.MaxCharacterSlots));

#if LPP_Sponsors
var isDisplayedMaxSlots = false; // _LostParadise-Sponsors возможно использование дополнительных слотов
#endif

_createNewCharacterButton.ToolTip =
Loc.GetString("character-setup-gui-create-new-character-button-tooltip",
("maxCharacters", _preferencesManager.Settings!.MaxCharacterSlots));

foreach (var (slot, character) in _preferencesManager.Preferences!.Characters)
{
if (character is null)
{
continue;
continue;
}

#if LPP_Sponsors // _LostParadise-Sponsors
#if LPP_Sponsors // _LostParadise-Sponsors
isDisplayedMaxSlots = numberOfFullSlots >= _preferencesManager.Settings.MaxCharacterSlots;
if (isDisplayedMaxSlots) break;
#endif
Expand All @@ -138,7 +141,7 @@ private void UpdateUI()
var characterIndexCopy = slot;
characterPickerButton.OnPressed += args =>
{
_humanoidProfileEditor.Profile = (HumanoidCharacterProfile)character;
_humanoidProfileEditor.Profile = (HumanoidCharacterProfile) character;
_humanoidProfileEditor.CharacterSlot = characterIndexCopy;
_humanoidProfileEditor.UpdateControls();
_preferencesManager.SelectCharacter(character);
Expand Down Expand Up @@ -186,7 +189,7 @@ public CharacterPickerButton(
_previewDummy = entityManager.SpawnEntity(prototypeManager.Index<SpeciesPrototype>(SharedHumanoidAppearanceSystem.DefaultSpecies).DollPrototype, MapCoordinates.Nullspace);
}

EntitySystem.Get<HumanoidAppearanceSystem>().LoadProfile(_previewDummy, (HumanoidCharacterProfile)profile);
EntitySystem.Get<HumanoidAppearanceSystem>().LoadProfile(_previewDummy, (HumanoidCharacterProfile) profile);

if (humanoid != null)
{
Expand Down
12 changes: 0 additions & 12 deletions Content.Client/Preferences/UI/HumanoidProfileEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,6 @@
<Control HorizontalExpand="True"/>
<Button Name="ShowLoadouts" Pressed="True" ToggleMode="True" Text="{Loc 'Показать'}" HorizontalAlignment="Right" />
</BoxContainer>
<!-- Clothing -->
<BoxContainer HorizontalExpand="True">
<Label Text="{Loc 'humanoid-profile-editor-clothing-label'}" />
<Control HorizontalExpand="True"/>
<OptionButton Name="CClothingButton" HorizontalAlignment="Right" />
</BoxContainer>
<!-- Backpack -->
<BoxContainer HorizontalExpand="True">
<Label Text="{Loc 'humanoid-profile-editor-backpack-label'}" />
<Control HorizontalExpand="True"/>
<OptionButton Name="CBackpackButton" HorizontalAlignment="Right" />
</BoxContainer>
<!-- Spawn Priority -->
<BoxContainer HorizontalExpand="True">
<Label Text="{Loc 'humanoid-profile-editor-spawn-priority-label'}" />
Expand Down
71 changes: 0 additions & 71 deletions Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,21 @@
using Content.Client.Lobby;
using Content.Client.Message;
using Content.Client.Players.PlayTimeTracking;
using Content.Client.Roles;
using Content.Client.UserInterface.Controls;
using Content.Client.UserInterface.Systems.Guidebook;
using Content.Shared.CCVar;
using Content.Shared.Clothing.Components;
using Content.Shared.Clothing.Loadouts.Prototypes;
using Content.Shared.Clothing.Loadouts.Systems;
using Content.Shared.Customization.Systems;
using Content.Shared.GameTicking;
using Content.Shared.Humanoid;
using Content.Shared.Humanoid.Markings;
using Content.Shared.Humanoid.Prototypes;
using Content.Shared.Preferences;
using Content.Shared.Roles;
using Content.Shared.Roles.Jobs;
using Content.Shared.Traits;
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
using Robust.Client.Player;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
Expand All @@ -33,10 +29,8 @@
using Robust.Shared.Enums;
using Robust.Shared.Map;
using Robust.Shared.Physics;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using static Content.Client.Stylesheets.StyleBase;
using Direction = Robust.Shared.Maths.Direction;
#if LPP_Sponsors
using Content.Client._LostParadise.Sponsors;
Expand Down Expand Up @@ -68,8 +62,6 @@ public sealed partial class HumanoidProfileEditor : BoxContainer
private OptionButton _voiceButton => CVoiceButton; // LPP-TTS
private Button _voicePlayButton => CVoicePlayButton; // LPP-TTS
private Slider _skinColor => CSkin;
private OptionButton _clothingButton => CClothingButton;
private OptionButton _backpackButton => CBackpackButton;
private OptionButton _spawnPriorityButton => CSpawnPriorityButton;
private SingleMarkingPicker _hairPicker => CHairStylePicker;
private SingleMarkingPicker _facialHairPicker => CFacialHairPicker;
Expand Down Expand Up @@ -426,33 +418,6 @@ public HumanoidProfileEditor(IClientPreferencesManager preferencesManager, IProt

#endregion Hair

#region Clothing

_clothingButton.AddItem(Loc.GetString("humanoid-profile-editor-preference-jumpsuit"), (int) ClothingPreference.Jumpsuit);
_clothingButton.AddItem(Loc.GetString("humanoid-profile-editor-preference-jumpskirt"), (int) ClothingPreference.Jumpskirt);

_clothingButton.OnItemSelected += args =>
{
_clothingButton.SelectId(args.Id);
SetClothing((ClothingPreference) args.Id);
};

#endregion Clothing

#region Backpack

_backpackButton.AddItem(Loc.GetString("humanoid-profile-editor-preference-backpack"), (int) BackpackPreference.Backpack);
_backpackButton.AddItem(Loc.GetString("humanoid-profile-editor-preference-satchel"), (int) BackpackPreference.Satchel);
_backpackButton.AddItem(Loc.GetString("humanoid-profile-editor-preference-duffelbag"), (int) BackpackPreference.Duffelbag);

_backpackButton.OnItemSelected += args =>
{
_backpackButton.SelectId(args.Id);
SetBackpack((BackpackPreference) args.Id);
};

#endregion Backpack

#region SpawnPriority

foreach (var value in Enum.GetValues<SpawnPriorityPreference>())
Expand Down Expand Up @@ -1076,24 +1041,6 @@ private void SetName(string newName)
IsDirty = true;
}

private void SetClothing(ClothingPreference newClothing)
{
Profile = Profile?.WithClothingPreference(newClothing);
UpdateCharacterRequired();
IsDirty = true;
_controller.UpdateClothes = true;
UpdatePreview();
}

private void SetBackpack(BackpackPreference newBackpack)
{
Profile = Profile?.WithBackpackPreference(newBackpack);
UpdateCharacterRequired();
IsDirty = true;
_controller.UpdateClothes = true;
UpdatePreview();
}

private void SetSpawnPriority(SpawnPriorityPreference newSpawnPriority)
{
Profile = Profile?.WithSpawnPriorityPreference(newSpawnPriority);
Expand Down Expand Up @@ -1263,22 +1210,6 @@ private void UpdateGenderControls()
_genderButton.SelectId((int) Profile.Gender);
}

private void UpdateClothingControls()
{
if (Profile == null)
return;

_clothingButton.SelectId((int) Profile.Clothing);
}

private void UpdateBackpackControls()
{
if (Profile == null)
return;

_backpackButton.SelectId((int) Profile.Backpack);
}

private void UpdateSpawnPriorityControls()
{
if (Profile == null)
Expand Down Expand Up @@ -1445,8 +1376,6 @@ public void UpdateControls()
UpdateGenderControls();
UpdateSkinColor();
UpdateSpecies();
UpdateClothingControls();
UpdateBackpackControls();
UpdateSpawnPriorityControls();
UpdateAgeEdit();
UpdateEyePickers();
Expand Down
Loading

0 comments on commit 991d3d8

Please sign in to comment.