Skip to content

Commit

Permalink
Loadout Improvements (#197)
Browse files Browse the repository at this point in the history
# Changelog

:cl:
- fix: Fixed loadouts duplicating infinitely when the server restarted
- add: Loadouts can now be previewed in character selection
- add: Clothing and Loadout previews can be disabled or enabled
individually on the first character editor tab
- add: Added various new loadout items
  • Loading branch information
DEATHB4DEFEAT committed Aug 31, 2023
1 parent a0c76bf commit fb5d159
Show file tree
Hide file tree
Showing 30 changed files with 1,429 additions and 1,142 deletions.
15 changes: 15 additions & 0 deletions Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
using System.Linq;
using System.Numerics;
using Content.Client.Alerts;
using Content.Client.Hands.Systems;
using Content.Client.Humanoid;
using Content.Client.Inventory;
using Content.Client.Preferences;
using Content.Client.UserInterface.Controls;
using Content.Shared.Clothing;
using Content.Shared.Clothing.Components;
using Content.Shared.GameTicking;
using Content.Shared.Humanoid.Prototypes;
using Content.Shared.Inventory;
using Content.Shared.SimpleStation14.Loadouts;
using Content.Shared.Preferences;
using Content.Shared.Roles;
using Content.Shared.Traits;
Expand Down Expand Up @@ -136,6 +140,7 @@ public void UpdateUI()
_summaryLabel.Text = selectedCharacter.Summary;
_entityManager.System<HumanoidAppearanceSystem>().LoadProfile(_previewDummy.Value, selectedCharacter);
GiveDummyJobClothes(_previewDummy.Value, selectedCharacter);
GiveDummyLoadoutItems(_previewDummy.Value, selectedCharacter); // Parkstation-Loadouts
}
}
}
Expand Down Expand Up @@ -190,5 +195,15 @@ public static void GiveDummyJobClothes(EntityUid dummy, HumanoidCharacterProfile
}
}
}

// Parkstation-Loadouts-Start
public static void GiveDummyLoadoutItems(EntityUid dummy, HumanoidCharacterProfile profile)
{
var highPriorityJobId = profile.JobPriorities.FirstOrDefault(j => j.Value == JobPriority.High).Key;
var highPriorityJob = IoCManager.Resolve<IPrototypeManager>().Index<JobPrototype>(highPriorityJobId ?? SharedGameTicker.FallbackOverflowJob);

EntitySystem.Get<LoadoutSystem>().ApplyCharacterLoadout(dummy, highPriorityJob, profile);
}
// Parkstation-Loadouts-End
}
}
124 changes: 60 additions & 64 deletions Content.Client/Preferences/UI/HumanoidProfileEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,75 +62,72 @@
<ScrollContainer VerticalExpand="True">
<!-- appearanceList -->
<BoxContainer Orientation="Vertical">
<!-- SexAndAgeRow -->
<BoxContainer Orientation="Horizontal" SeparationOverride="10">
<!-- Sex -->
<prefUi:HighlightedContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'humanoid-profile-editor-sex-label'}" />
<OptionButton Name="CSexButton" />
</BoxContainer>
</prefUi:HighlightedContainer>
<!-- Age -->
<prefUi:HighlightedContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'humanoid-profile-editor-age-label'}" />
<LineEdit Name="CAgeEdit" MinSize="40 0" />
</BoxContainer>
</prefUi:HighlightedContainer>
<!-- Gender -->
<prefUi:HighlightedContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'humanoid-profile-editor-pronouns-label'}" />
<OptionButton Name="CPronounsButton" />
</BoxContainer>
</prefUi:HighlightedContainer>
</BoxContainer>
<BoxContainer Orientation="Horizontal" SeparationOverride="10">
<!-- Species -->
<prefUi:HighlightedContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'humanoid-profile-editor-species-label'}" />
<OptionButton Name="CSpeciesButton" />
</BoxContainer>
</prefUi:HighlightedContainer>
</BoxContainer>
<!-- Skin -->
<prefUi:HighlightedContainer>
<BoxContainer HorizontalExpand="True" Orientation="Vertical">
<Label Text="{Loc 'humanoid-profile-editor-skin-color-label'}" />
<Slider HorizontalExpand="True" Name="CSkin" MinValue="0" MaxValue="100" Value="20" />
<BoxContainer Name="CRgbSkinColorContainer" Visible="False" Orientation="Vertical" HorizontalExpand="True"></BoxContainer>
<BoxContainer Margin="10" Orientation="Vertical" HorizontalExpand="True">
<!-- Show clothing -->
<BoxContainer HorizontalExpand="True">
<Label Text="{Loc 'humanoid-profile-editor-clothing'}" />
<Control HorizontalExpand="True"/>
<Button Name="ShowClothes" Pressed="True" ToggleMode="True" Text="{Loc 'Show'}" HorizontalAlignment="Right" />
</BoxContainer>
</prefUi:HighlightedContainer>
<!-- Hair -->
<prefUi:HighlightedContainer>
<BoxContainer Orientation="Horizontal">
<humanoid:SingleMarkingPicker Name="CHairStylePicker" Category="Hair" />
<humanoid:SingleMarkingPicker Name="CFacialHairPicker" Category="FacialHair" />
<!-- Show loadouts -->
<BoxContainer HorizontalExpand="True">
<Label Text="{Loc 'humanoid-profile-editor-loadouts'}" />
<Control HorizontalExpand="True"/>
<Button Name="ShowLoadouts" Pressed="True" ToggleMode="True" Text="{Loc 'Show'}" HorizontalAlignment="Right" />
</BoxContainer>
</prefUi:HighlightedContainer>
<!-- Clothing -->
<prefUi:HighlightedContainer>
<BoxContainer Orientation="Horizontal">
<!-- Clothing -->
<BoxContainer HorizontalExpand="True">
<Label Text="{Loc 'humanoid-profile-editor-clothing-label'}" />
<OptionButton Name="CClothingButton" />
<Control HorizontalExpand="True"/>
<OptionButton Name="CClothingButton" HorizontalAlignment="Right" />
</BoxContainer>
</prefUi:HighlightedContainer>
<!-- Backpack -->
<prefUi:HighlightedContainer>
<BoxContainer Orientation="Horizontal">
<!-- Backpack -->
<BoxContainer HorizontalExpand="True">
<Label Text="{Loc 'humanoid-profile-editor-backpack-label'}" />
<OptionButton Name="CBackpackButton" />
<Control HorizontalExpand="True"/>
<OptionButton Name="CBackpackButton" HorizontalAlignment="Right" />
</BoxContainer>
</prefUi:HighlightedContainer>
<!-- Eyes -->
<prefUi:HighlightedContainer>
<BoxContainer Orientation="Vertical">
<Label Text="{Loc 'humanoid-profile-editor-eyes-label'}" />
<humanoid:EyeColorPicker Name="CEyeColorPicker" />
<!-- Sex -->
<BoxContainer HorizontalExpand="True">
<Label Text="{Loc 'humanoid-profile-editor-sex-label'}" />
<Control HorizontalExpand="True"/>
<OptionButton Name="CSexButton" HorizontalAlignment="Right" />
</BoxContainer>
</prefUi:HighlightedContainer>
<!-- Pronouns -->
<BoxContainer HorizontalExpand="True">
<Label Text="{Loc 'humanoid-profile-editor-pronouns-label'}" />
<Control HorizontalExpand="True"/>
<OptionButton Name="CPronounsButton" HorizontalAlignment="Right" />
</BoxContainer>
<!-- Age -->
<BoxContainer HorizontalExpand="True">
<Label Text="{Loc 'humanoid-profile-editor-age-label'}" />
<Control HorizontalExpand="True"/>
<LineEdit Name="CAgeEdit" MinSize="40 0" HorizontalAlignment="Right" />
</BoxContainer>
<!-- Species -->
<BoxContainer HorizontalExpand="True">
<Label Text="{Loc 'humanoid-profile-editor-species-label'}" />
<Control HorizontalExpand="True"/>
<OptionButton Name="CSpeciesButton" HorizontalAlignment="Right" />
</BoxContainer>
</BoxContainer>
<!-- Skin -->
<BoxContainer Margin="10" HorizontalExpand="True" Orientation="Vertical">
<Label Text="{Loc 'humanoid-profile-editor-skin-color-label'}" />
<Slider HorizontalExpand="True" Name="CSkin" MinValue="0" MaxValue="100" Value="20" />
<BoxContainer Name="CRgbSkinColorContainer" Visible="False" Orientation="Vertical" HorizontalExpand="True"></BoxContainer>
</BoxContainer>
<!-- Hair -->
<BoxContainer Margin="10" Orientation="Horizontal">
<humanoid:SingleMarkingPicker Name="CHairStylePicker" Category="Hair" />
<humanoid:SingleMarkingPicker Name="CFacialHairPicker" Category="FacialHair" />
</BoxContainer>
<!-- Eyes -->
<BoxContainer Margin="10" Orientation="Vertical">
<Label Text="{Loc 'humanoid-profile-editor-eyes-label'}" />
<humanoid:EyeColorPicker Name="CEyeColorPicker" />
</BoxContainer>
</BoxContainer>
</ScrollContainer>
</BoxContainer>
Expand Down Expand Up @@ -169,8 +166,7 @@
</ScrollContainer>
</BoxContainer>
<BoxContainer Orientation="Vertical" Margin="10" Name="CLoadoutsTab">
<!-- Keep this value consistent with the Update__Preferences function's default 'points' value or issues will arise. -->
<ProgressBar Name="LoadoutPoints" MaxValue="14" Value="14" />
<ProgressBar Name="LoadoutPoints" MaxValue="1" Value="1" />
<ScrollContainer VerticalExpand="True">
<TabContainer Name="CLoadoutsTabs" VerticalExpand="True" />
</ScrollContainer>
Expand Down
Loading

0 comments on commit fb5d159

Please sign in to comment.