1
0
Fork 0

Change: Add Year or Period title to finance window

pull/11341/head
Tyler Trahan 2023-09-24 18:50:58 -04:00
parent eb307a6c78
commit ea01e7a200
2 changed files with 6 additions and 3 deletions

View File

@ -138,7 +138,7 @@ static uint GetTotalCategoriesHeight()
*/ */
static uint GetMaxCategoriesWidth() static uint GetMaxCategoriesWidth()
{ {
uint max_width = 0; uint max_width = GetStringBoundingBox(STR_FINANCES_YEAR_CAPTION).width;
/* Loop through categories to check max widths. */ /* Loop through categories to check max widths. */
for (const ExpensesList &list : _expenses_list_types) { for (const ExpensesList &list : _expenses_list_types) {
@ -173,8 +173,10 @@ static void DrawCategory(const Rect &r, int start_y, const ExpensesList &list)
*/ */
static void DrawCategories(const Rect &r) static void DrawCategories(const Rect &r)
{ {
/* Start with an empty space in the year row, plus the blockspace under the year. */ int y = r.top;
int y = r.top + GetCharacterHeight(FS_NORMAL) + WidgetDimensions::scaled.vsep_wide; /* Draw description of 12-minute economic period. */
DrawString(r.left, r.right, y, (STR_FINANCES_YEAR_CAPTION), TC_FROMSTRING, SA_LEFT, true);
y += GetCharacterHeight(FS_NORMAL) + WidgetDimensions::scaled.vsep_wide;
for (const ExpensesList &list : _expenses_list_types) { for (const ExpensesList &list : _expenses_list_types) {
/* Draw category title and advance y */ /* Draw category title and advance y */

View File

@ -3771,6 +3771,7 @@ STR_EDIT_WAYPOINT_NAME :{WHITE}Edit way
# Finances window # Finances window
STR_FINANCES_CAPTION :{WHITE}{COMPANY} Finances {BLACK}{COMPANY_NUM} STR_FINANCES_CAPTION :{WHITE}{COMPANY} Finances {BLACK}{COMPANY_NUM}
STR_FINANCES_YEAR :{WHITE}{NUM} STR_FINANCES_YEAR :{WHITE}{NUM}
STR_FINANCES_YEAR_CAPTION :{WHITE}{TKM Year Period}
###length 3 ###length 3
STR_FINANCES_REVENUE_TITLE :{WHITE}Revenue STR_FINANCES_REVENUE_TITLE :{WHITE}Revenue