Skip to content

Commit

Permalink
don't apply linegap to certain special textboxes
Browse files Browse the repository at this point in the history
level complete, game complete and "You have rescued a crew member!"
  • Loading branch information
TerryCavanagh committed Feb 1, 2024
1 parent cc1528a commit 8b73a38
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions desktop_version/src/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ void Game::levelcomplete_textbox(void)
graphics.textboxprintflags(PR_FONT_8X8);
graphics.textboxcenterx();
graphics.setimage(TEXTIMAGE_LEVELCOMPLETE);
graphics.setlinegap(0);
}

void Game::crewmate_textbox(const int color)
Expand Down Expand Up @@ -727,6 +728,7 @@ void Game::crewmate_textbox(const int color)
graphics.textboxpad(SDL_ceilf(5/spaces_per_8), SDL_ceilf(2/spaces_per_8));
graphics.textboxcenterx();
graphics.addsprite(14, 12 + extra_cjk_height/2, 0, color);
graphics.setlinegap(0);
}

void Game::remaining_textbox(void)
Expand Down Expand Up @@ -2897,6 +2899,7 @@ void Game::updatestate(void)
graphics.textboxprintflags(PR_FONT_8X8);
graphics.textboxcenterx();
graphics.setimage(TEXTIMAGE_GAMECOMPLETE);
graphics.setlinegap(0);
break;
case 3502:
{
Expand Down
6 changes: 6 additions & 0 deletions desktop_version/src/Graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1506,6 +1506,12 @@ void Graphics::textboxadjust(void)
textboxes[m].adjust();
}

void Graphics::setlinegap(int customvalue)
{
textboxes[m].linegap = customvalue;
textboxes[m].resize();
}

int Graphics::getlinegap(void)
{
// Don't use linegaps in custom levels, for now anyway
Expand Down
1 change: 1 addition & 0 deletions desktop_version/src/Graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class Graphics

void drawfade(void);

void setlinegap(int);
int getlinegap(void);
void createtextboxreal(
const std::string& t,
Expand Down

0 comments on commit 8b73a38

Please sign in to comment.