Finish implementing sprites in textboxes

This commit adjusts the Y position for flip-mode, and makes the main
game use this new system.
This commit is contained in:
AllyTally
2023-08-10 21:41:39 -03:00
committed by Misa Elizabeth Kai
parent 76ea4488af
commit b5c9508dd4
3 changed files with 26 additions and 45 deletions

View File

@@ -671,10 +671,10 @@ void Game::levelcomplete_textbox(void)
graphics.textboxcenterx();
}
void Game::crewmate_textbox(const int r, const int g, const int b)
void Game::crewmate_textbox(const int color)
{
const int extra_cjk_height = (font::height(PR_FONT_INTERFACE) * 4) - 32;
graphics.createtextboxflipme("", -1, 64 + 8 + 16 - extra_cjk_height/2, r, g, b);
graphics.createtextboxflipme("", -1, 64 + 8 + 16 - extra_cjk_height/2, TEXT_COLOUR("gray"));
/* This is a special case for wrapping, we MUST have two lines.
* So just make sure it can't fit in one line. */
@@ -697,6 +697,7 @@ void Game::crewmate_textbox(const int r, const int g, const int b)
float spaces_per_8 = font::len(PR_FONT_INTERFACE, " ")/8.0f;
graphics.textboxpad(SDL_ceilf(5/spaces_per_8), SDL_ceilf(2/spaces_per_8));
graphics.textboxcenterx();
graphics.addsprite(14, 12, 0, color);
}
void Game::remaining_textbox(void)
@@ -2453,7 +2454,7 @@ void Game::updatestate(void)
incstate();
setstatedelay(45);
crewmate_textbox(175, 174, 174);
crewmate_textbox(13);
break;
case 3008:
incstate();
@@ -2495,7 +2496,7 @@ void Game::updatestate(void)
incstate();
setstatedelay(45);
crewmate_textbox(174, 175, 174);
crewmate_textbox(14);
break;
case 3022:
incstate();
@@ -2536,7 +2537,7 @@ void Game::updatestate(void)
incstate();
setstatedelay(45);
crewmate_textbox(174, 174, 175);
crewmate_textbox(16);
break;
case 3042:
incstate();
@@ -2578,7 +2579,7 @@ void Game::updatestate(void)
incstate();
setstatedelay(45);
crewmate_textbox(175, 175, 174);
crewmate_textbox(20);
break;
case 3052:
incstate();
@@ -2644,7 +2645,7 @@ void Game::updatestate(void)
incstate();
setstatedelay(45);
crewmate_textbox(175, 174, 175);
crewmate_textbox(15);
break;
case 3062:
incstate();