# HG changeset patch # User Tyler Trahan # Date 2022-11-13 15:25:04 # Node ID 2a2369793c9b81c008f9e68baa37089760c18f24 # Parent 0a45cdb0d46fec6aa945ae97498844fd7d0602e0 Change: Add a Total caption to each category of the finance window diff --git a/src/company_gui.cpp b/src/company_gui.cpp --- 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 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -3660,6 +3660,7 @@ STR_FINANCES_SECTION_SHIP_REVENUE 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}