Skip to content

Commit

Permalink
Character Loadouts (rbertoche#28)
Browse files Browse the repository at this point in the history
A tab in the HumanoidProfile editor with more tabs for categorization
used to select items (toys/clothing) that you wish to spawn with when
you join the round. Each item has an amount of points it takes, you have
a default of 9(?) points to spend.
Bloated to a remake of the character editor UI entirely.

- [x] LoadoutPrototype
- [x] Debug Prototypes
- [x] More example prototypes
- [x] Release Prototypes
- [x] Why do we need 2 variables to categorize it?
---
- [x] Character editor tab
- [x] Locale
- [x] Loadout tabs, autogenerated via prototypes
- [x] Fix traits and loadouts unrendering the preview
- [x] Better solution for reloading UI instead of saving
- [ ] Scrolling SubTab bar
- [x] Scrolling loadout list
- [x] Icons in the list
---
- [x] Points system
- [x] Job whitelist
- [x] Show job whitelist in tooltip
---
- [x] Database
- [x] Save loadout preferences
---
- [x] Give items on join, in bag (on floor if no bag)
- [x] Exclusive option, tries to equip the item wherever it can

---------

Co-authored-by: Pspritechologist <81725545+Pspritechologist@users.noreply.github.com>
  • Loading branch information
2 people authored and Day-OS committed Mar 2, 2024
1 parent 66af6b7 commit 24f3795
Show file tree
Hide file tree
Showing 37 changed files with 6,280 additions and 59 deletions.
12 changes: 7 additions & 5 deletions Content.Client/Preferences/UI/CharacterSetupGui.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,18 @@
<gfx:StyleBoxFlat BackgroundColor="{x:Static style:StyleNano.NanoGold}" ContentMarginTopOverride="2" />
</PanelContainer.PanelOverride>
</PanelContainer>
<BoxContainer Orientation="Horizontal" VerticalExpand="True" SeparationOverride="0">
<ScrollContainer MinSize="325 0" Margin="5 5 0 0">
<BoxContainer Name="Characters" Orientation="Vertical" />
<BoxContainer Orientation="Vertical" VerticalExpand="True" HorizontalExpand="True" SeparationOverride="0">
<ScrollContainer MinSize="450 64" Margin="5 5 0 0">
<BoxContainer Name="Characters" Orientation="Horizontal" />
</ScrollContainer>
<PanelContainer MinSize="2 0">
<PanelContainer MinSize="0 2">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="{x:Static style:StyleNano.NanoGold}" ContentMarginTopOverride="2" />
</PanelContainer.PanelOverride>
</PanelContainer>
<BoxContainer Name="CharEditor" />
<BoxContainer Orientation="Horizontal" VerticalExpand="True" HorizontalExpand="True" SeparationOverride="0">
<BoxContainer Name="CharEditor" VerticalExpand="True" HorizontalExpand="True" />
</BoxContainer>
</BoxContainer>
</BoxContainer>
</Control>
Expand Down
4 changes: 2 additions & 2 deletions Content.Client/Preferences/UI/CharacterSetupGui.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ public CharacterPickerButton(
{
Text = description,
ClipText = true,
MinSize = (100, 0),
HorizontalExpand = true
};
var deleteButton = new Button
Expand All @@ -229,16 +230,15 @@ public CharacterPickerButton(
};
deleteButton.OnPressed += _ =>
{
deleteButton.Visible = false;
confirmDeleteButton.Visible = true;
};

var internalHBox = new BoxContainer
{
Orientation = LayoutOrientation.Horizontal,
HorizontalExpand = true,
MinSize = (125, 0),
SeparationOverride = 0,
Children =
{
Expand Down
54 changes: 39 additions & 15 deletions Content.Client/Preferences/UI/HumanoidProfileEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls">
<BoxContainer Orientation="Horizontal">
<!-- Left side -->
<BoxContainer Orientation="Vertical" Margin="10 10 10 10">
<BoxContainer Orientation="Horizontal" Margin="10 10 10 10">
<!-- Middle container -->
<BoxContainer Orientation="Horizontal" SeparationOverride="10">
<BoxContainer Orientation="Vertical" SeparationOverride="10">
<!-- Name box-->
<BoxContainer Orientation="Vertical">
<prefUi:HighlightedContainer>
Expand All @@ -17,11 +17,15 @@
<BoxContainer Orientation="Horizontal" VerticalExpand="True">
<Label Text="{Loc 'humanoid-profile-editor-name-label'}" />
<LineEdit Name="CNameEdit" MinSize="270 0" VerticalAlignment="Center" Margin="5 0 0 0" />
<Button Name="CNameRandomize" Text="{Loc 'humanoid-profile-editor-name-random-button'}" />
</BoxContainer>
<Button Name="CRandomizeEverything" HorizontalAlignment="Center"
HorizontalExpand="False" MaxWidth="256"
Text="{Loc 'humanoid-profile-editor-randomize-everything-button'}" />
<BoxContainer Orientation="Horizontal" VerticalExpand="True">
<Button Name="CNameRandomize" Text="{Loc 'humanoid-profile-editor-name-random-button'}"
HorizontalAlignment="Center"
HorizontalExpand="False" MaxWidth="256" />
<Button Name="CRandomizeEverything" HorizontalAlignment="Center"
HorizontalExpand="False" MaxWidth="256"
Text="{Loc 'humanoid-profile-editor-randomize-everything-button'}" />
</BoxContainer>
<RichTextLabel Name="CWarningLabel" HorizontalExpand="False"
VerticalExpand="True" MaxWidth="425"
HorizontalAlignment="Left" />
Expand All @@ -30,25 +34,31 @@
</BoxContainer>
</prefUi:HighlightedContainer>
</BoxContainer>
<!-- Import/Export -->
<BoxContainer Orientation="Vertical">
<prefUi:HighlightedContainer>
<BoxContainer Orientation="Horizontal">
<!-- Import/Export -->
<Button Text="{Loc 'humanoid-profile-editor-import-button'}" Disabled="True"
ToolTip="{Loc 'generic-not-yet-implemented'}" />
ToolTip="{Loc 'generic-not-yet-implemented'}"
HorizontalAlignment="Center" />
<Button Text="{Loc 'humanoid-profile-editor-export-button'}" Disabled="True"
ToolTip="{Loc 'generic-not-yet-implemented'}" />
ToolTip="{Loc 'generic-not-yet-implemented'}"
HorizontalAlignment="Center" />
<!-- Save -->
<Button Name="CSaveButton" Text="{Loc 'humanoid-profile-editor-save-button'}"
HorizontalAlignment="Center" />
</BoxContainer>
</prefUi:HighlightedContainer>
<!-- Save -->
<prefUi:HighlightedContainer>
<Button Name="CSaveButton" Text="{Loc 'humanoid-profile-editor-save-button'}" HorizontalAlignment="Center" />
</prefUi:HighlightedContainer>
</BoxContainer>
<BoxContainer Orientation="Vertical" Margin="15">
<Control Name="CSpriteViewFront" VerticalExpand="True" SizeFlagsStretchRatio="1" />
<Control MinHeight="40" />
<Control Name="CSpriteViewSide" VerticalExpand="True" SizeFlagsStretchRatio="1" />
</BoxContainer>
</BoxContainer>
<Control MinHeight="10" />
<Control MinWidth="10" />
<!-- tabContainer -->
<TabContainer Name="CTabContainer" VerticalExpand="True">
<TabContainer Name="CTabContainer" MinWidth="750" VerticalExpand="True" HorizontalExpand="True">
<BoxContainer Orientation="Vertical">
<ScrollContainer VerticalExpand="True">
<!-- appearanceList -->
Expand Down Expand Up @@ -137,10 +147,24 @@
</BoxContainer>
<BoxContainer Orientation="Vertical" Margin="10">
<!-- Traits -->
<BoxContainer Orientation="Horizontal">
<Label Text="Available Points: " />
<!-- Keep this value consistent with the Update__Preferences function's default 'points' value or issues will arise. -->
<Label Text="0" Name="TraitPoints" />
</BoxContainer>
<Label Text="" />
<Label Text="Positive" />
<ScrollContainer VerticalExpand="True">
<BoxContainer Name="CTraitsList" Orientation="Vertical" />
</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" />
<ScrollContainer VerticalExpand="True">
<TabContainer Name="CLoadoutsTabs" VerticalExpand="True" />
</ScrollContainer>
</BoxContainer>
<BoxContainer Name="CMarkingsTab" Orientation="Vertical" Margin="10">
<!-- Markings -->
<ScrollContainer VerticalExpand="True">
Expand Down
Loading

0 comments on commit 24f3795

Please sign in to comment.