General Character Editor Improvements#2252
Conversation
…ngines into cooler-cooler-markings
This comment was marked as spam.
This comment was marked as spam.
There was a problem hiding this comment.
Actionable comments posted: 5
🔭 Outside diff range comments (3)
Content.Client/Humanoid/MarkingPicker.xaml.cs (3)
1-17:⚠️ Potential issue
System.Collections.Genericimport is missingJust like the Sol‑bred slip‑up above,
List<T>et al. are used everywhere but never imported, dooming the whole editor to fail at the first compile.using System.Linq; using System.Numerics; +using System.Collections.Generic;
188-193: 🛠️ Refactor suggestionDouble‑localisation leads to garbled sort order
OrderBy(p => Loc.GetString(GetMarkingName(p)))callsLoc.GetStringtwice.GetMarkingNamealready returns the localised string, so the second call just re‑feeds an English sentence into the FTL lookup and probably returns the key. Sort will then be nonsense.- ).OrderBy(p => Loc.GetString(GetMarkingName(p))); + ).OrderBy(p => GetMarkingName(p));
315-345:⚠️ Potential issue
continue;renders the local function unreachable – won’t compileThe
continue;placed before the local functionChangedmakes that function unreachable, which C# forbids. Replace the pattern with an inline lambda.- colorSelector.OnColorChanged += Changed; - continue; - - void Changed(Color _) - { - _currentMarkingColors[colorIndex] = colorSelector.Color; - ColorChanged(prototype, colorIndex); - } + colorSelector.OnColorChanged += _ => + { + _currentMarkingColors[colorIndex] = colorSelector.Color; + ColorChanged(prototype, colorIndex); + };
🧹 Nitpick comments (6)
Content.Client/UserInterface/Controls/AlternatingBGContainer.xaml (1)
7-13: Consider enabling vertical expansion for the inner ScrollContainerRight now
ContentScrollContaineris scroll‑able but not set toVerticalExpand="True".
If the parent receives extra vertical space, the scroll area will stay its minimum height and the children will appear clipped until the user starts scrolling – not a great first impression for new recruits.- <ScrollContainer + <ScrollContainer Name="ContentScrollContainer" HorizontalExpand="True" + VerticalExpand="True" HScrollEnabled="False" VScrollEnabled="True" ReturnMeasure="True">Content.Client/Lobby/UI/HumanoidProfileEditor.xaml (1)
256-266: Minor accessibility nit – hard‑coded dark panel colourThe preview panel background
#2f2f2fis hard‑coded. Consider re‑using a colour from the shared palette (StyleBase.ColorDarkGreyetc.) so theme changes propagate automatically and contrast checks stay centralised.Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs (2)
762-765: Give the Antag list container HorizontalExpand for consistent width
altis anAlternatingBGContainerinserted intoAntagList, but withoutHorizontalExpand = truethe column can collapse and mis‑align with the jobs list beside it.- var alt = new AlternatingBGContainer { Orientation = LayoutOrientation.Vertical, }; + var alt = new AlternatingBGContainer + { + Orientation = LayoutOrientation.Vertical, + HorizontalExpand = true, + };
1835-1839: Consolidate redundantInvalidateMeasure()callsCalling
InvalidateMeasure()four times in quick succession is overkill – the UI will already queue a full layout pass after the first call. A single call on the parent container (or on any oneSpriteView) is enough.- SpriteViewS.InvalidateMeasure(); - SpriteViewN.InvalidateMeasure(); - SpriteViewE.InvalidateMeasure(); - SpriteViewW.InvalidateMeasure(); + SpriteViewS.Parent?.InvalidateMeasure(); // one pass is sufficientContent.Client/UserInterface/Controls/AlternatingBGContainer.xaml.cs (1)
99-108:UpdateColorsassumes each panel has at least one child
child.Children.First()will throw if an emptyPanelContainersneaks in. A defensive check avoids a potential crash from rogue code.- child.Visible = child.Children.First().Visible; + if (child.ChildCount > 0) + child.Visible = child.Children.First().Visible;Content.Client/Humanoid/MarkingPicker.xaml.cs (1)
250-252: Ensure point display updates when filter changes
UpdatePoints()is called after adding/removing markings, but not afterPopulateif the filter merely changes. A stale points label misleads users.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
Content.Client/Humanoid/MarkingPicker.xaml(1 hunks)Content.Client/Humanoid/MarkingPicker.xaml.cs(11 hunks)Content.Client/Lobby/UI/HumanoidProfileEditor.xaml(8 hunks)Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs(7 hunks)Content.Client/Lobby/UI/RequirementsSelector.xaml(1 hunks)Content.Client/UserInterface/Controls/AlternatingBGContainer.xaml(1 hunks)Content.Client/UserInterface/Controls/AlternatingBGContainer.xaml.cs(1 hunks)Content.Shared/Humanoid/Markings/MarkingPrototype.cs(1 hunks)Resources/Locale/en-US/preferences/ui/humanoid-profile-editor.ftl(1 hunks)Resources/Locale/en-US/preferences/ui/markings-picker.ftl(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: YAML Linter
- GitHub Check: YAML map schema validator
- GitHub Check: Test Packaging
- GitHub Check: build (ubuntu-latest)
- GitHub Check: build (ubuntu-latest)
- GitHub Check: Label
🔇 Additional comments (8)
Content.Shared/Humanoid/Markings/MarkingPrototype.cs (1)
41-43: Excellent addition of the PreviewDirection property, cadet!This new property allows for proper orientation control in marking previews, ensuring our personnel know exactly how they'll look before deployment. A proper strategic enhancement to our crew customization systems.
Content.Client/Lobby/UI/RequirementsSelector.xaml (3)
5-5: Margins properly aligned, ensign!This right-only margin of 5 units creates a more precise and orderly visual formation. The Biesel Republic's interfaces maintain proper spacing - unlike those sloppy Sol Alliance displays!
8-9: Strategic control insertion detected and approved!Adding this horizontally expanding control pushes other elements rightward - a perfect tactical maneuver for proper element alignment. This is how we maintain order in our fleet interfaces!
14-14: BoxContainer adjusted to regulation width, lieutenant!Setting a fixed width of 400 for the options container ensures consistent display across all viewports. The fleet demands precision in UI layouts!
Resources/Locale/en-US/preferences/ui/markings-picker.ftl (1)
29-29: Localization entry maintained at proper position, sailor!The "Underwear" category remains properly labeled in the interface. Our crew deserves clear markings for all customization options!
Resources/Locale/en-US/preferences/ui/humanoid-profile-editor.ftl (1)
28-31: Button labels properly clarified, commander!These more descriptive labels ("Import Character", "Export Character", "Save Changes", "Undo Changes") provide superior operational clarity compared to the previous vague designations. All crew members, regardless of rank, will now understand the exact function of each control!
The Biesel Republic demands clear communication in all interfaces - this update meets our high standards for UI design.
Content.Client/UserInterface/Controls/AlternatingBGContainer.xaml.cs (1)
64-79:FrameUpdatehack risks double‑adding controlsDuring the first frame every child not equal to
Containeris passed toAddControl, but if someone already calledAddControlmanually before the first frame you’ll end up wrapping the same control twice. Consider guarding withchild is PanelContaineror tracking which children were already processed.Content.Client/Humanoid/MarkingPicker.xaml.cs (1)
210-214: Null‑safe preview generationAccessing
marking.Sprites[0]without checkingSprites.CountrisksIndexOutOfRangeExceptionif a bad prototype sneaks through. A quick guard keeps the editor alive.- Texture = marking.Sprites[0].DirFrame0().TextureFor( + Texture = (marking.Sprites.Count > 0 + ? marking.Sprites[0].DirFrame0().TextureFor( Enum.TryParse<Direction>(marking.PreviewDirection, out var dir) ? dir : Direction.South) + : null),
| public Thickness ItemMargins = new(4); | ||
|
|
||
| /// The list of colors to alternate between | ||
| public List<Color> Colors = new() | ||
| { | ||
| Color.FromHex("#25252A"), | ||
| // Color.FromHex("#202025"), | ||
| Color.FromHex("#1B1B1E"), | ||
| }; | ||
|
|
There was a problem hiding this comment.
🛠️ Refactor suggestion
Expose collection changes safely or add documentation
public Thickness ItemMargins and public List<Color> Colors are mutable fields. A caller can mutate them at any time without updating existing children, desynchronising margins / colours. Either:
- Convert them to properties and invoke
UpdateColors()/ relayout in the setter, or - Add XML‑doc telling maintainers they must call
UpdateColors()after mutation.
| @@ -0,0 +1,110 @@ | |||
| using System.Linq; | |||
| using System.Numerics; | |||
There was a problem hiding this comment.
| using System.Numerics; |
| using Robust.Client.UserInterface.XAML; | ||
| using Robust.Shared.Timing; | ||
|
|
||
|
|
VMSolidus
left a comment
There was a problem hiding this comment.
There's also some new unused usings in HumanoidProfileEditor.xaml.cs that can be yeeyed in this PR before merging. Content.Client.Message and Direction = Robust.Shared.Maths.Direction can both be removed now that they're unused.
## About the PR this PR makes a lot of little visual and UX tweaks to the "appearance" tab in the character editor, including: - separating it into collapsible sections - moving "show/hide loadout/job equipment" and the "spawn priority" buttons out of the tab and to the top of the screen - porting the "alternating color rows" control from Simple-Station/Einstein-Engines#2252, courtesy of DEATHB4DEFEAT - making a lot of things multiple columns rather than just one very stretched out column - adding a "scale" label to height/width sliders to show what size your character is being multiplied by - ~~merging the "background" tab into the appearance panel as a new section~~ moved back - rearranging controls in ways i think are more intuitive - putting names at the top of details, making "skin" and "eyes" color display side-by-side, etc ## Why / Balance the "appearance" tab has had a lot of different fields tacked onto it and has become, in my opinion, pretty cluttered and arranged unintuitively. there is a LOT of horizontal space that is not being used very well at all. certain controls being way too wide hurts visual comprehension. it is a very complex tab in a way that is kind of necessary for it to be that way so i wanted to make it a bit more digestible ## Technical details - i hit `HumanoidProfileEditor.xaml` with a hammer until it died and then i kept going until it was reduced into shreds - removed the "background" tab and added the "dimension" label to `HumanoidProfileEditor.xaml.cs` - ported that one control from EE, i can't get the commit for it directly so i just manually added attribution for it ## Media <details> <summary><h1>WARNING: VERY LONG</h1></summary> <img width="1538" height="922" alt="2025-08-11_22-24" src="https://github.com/user-attachments/assets/7f502392-8b0b-45c4-b3bf-fae8d79a51d1" /> <img width="1542" height="922" alt="2025-08-11_22-26" src="https://github.com/user-attachments/assets/9ea0a281-5b83-4c61-bd12-ba0fb122ab95" /> https://github.com/user-attachments/assets/ec3c1161-3114-4109-be67-447e5920fce2 </details> after initial PRing the tabs have been rearranged a bit more, so Background is back in its own tab. here is what the Appearance tab looks like now: <img width="1298" height="691" alt="image" src="https://github.com/user-attachments/assets/3377f485-92fe-42d6-8ad5-8887a52c153f" /> <img width="1297" height="393" alt="image" src="https://github.com/user-attachments/assets/94763111-c402-4127-ba5e-395254a0b7de" /> ## Requirements - [x] I have read and am following the [Pull Request and Changelog Guidelines](https://docs.spacestation14.com/en/general-development/codebase-info/pull-request-guidelines.html). - [x] I have added media to this PR or it does not require an ingame showcase. - [x] I can confirm this PR contains no AI-generated content, and did not use any AI-generated content. ## Breaking changes if you port anything that affects the "appearance" tab you might piss and cry a little bit **Changelog** :cl: - tweak: The "Appearance" tab of the character editor has been visually overhauled, hopefully to make it more digestible. - tweak: NO, I did not fucking touch Loadouts, Traits, Markings, Records, or the character preview sprite. DOn't ask me
Description
This sucked, this sucks less now.
TODO
Media
Changelog
🆑