Skip to content

Add horizontal alignment support to RichTextLabel#6472

Open
Kofeecheks wants to merge 1 commit intospace-wizards:masterfrom
Kofeecheks:fix-flex-grid
Open

Add horizontal alignment support to RichTextLabel#6472
Kofeecheks wants to merge 1 commit intospace-wizards:masterfrom
Kofeecheks:fix-flex-grid

Conversation

@Kofeecheks
Copy link

Robust.Client/UserInterface/Controls/RichTextLabel.cs
Added Align property to RichTextLabel with Left as the default behavior.
Updated the draw path to pass the requested alignment into RichTextEntry.Draw(...).

Robust.Client/UserInterface/RichTextEntry.cs
Extended Draw(...) to support horizontal alignment at the rich-text layout level.
Added per-line width calculation so wrapped text is aligned line by line instead of shifting the whole text block.
Updated baseline positioning on line breaks to apply Center / Right offsets correctly.
Refactored ProcessNode(...) to take tagsAllowed explicitly so the new draw and measurement paths can reuse the same parsing logic.

Result
RichTextLabel now supports correct horizontal alignment for wrapped rich text, including multi-line content and inline controls, while preserving existing left-aligned behavior by default.

Added Align to RichTextLabel and passed it into RichTextEntry.Draw().
Updated RichTextEntry to calculate line widths and apply horizontal offsets so wrapped rich text can be centered or right-aligned correctly.
@moonheart08
Copy link
Contributor

This needs screenshots of:

  • The game functioning as intended in various UI states (i.e. lobby, control zoos, etc)
  • The feature functioning as intended on various sample texts (incl. font size and color changes, wrapping, etc.)

@Tayrtahn Tayrtahn added the A: UI Things like game screens, menus, and windows. label Mar 23, 2026
@Kofeecheks
Copy link
Author

This needs screenshots of:

  • The game functioning as intended in various UI states (i.e. lobby, control zoos, etc)
  • The feature functioning as intended on various sample texts (incl. font size and color changes, wrapping, etc.)

This pull request is part of the effort to add a table and content rendering system to the Media Wiki for the Russian server.

dead-space-server/space-station-14-soyuz#157

https://youtu.be/sLDwr7JNSzc

@Kofeecheks
Copy link
Author

@moonheart08 you can merge?

@moonheart08
Copy link
Contributor

I can't easily review this video and need to spend time testing this myself when I have time unless screenshots and ideally a UITestControl page are provided for demonstrating this works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A: UI Things like game screens, menus, and windows.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants