Save text box centering state

This is another piece of state that needs to be kept and re-played when
switching language, because a different language could change the
dimensions of the text box, which affects how it's centered.

Also, to make sure that crewmate positions override any text centering,
the scriptclass variables textx and texty should be reset in the
position and customposition commands.
This commit is contained in:
Misa authored and Misa Elizabeth Kai committed 2024-02-02 18:57:24 -08:00
1 parent e8a231f2e2
commit 0ea0b8e00b
4 files changed
+20 -2

No files matched your search

+11
View File
@@ -28,6 +28,9 @@ textboxclass::textboxclass(int gap)
large = false;
should_centerx = false;
should_centery = false;
print_flags = PR_FONT_LEVEL;
fill_buttons = false;
@@ -72,6 +75,14 @@ void textboxclass::adjust(void)
{
resize();
repositionfromcrewmate();
if (should_centerx)
{
centerx();
}
if (should_centery)
{
centery();
}
if (xp < 10) xp = 10;
if (yp < 10) yp = 10;
if (xp + w > 310) xp = 310 - w;