mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 09:54:10 +03:00
Save textbox state, allow lang switches w/ textbox
This allows switching languages while a text box is on screen by saving the necessary state for a text box to be retranslated when the language is switched. This saves the state of the position and direction of the crewmate that the text box position is based off of (if applicable), and the text case of the text box, the script name of the script, and the original (English) lines of the text box. I did not explicitly label the original lines as English lines except in a main game context, because technically, custom levels could have original lines in a different language. Unfortunately, this doesn't work for every text box in the game. Notably, the Level Complete, Game Complete, number of crewmates remaining, trinket collection, Intermission 1 guides, etc. text boxes are special and require further fixes, but that will be coming in later commits.
This commit is contained in:
@@ -3320,6 +3320,50 @@ void Graphics::textboxbuttons(void)
|
||||
textboxes[m].fill_buttons = true;
|
||||
}
|
||||
|
||||
void Graphics::textboxcrewmateposition(const TextboxCrewmatePosition* crewmate_position)
|
||||
{
|
||||
if (!INBOUNDS_VEC(m, textboxes))
|
||||
{
|
||||
vlog_error("textboxcrewmateposition() out-of-bounds!");
|
||||
return;
|
||||
}
|
||||
|
||||
textboxes[m].crewmate_position = *crewmate_position;
|
||||
}
|
||||
|
||||
void Graphics::textboxoriginalcontext(const TextboxOriginalContext* original_context)
|
||||
{
|
||||
if (!INBOUNDS_VEC(m, textboxes))
|
||||
{
|
||||
vlog_error("textboxoriginalcontext() out-of-bounds!");
|
||||
return;
|
||||
}
|
||||
|
||||
textboxes[m].original = *original_context;
|
||||
}
|
||||
|
||||
void Graphics::textboxcase(char text_case)
|
||||
{
|
||||
if (!INBOUNDS_VEC(m, textboxes))
|
||||
{
|
||||
vlog_error("textboxcase() out-of-bounds!");
|
||||
return;
|
||||
}
|
||||
|
||||
textboxes[m].original.text_case = text_case;
|
||||
}
|
||||
|
||||
void Graphics::textboxtranslate(void)
|
||||
{
|
||||
if (!INBOUNDS_VEC(m, textboxes))
|
||||
{
|
||||
vlog_error("textboxtranslate() out-of-bounds!");
|
||||
return;
|
||||
}
|
||||
|
||||
textboxes[m].translate();
|
||||
}
|
||||
|
||||
void Graphics::textboxcommsrelay(void)
|
||||
{
|
||||
// Special treatment for the gamestate textboxes in Comms Relay
|
||||
|
||||
Reference in New Issue
Block a user