From 61c5e18413018e627acf8c0463c08b5da3426d81 Mon Sep 17 00:00:00 2001 From: Dav999 Date: Mon, 27 Nov 2023 23:25:18 +0100 Subject: [PATCH] Fix position of crewmate in "You have rescued a crew member!" box At first my CJK changes also misaligned this sprite, and my solution that time was to position the textbox higher depending on the height of the textbox, so it would be centered around the crewmate sprite (which stayed at a hardcoded place onscreen). Recently, #987 changed these sprites to be relative to the position of the textbox instead of relative to the screen, which is much more logical, but it stopped centering these sprites again. But it's an easy fix: simply account for the extra-added height when adding the sprite in. --- desktop_version/src/Game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index df506186..8a0e5194 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -702,7 +702,7 @@ void Game::crewmate_textbox(const int color) 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); + graphics.addsprite(14, 12 + extra_cjk_height/2, 0, color); } void Game::remaining_textbox(void)