From 4fa62ca0aae61e9e80a58c0220a96d93e2efdaab Mon Sep 17 00:00:00 2001 From: Info Teddy Date: Fri, 31 Jan 2020 13:36:36 -0800 Subject: [PATCH] Fix text() centering with x=-1 The game uses magic values x=-500 and y=-500 to indicate when a text box should be centered horizontally or vertically. It does this for x=-1 too, but it's buggy because it only looks at the first line of the text box to center it. In this commit I fix it so that it will look at all of the lines of the text box to center it instead. --- desktop_version/src/Script.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index 5e7f826c..8c2315ae 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -597,7 +597,7 @@ void scriptclass::run( KeyPoll& key, Graphics& dwgfx, Game& game, mapclass& map, dwgfx.textboxmoveto(textx); } - if (textx == -500) + if (textx == -500 || textx == -1) { dwgfx.textboxcenterx(); } @@ -642,7 +642,7 @@ void scriptclass::run( KeyPoll& key, Graphics& dwgfx, Game& game, mapclass& map, dwgfx.textboxmoveto(textx); } - if (textx == -500) + if (textx == -500 || textx == -1) { dwgfx.textboxcenterx(); }