mirror of https://github.com/OpenTTD/OpenTTD
Change: Add Year or Period title to finance window
parent
eb307a6c78
commit
ea01e7a200
|
@ -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 */
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue