From 1fa31fe74b1f4b054c4c4c90ba0a5ee5a5ca22af Mon Sep 17 00:00:00 2001 From: Squid Coder <92821989+realSquidCoder@users.noreply.github.com> Date: Tue, 24 Dec 2024 23:43:38 -0600 Subject: [PATCH] Right align and limit the announcements (#114) Right align and limit the announcements --- GUI.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/GUI.cpp b/GUI.cpp index 04a7d2e7..5ebb6383 100644 --- a/GUI.cpp +++ b/GUI.cpp @@ -333,7 +333,8 @@ void draw_report_border(const ALLEGRO_FONT *font, float x, float y, int flags, c void draw_announcements(const ALLEGRO_FONT *font, float x, float y, int flags, std::vector &announcements) { - for (int i = announcements.size() - 1; i >= 0 && announcements[i]->duration > 0; i--) + int maxAnnouncements = std::min(10, (int)announcements.size()); + for (int i = announcements.size() - 1; i >= (announcements.size() - maxAnnouncements) && announcements[i]->duration > 0; i--) { int offset = ((announcements.size() - 1) - i) * al_get_font_line_height(font); draw_report_border(font, x, y - offset, flags, announcements[i]); @@ -1175,7 +1176,7 @@ void paintboard() drawDebugCursor(segment); - draw_announcements(font, ssState.ScreenW / 2, ssState.ScreenH - 20, ALLEGRO_ALIGN_CENTRE, df::global::world->status.announcements); + draw_announcements(font, ssState.ScreenW, ssState.ScreenH - 20, ALLEGRO_ALIGN_RIGHT, df::global::world->status.announcements); drawAdvmodeMenuTalk(font, 5, ssState.ScreenH - 5); if(ssConfig.debug_mode) {