Skip to content

Commit

Permalink
Backpack Loadout Category (#957)
Browse files Browse the repository at this point in the history
# Description

#794 apparently
silently deprecated the Backpack Preferences button. Selecting a
backpack preference no longer actually does anything, and instead your
backpack comes from your Loadout. This would have been fine if we were
warned about this, but because nobody merged upstream for 2 weeks after
the release of PR794, this issue went unreported.

Well now the solution is going to require adding every backpack in the
entire game to a new Backpacks tab. I've started this PR, but because
it's really late and I have Calculus classes in the morning, I won't be
able to finish it tonight. So I'm enlisting the help of a few other
people I know to PR to this PR to help get the backpacks in.

After we have backpacks in the loadout tab, and after Wizmerge, I'll
probably do a separate PR to actually remove the now useless Backpack
selection button.

This is probably for the better long term. Since this technically means
Backpack slots are no longer hardcoded to "Backpack/Duffelbag/Satchel",
and now the back slot is freeeeee to be used for anything.

<details><summary><h1>Media</h1></summary>
<p>


![image](https://github.com/user-attachments/assets/7081660f-68f0-471e-99eb-67f026b7e122)

</p>
</details>

# Changelog

:cl:
- add: Backpacks, Duffelbags, and Satchels have been added to loadouts.
- remove: The button for "Backpack Preference" has been removed.
Backpacks selection is now done via Loadouts.
- remove: The button for "Suit/Skirt Preference" has also been removed.
Suit selection is done via Loadouts.
  • Loading branch information
VMSolidus authored Sep 28, 2024
1 parent b75052a commit bf8e970
Show file tree
Hide file tree
Showing 17 changed files with 4,378 additions and 152 deletions.
12 changes: 0 additions & 12 deletions Content.Client/Preferences/UI/HumanoidProfileEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,6 @@
<Control HorizontalExpand="True"/>
<Button Name="ShowLoadouts" Pressed="True" ToggleMode="True" Text="{Loc 'Show'}" 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;

namespace Content.Client.Preferences.UI
Expand All @@ -63,8 +57,6 @@ public sealed partial class HumanoidProfileEditor : BoxContainer
private OptionButton _sexButton => CSexButton;
private OptionButton _genderButton => CPronounsButton;
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 @@ -408,33 +400,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 @@ -975,24 +940,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 @@ -1162,22 +1109,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 @@ -1344,8 +1275,6 @@ public void UpdateControls()
UpdateGenderControls();
UpdateSkinColor();
UpdateSpecies();
UpdateClothingControls();
UpdateBackpackControls();
UpdateSpawnPriorityControls();
UpdateAgeEdit();
UpdateEyePickers();
Expand Down
Loading

0 comments on commit bf8e970

Please sign in to comment.