Add textbox indexes, update trinket/crew textboxes

This adds an attribute to textboxclass to allow a text box to keep an
index that references another text box inside the graphics.textboxes
std::vector.

This is needed because the second text box of a "You have found a
shiny trinket!" or "You have found a lost crewmate!" pair of text boxes
explicitly relies on the height of the first text box. With this, I have
moved those text boxes over to the new text box translation system.

Since the update order now matters, I added a comment to
recomputetextboxes() that clarifies that the text boxes must be updated
in linear order, starting from 0.
This commit is contained in:
Misa
2024-01-21 12:39:15 -08:00
committed by Misa Elizabeth Kai
parent 668d0c744d
commit 7088858957
7 changed files with 124 additions and 79 deletions
+2 -1
View File
@@ -271,7 +271,8 @@ static void updatebuttonmappings(int bind)
static void recomputetextboxes(void)
{
/* Retranslate and reposition all text boxes. */
/* Retranslate and reposition all text boxes.
* WARNING: Needs to update in linear order, starting from 0. */
for (size_t i = 0; i < graphics.textboxes.size(); i++)
{
graphics.textboxes[i].updatetext();