Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loadout Improvements #197

Merged
merged 4 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 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);
}
}
}
Expand Down Expand Up @@ -190,5 +195,13 @@ public static void GiveDummyJobClothes(EntityUid dummy, HumanoidCharacterProfile
}
}
}

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);
}
}
}
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
Loading