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

Guidebook Tables #28484

Merged
merged 3 commits into from
Jun 2, 2024
Merged

Guidebook Tables #28484

merged 3 commits into from
Jun 2, 2024

Conversation

EmoGarbage404
Copy link
Member

@EmoGarbage404 EmoGarbage404 commented Jun 1, 2024

About the PR

Adds support for nice looking tables in the guidebook.

the new <Table> control allows you to lay stuff out nicely in a table without gridcontainer jank.
We also now have <ColoredBox> which is basically just Box on a panelcontainer and with better defaults. Good for tables and not much else.

Text centering is omegafucked because of guidebook jank but HEY IT WORKS it's good enough for a first pass and doesn't completely suck to write

Technical details

PJB graciously coded TableContainer in the middle of the night to make this shit easy.
TableContainer needs to be moved to engine but this is high priority

image

Media

image

made with the following XML

<Table Columns="3">
  <ColorBox Color="#994444">
    <Box>
      HEADER 1
    </Box>
  </ColorBox>
  <ColorBox Color="#449944">
    <Box>
      HEADER 2
    </Box>
  </ColorBox>
  <ColorBox Color="#444499">
    <Box>
      HEADER 3
    </Box>
  </ColorBox>
  <ColorBox>
    <Box HorizontalAlignment="Left" VerticalAlignment="Stretch" Margin="2">
      body 1
    </Box>
  </ColorBox>
  <ColorBox>
    <Box HorizontalAlignment="Left" VerticalAlignment="Stretch" Margin="2">
      body 2 OASDKFA F ASDKF ASD FKASD LFKA SLFKA SL
    </Box>
  </ColorBox>
  <ColorBox>
    <Box HorizontalAlignment="Left" VerticalAlignment="Stretch" Margin="2">
      body 3 BUT IT GOES CRAZY AND OFF THE RAILS OH MY GOD ITS ASDF ASF ASDFASKD FNMXV EWOR QIWEORP SV
    </Box>
  </ColorBox>
</Table>
  • I have added screenshots/videos to this PR showcasing its changes ingame, or this PR does not require an ingame showcase

Breaking changes

Changelog

no cl no fun but much thanks to PJB

@lzk228
Copy link
Contributor

lzk228 commented Jun 1, 2024

bless you 🙏

@Brandon-Huu
Copy link
Contributor

Is it possible to set the dimensions of each column?

@Partmedia
Copy link
Contributor

A few comments from me:

  • Is there a reasonable way to merge ColorBox with the Box (and a color property?) Or are the defaults too different to reconcile?
  • I'm having trouble getting vertical alignment to work in the table (see code below):
<Table Columns="3">
  <ColorBox Color="#994444">
    <Box>
      HEADER 1
    </Box>
  </ColorBox>
  <ColorBox Color="#449944">
    <Box VerticalAlignment="Center">
      HEADER 2
    </Box>
  </ColorBox>
  <ColorBox Color="#444499">
    <Box>
      HEADER 3
    </Box>
  </ColorBox>
  <ColorBox>
    <Box HorizontalAlignment="Left" VerticalAlignment="Stretch" Margin="2">
      body 1
    </Box>
  </ColorBox>
  <ColorBox>
    <Box HorizontalAlignment="Left" VerticalAlignment="Stretch" Margin="2">
      body 2 OASDKFA F ASDKF ASD FKASD LFKA SLFKA SL
    </Box>
  </ColorBox>
  <ColorBox>
    <Box HorizontalAlignment="Center" VerticalAlignment="Stretch" Margin="2">
      body 3 BUT IT GOES CRAZY AND OFF THE RAILS OH MY GOD ITS ASDF ASF ASDFASKD FNMXV EWOR QIWEORP SV
    </Box>
  </ColorBox>
</Table>
  • This feels more like a "grid flow" layout than a table, but that's a small matter of naming.

Otherwise I feel that this serves a useful need and should go in even if it's a little imperfect now.

@EmoGarbage404
Copy link
Member Author

Is there a reasonable way to merge ColorBox with the Box

it's completely doable to merge them but for the purposes of making tables doing it like this offered the least amount of boilerplate. I guess coloredbox could be renamed TableCell or something to be more clear in that but it's also not strictly bound to that either.

I'm having trouble getting vertical alignment to work in the table (see code below)

To be quite honest i was having this issue too and couldn't really get decent vertical alignment. It might have to do with how the guidebook constructs text controls. I really was just focused on getting the basics out quickly because ik this is very high priority.

This feels more like a "grid flow" layout than a table, but that's a small matter of naming

it's really only called "table" because the UI control is called "TableControl." It is indeed more of a grid flow layout but i didn't really want to cause confusion with GridContainer. It's just mirroring the name a la "Box" and "BoxContainer"

@mirrorcult
Copy link
Contributor

agree with notafet but also id rather this just gets in rn in this state

@mirrorcult mirrorcult merged commit 21d0b1f into space-wizards:master Jun 2, 2024
12 checks passed
@EmoGarbage404 EmoGarbage404 deleted the cooltables branch June 2, 2024 03:58
Erisfiregamer1 pushed a commit to The-Arcadis-Team/arc-station-14 that referenced this pull request Jan 9, 2025
…e-wizards#1427)

# Description
This ports the Guidebook Tables to allow \<Table\> and \<ColorBox\>
embeds in the Guidebook.
This just adds extra XML tags to use in rich-text.

---

# TODO
- [x] Cherry-Pick the PR.
- [x] Tested to make sure it works. It does actively work.

---

# Media
<details><summary><h3>Guidebook Screenshot</h3></summary>
<p>

![image](https://github.com/user-attachments/assets/289e4c72-dcef-4489-b89e-5a2d6367124f)
</p>
</details>

NOTE: This screenshot was taken in the dev-environment. I just
copy-pasted my SOP for Alert Levels to check it, since it uses both the
\<Table\> and \<ColorBox\> identifiers.

---

# Changelog
:cl:
- add: Added <Table> and <ColorBox> identifiers. Go wild in SOP!

Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants