From adf94d7970a59286e2a957ee0caf1adec91bf576 Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Sun, 13 Nov 2022 08:25:04 -0700 Subject: [PATCH] Change: Add a Total caption to each category of the finance window --- src/company_gui.cpp | 8 ++++++-- src/lang/english.txt | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 07899a8675..8aa5e97ff7 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -186,8 +186,12 @@ static void DrawCategories(const Rect &r) DrawCategory(r, y, _expenses_list_types[i]); y += _expenses_list_types[i].GetHeight(); - /* Advance y by the height of the total and associated total line */ - y += WidgetDimensions::scaled.vsep_normal + FONT_HEIGHT_NORMAL; + /* Advance y by the height of the horizontal line between amounts and subtotal */ + y += WidgetDimensions::scaled.vsep_normal; + + /* Draw category total and advance y */ + DrawString(r.left, r.right, y, STR_FINANCES_TOTAL_CAPTION, TC_FROMSTRING, SA_RIGHT); + y += FONT_HEIGHT_NORMAL; /* Advance y by a blockspace after this category block */ y += WidgetDimensions::scaled.vsep_wide; diff --git a/src/lang/english.txt b/src/lang/english.txt index dc8f05d84d..bb8eb4c1dd 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -3660,6 +3660,7 @@ STR_FINANCES_SECTION_SHIP_REVENUE :{GOLD}Ships STR_FINANCES_SECTION_LOAN_INTEREST :{GOLD}Loan Interest STR_FINANCES_SECTION_OTHER :{GOLD}Other +STR_FINANCES_TOTAL_CAPTION :{WHITE}Total STR_FINANCES_NEGATIVE_INCOME :-{CURRENCY_LONG} STR_FINANCES_ZERO_INCOME :{CURRENCY_LONG} STR_FINANCES_POSITIVE_INCOME :+{CURRENCY_LONG}