Skip to content

Commit

Permalink
Right align and limit the announcements (#114)
Browse files Browse the repository at this point in the history
Right align and limit the announcements
  • Loading branch information
realSquidCoder authored Dec 25, 2024
1 parent 112ccba commit 1fa31fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<df::report *> &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]);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 1fa31fe

Please sign in to comment.