Store original position of text box

This stores the original x-position and y-position of the text box, and
when a text box gets repositioned, it will use those unless a crewmate
position overrides it.

This is the original position of the text box, before centering or
crewmate position is considered.

This fixes a bug where a cutscene text box can be "shifted" from its
normal position via CTRL+F8 cycling if there is a translation that is
too long for the screen and thus gets pushed by adjust(). I tested this
with the text box in the Comms Relay cutscene that starts with "If YOU
can find a teleporter".

This is not applicable to function-based translations
(TEXTTRANSLATE_FUNCTION), because the responsibility of correctly
positioning the text box resides with the function.
This commit is contained in:
Misa
2024-01-21 14:56:08 -08:00
committed by Misa Elizabeth Kai
parent 9b56a53d98
commit c50da88ad4
4 changed files with 25 additions and 3 deletions

View File

@@ -19,6 +19,8 @@ struct TextboxCrewmatePosition
struct TextboxOriginalContext
{
int x;
int y;
std::vector<std::string> lines;
std::string script_name;
char text_case;
@@ -85,7 +87,7 @@ public:
void resize(void);
void repositionfromcrewmate(void);
void reposition(void);
void addline(const std::string& t);