Changeset - r26253:da15255c652b
[Not reviewed]
Merge patchpack
0 5 0
Ruby Dennington (Theleruby) - 23 months ago 2022-05-10 13:38:16
theleruby@gmail.com
Merge with master, resolving conflicts
5 files changed with 188 insertions and 138 deletions:
0 comments (0 inline, 0 general)
src/company_gui.cpp
Show inline comments
 
@@ -48,199 +48,250 @@
 
#include "safeguards.h"
 

	
 

	
 
/** Company GUI constants. */
 
static const uint EXP_LINESPACE  = 2;      ///< Amount of vertical space for a horizontal (sub-)total line.
 
static const uint EXP_BLOCKSPACE = 10;     ///< Amount of vertical space between two blocks of numbers.
 
static const int  EXP_INDENT     = 10;     ///< Amount of horizontal space for an indented line.
 

	
 
static void DoSelectCompanyManagerFace(Window *parent);
 
static void ShowCompanyInfrastructure(CompanyID company);
 

	
 
/** Standard unsorted list of expenses. */
 
static ExpensesType _expenses_list_1[] = {
 
	EXPENSES_CONSTRUCTION,
 
	EXPENSES_NEW_VEHICLES,
 
	EXPENSES_TRAIN_RUN,
 
	EXPENSES_ROADVEH_RUN,
 
	EXPENSES_AIRCRAFT_RUN,
 
	EXPENSES_SHIP_RUN,
 
	EXPENSES_PROPERTY,
 
	EXPENSES_TRAIN_INC,
 
	EXPENSES_ROADVEH_INC,
 
	EXPENSES_AIRCRAFT_INC,
 
	EXPENSES_SHIP_INC,
 
	EXPENSES_LOAN_INT,
 
	EXPENSES_OTHER,
 
	EXPENSES_T_TRAIN_CON,
 
	EXPENSES_T_ROAD_CON,
 
	EXPENSES_T_AIRCRAFT_CON,
 
	EXPENSES_T_SHIP_CON,
 
	EXPENSES_T_TREES_CON,
 
	EXPENSES_T_SCENERY_CON,
 
	EXPENSES_T_LANDSCAPING,
 
	EXPENSES_T_DEMOLITION,
 
/** List of revenues. */
 
static ExpensesType _expenses_list_revenue[] = {
 
	EXPENSES_TRAIN_REVENUE,
 
	EXPENSES_ROADVEH_REVENUE,
 
	EXPENSES_AIRCRAFT_REVENUE,
 
	EXPENSES_SHIP_REVENUE,
 
	EXPENSES_T_REWARD_INC,
 
	EXPENSES_T_DILAPIDATION,
 
};
 

	
 
/** Grouped list of expenses. */
 
static ExpensesType _expenses_list_2[] = {
 
	EXPENSES_TRAIN_INC,
 
	EXPENSES_ROADVEH_INC,
 
	EXPENSES_AIRCRAFT_INC,
 
	EXPENSES_SHIP_INC,
 
	EXPENSES_T_REWARD_INC,
 
	INVALID_EXPENSES,
 
/** List of operating expenses. */
 
static ExpensesType _expenses_list_operating_costs[] = {
 
	EXPENSES_TRAIN_RUN,
 
	EXPENSES_ROADVEH_RUN,
 
	EXPENSES_AIRCRAFT_RUN,
 
	EXPENSES_SHIP_RUN,
 
	EXPENSES_PROPERTY,
 
	EXPENSES_T_DILAPIDATION,
 
	EXPENSES_LOAN_INT,
 
	INVALID_EXPENSES,
 
	EXPENSES_LOAN_INTEREST,
 
};
 

	
 
/** List of capital expenses. */
 
static ExpensesType _expenses_list_capital_costs[] = {
 
	EXPENSES_T_TRAIN_CON,
 
	EXPENSES_T_ROAD_CON,
 
	EXPENSES_T_AIRCRAFT_CON,
 
	EXPENSES_T_SHIP_CON,
 
	EXPENSES_T_TREES_CON,
 
	EXPENSES_T_SCENERY_CON,
 
	EXPENSES_CONSTRUCTION,
 
	EXPENSES_NEW_VEHICLES,
 
	EXPENSES_T_LANDSCAPING,
 
	EXPENSES_T_DEMOLITION,
 
	EXPENSES_OTHER,
 
	INVALID_EXPENSES,
 
};
 

	
 
/** Expense list container. */
 
struct ExpensesList {
 
	const ExpensesType *et;   ///< Expenses items.
 
	const uint length;        ///< Number of items in list.
 
	const uint num_subtotals; ///< Number of sub-totals in the list.
 

	
 
	ExpensesList(ExpensesType *et, int length, int num_subtotals) : et(et), length(length), num_subtotals(num_subtotals)
 

	
 
	ExpensesList(ExpensesType *et, int length) : et(et), length(length)
 
	{
 
	}
 

	
 
	uint GetHeight() const
 
	{
 
		/* heading + line + texts of expenses + sub-totals + total line + total text */
 
		return FONT_HEIGHT_NORMAL + EXP_LINESPACE + this->length * FONT_HEIGHT_NORMAL + num_subtotals * (EXP_BLOCKSPACE + EXP_LINESPACE) + EXP_LINESPACE + FONT_HEIGHT_NORMAL;
 
		/* Add up the height of all the lines.  */
 
		return this->length * FONT_HEIGHT_NORMAL;
 
	}
 

	
 
	/** Compute width of the expenses categories in pixels. */
 
	uint GetCategoriesWidth() const
 
	uint GetListWidth() const
 
	{
 
		uint width = 0;
 
		bool invalid_expenses_measured = false; // Measure 'Total' width only once.
 
		for (uint i = 0; i < this->length; i++) {
 
			ExpensesType et = this->et[i];
 
			if (et == INVALID_EXPENSES) {
 
				if (!invalid_expenses_measured) {
 
					width = std::max(width, GetStringBoundingBox(STR_FINANCES_TOTAL_CAPTION).width);
 
					invalid_expenses_measured = true;
 
				}
 
			} else {
 
				width = std::max(width, GetStringBoundingBox(STR_FINANCES_SECTION_CONSTRUCTION + et).width);
 
			}
 
			width = std::max(width, GetStringBoundingBox(STR_FINANCES_SECTION_CONSTRUCTION + et).width);
 
		}
 
		return width;
 
	}
 
};
 

	
 
/** Types of expense lists */
 
static const ExpensesList _expenses_list_types[] = {
 
	ExpensesList(_expenses_list_1, lengthof(_expenses_list_1), 0),
 
	ExpensesList(_expenses_list_2, lengthof(_expenses_list_2), 3),
 
	ExpensesList(_expenses_list_revenue, lengthof(_expenses_list_revenue)),
 
	ExpensesList(_expenses_list_operating_costs, lengthof(_expenses_list_operating_costs)),
 
	ExpensesList(_expenses_list_capital_costs, lengthof(_expenses_list_capital_costs)),
 
};
 

	
 
/**
 
 * Get the total height of the "categories" column.
 
 * @return The total height in pixels.
 
 */
 
static uint GetTotalCategoriesHeight()
 
{
 
	/* There's an empty line and blockspace on the year row */
 
	uint total_height = FONT_HEIGHT_NORMAL + EXP_BLOCKSPACE;
 

	
 
	for (uint i = 0; i < lengthof(_expenses_list_types); i++) {
 
		/* Title + expense list + total line + total + blockspace after category */
 
		total_height += FONT_HEIGHT_NORMAL + _expenses_list_types[i].GetHeight() + EXP_LINESPACE + FONT_HEIGHT_NORMAL + EXP_BLOCKSPACE;
 
	}
 

	
 
	/* Total income */
 
	total_height += EXP_LINESPACE + FONT_HEIGHT_NORMAL + EXP_BLOCKSPACE;
 

	
 
	return total_height;
 
}
 

	
 
/**
 
 * Get the required width of the "categories" column, equal to the widest element.
 
 * @return The required width in pixels.
 
 */
 
static uint GetMaxCategoriesWidth()
 
{
 
	uint max_width = 0;
 

	
 
	/* Loop through categories to check max widths. */
 
	for (uint i = 0; i < lengthof(_expenses_list_types); i++) {
 
		/* Title of category */
 
		max_width = std::max(max_width, GetStringBoundingBox(STR_FINANCES_REVENUE_TITLE + i).width);
 
		/* Entries in category */
 
		max_width = std::max(max_width, _expenses_list_types[i].GetListWidth());
 
	}
 

	
 
	return max_width;
 
}
 

	
 
/**
 
 * Draw a category of expenses (revenue, operating expenses, capital expenses).
 
 */
 
static void DrawCategory(const Rect &r, int start_y, ExpensesList list)
 
{
 
	int offs_left = _current_text_dir == TD_LTR ? EXP_INDENT : 0;
 
	int offs_right = _current_text_dir == TD_LTR ? 0 : EXP_INDENT;
 

	
 
	int y = start_y;
 
	ExpensesType et;
 

	
 
	for (uint i = 0; i < list.length; i++) {
 
		et = list.et[i];
 
		DrawString(r.left + offs_left, r.right - offs_right, y, STR_FINANCES_SECTION_CONSTRUCTION + et);
 
		y += FONT_HEIGHT_NORMAL;
 
	}
 
}
 

	
 
/**
 
 * Draw the expenses categories.
 
 * @param r Available space for drawing.
 
 * @note The environment must provide padding at the left and right of \a r.
 
 */
 
static void DrawCategories(const Rect &r)
 
{
 
	int y = r.top;
 

	
 
	DrawString(r.left, r.right, y, STR_FINANCES_EXPENDITURE_INCOME_TITLE, TC_FROMSTRING, SA_HOR_CENTER, true);
 
	y += FONT_HEIGHT_NORMAL + EXP_LINESPACE;
 

	
 
	int type = _settings_client.gui.expenses_layout;
 
	for (uint i = 0; i < _expenses_list_types[type].length; i++) {
 
		const ExpensesType et = _expenses_list_types[type].et[i];
 
		if (et == INVALID_EXPENSES) {
 
			y += EXP_LINESPACE;
 
			DrawString(r.left, r.right, y, STR_FINANCES_TOTAL_CAPTION, TC_FROMSTRING, SA_RIGHT);
 
			y += FONT_HEIGHT_NORMAL + EXP_BLOCKSPACE;
 
		} else {
 
			DrawString(r.left, r.right, y, STR_FINANCES_SECTION_CONSTRUCTION + et);
 
			y += FONT_HEIGHT_NORMAL;
 
		}
 
	/* Start with an empty space in the year row, plus the blockspace under the year. */
 
	int y = r.top + FONT_HEIGHT_NORMAL + EXP_BLOCKSPACE;
 

	
 
	for (uint i = 0; i < lengthof(_expenses_list_types); i++) {
 
		/* Draw category title and advance y */
 
		DrawString(r.left, r.right, y, (STR_FINANCES_REVENUE_TITLE + i), TC_FROMSTRING, SA_LEFT);
 
		y += FONT_HEIGHT_NORMAL;
 

	
 
		/* Draw category items and advance y */
 
		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 += EXP_LINESPACE + FONT_HEIGHT_NORMAL;
 

	
 
		/* Advance y by a blockspace after this category block */
 
		y += EXP_BLOCKSPACE;
 
	}
 

	
 
	DrawString(r.left, r.right, y + EXP_LINESPACE, STR_FINANCES_TOTAL_CAPTION, TC_FROMSTRING, SA_RIGHT);
 
	/* Draw total profit/loss */
 
	y += EXP_LINESPACE;
 
	DrawString(r.left, r.right, y, STR_FINANCES_NET_PROFIT, TC_FROMSTRING, SA_LEFT);
 
}
 

	
 
/**
 
 * Draw an amount of money.
 
 * @param amount Amount of money to draw,
 
 * @param left   Left coordinate of the space to draw in.
 
 * @param right  Right coordinate of the space to draw in.
 
 * @param top    Top coordinate of the space to draw in.
 
 * @param colour The TextColour of the string.
 
 */
 
static void DrawPrice(Money amount, int left, int right, int top)
 
static void DrawPrice(Money amount, int left, int right, int top, TextColour colour)
 
{
 
	StringID str = STR_FINANCES_NEGATIVE_INCOME;
 
	if (amount < 0) {
 
		amount = -amount;
 
		str++;
 
	}
 
	SetDParam(0, amount);
 
	DrawString(left, right, top, str, TC_FROMSTRING, SA_RIGHT);
 
	DrawString(left, right, top, str, colour, SA_RIGHT);
 
}
 

	
 
/**
 
 * Draw a category of expenses/revenues in the year column.
 
 * @return The income sum of the category.
 
 */
 
static Money DrawYearCategory (const Rect &r, int start_y, ExpensesList list, const Money(*tbl)[EXPENSES_END])
 
{
 
	int y = start_y;
 
	ExpensesType et;
 
	Money sum = 0;
 

	
 
	for (uint i = 0; i < list.length; i++) {
 
		et = list.et[i];
 
		Money cost = (*tbl)[et];
 
		sum += cost;
 
		if (cost != 0) DrawPrice(cost, r.left, r.right, y, TC_BLACK);
 
		y += FONT_HEIGHT_NORMAL;
 
	}
 

	
 
	/* Draw the total at the bottom of the category. */
 
	GfxFillRect(r.left, y, r.right, y, PC_BLACK);
 
	y += EXP_LINESPACE;
 
	if (sum != 0) DrawPrice(sum, r.left, r.right, y, TC_WHITE);
 

	
 
	/* Return the sum for the yearly total. */
 
	return sum;
 
}
 

	
 

	
 
/**
 
 * Draw a column with prices.
 
 * @param r    Available space for drawing.
 
 * @param year Year being drawn.
 
 * @param tbl  Pointer to table of amounts for \a year.
 
 * @note The environment must provide padding at the left and right of \a r.
 
 */
 
static void DrawYearColumn(const Rect &r, int year, const Money (*tbl)[EXPENSES_END])
 
{
 
	int y = r.top;
 

	
 
	Money sum;
 

	
 
	/* Year header */
 
	SetDParam(0, year);
 
	DrawString(r.left, r.right, y, STR_FINANCES_YEAR, TC_FROMSTRING, SA_RIGHT, true);
 
	y += FONT_HEIGHT_NORMAL + EXP_LINESPACE;
 

	
 
	Money sum = 0;
 
	Money subtotal = 0;
 
	int type = _settings_client.gui.expenses_layout;
 
	for (uint i = 0; i < _expenses_list_types[type].length; i++) {
 
		const ExpensesType et = _expenses_list_types[type].et[i];
 
		if (et == INVALID_EXPENSES) {
 
			Money cost = subtotal;
 
			subtotal = 0;
 
			GfxFillRect(r.left, y, r.right, y, PC_BLACK);
 
			y += EXP_LINESPACE;
 
			DrawPrice(cost, r.left, r.right, y);
 
			y += FONT_HEIGHT_NORMAL + EXP_BLOCKSPACE;
 
		} else {
 
			Money cost = (*tbl)[et];
 
			subtotal += cost;
 
			sum += cost;
 
			if (cost != 0) DrawPrice(cost, r.left, r.right, y);
 
			y += FONT_HEIGHT_NORMAL;
 
		}
 
	y += FONT_HEIGHT_NORMAL + EXP_BLOCKSPACE;
 

	
 
	/* Categories */
 
	for (uint i = 0; i < lengthof(_expenses_list_types); i++) {
 
		y += FONT_HEIGHT_NORMAL;
 
		sum += DrawYearCategory(r, y, _expenses_list_types[i], tbl);
 
		/* Expense list + expense category title + expense category total + blockspace after category */
 
		y += _expenses_list_types[i].GetHeight() + EXP_LINESPACE + FONT_HEIGHT_NORMAL + EXP_BLOCKSPACE;
 
	}
 

	
 
	/* Total income. */
 
	GfxFillRect(r.left, y, r.right, y, PC_BLACK);
 
	y += EXP_LINESPACE;
 
	DrawPrice(sum, r.left, r.right, y);
 
	DrawPrice(sum, r.left, r.right, y, TC_WHITE);
 
}
 

	
 
static const NWidgetPart _nested_company_finances_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_GREY),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, WID_CF_CAPTION), SetDataTip(STR_FINANCES_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
@@ -258,28 +309,30 @@ static const NWidgetPart _nested_company
 
			EndContainer(),
 
		EndContainer(),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY),
 
		NWidget(NWID_HORIZONTAL), SetPadding(WD_FRAMERECT_TOP, WD_FRAMERECT_RIGHT, WD_FRAMERECT_BOTTOM, WD_FRAMERECT_LEFT),
 
			NWidget(NWID_VERTICAL), // Vertical column with 'bank balance', 'loan'
 
				NWidget(WWT_TEXT, COLOUR_GREY), SetDataTip(STR_FINANCES_OWN_FUNDS_TITLE, STR_NULL), SetFill(1, 0),
 
				NWidget(WWT_TEXT, COLOUR_GREY), SetDataTip(STR_FINANCES_LOAN_TITLE, STR_NULL), SetFill(1, 0),
 
				NWidget(NWID_SPACER), SetMinimalSize(0, 2), SetFill(1, 0),
 
				NWidget(WWT_TEXT, COLOUR_GREY), SetDataTip(STR_FINANCES_BANK_BALANCE_TITLE, STR_NULL), SetFill(1, 0),
 
				NWidget(WWT_TEXT, COLOUR_GREY), SetDataTip(STR_FINANCES_LOAN_TITLE, STR_NULL), SetFill(1, 0),
 
				NWidget(NWID_SPACER), SetFill(0, 1),
 
			EndContainer(),
 
			NWidget(NWID_SPACER), SetFill(0, 0), SetMinimalSize(30, 0),
 
			NWidget(NWID_VERTICAL), // Vertical column with bank balance amount, loan amount, and total.
 
				NWidget(WWT_TEXT, COLOUR_GREY, WID_CF_BALANCE_VALUE), SetDataTip(STR_FINANCES_TOTAL_CURRENCY, STR_NULL), SetAlignment(SA_VERT_CENTER | SA_RIGHT),
 
				NWidget(WWT_TEXT, COLOUR_GREY, WID_CF_OWN_VALUE), SetDataTip(STR_FINANCES_TOTAL_CURRENCY, STR_NULL), SetAlignment(SA_VERT_CENTER | SA_RIGHT),
 
				NWidget(WWT_TEXT, COLOUR_GREY, WID_CF_LOAN_VALUE), SetDataTip(STR_FINANCES_TOTAL_CURRENCY, STR_NULL), SetAlignment(SA_VERT_CENTER | SA_RIGHT),
 
				NWidget(WWT_EMPTY, COLOUR_GREY, WID_CF_LOAN_LINE), SetMinimalSize(0, 2), SetFill(1, 0),
 
				NWidget(WWT_TEXT, COLOUR_GREY, WID_CF_TOTAL_VALUE), SetDataTip(STR_FINANCES_TOTAL_CURRENCY, STR_NULL), SetAlignment(SA_VERT_CENTER | SA_RIGHT),
 
				NWidget(WWT_EMPTY, COLOUR_GREY, WID_CF_BALANCE_LINE), SetMinimalSize(0, 2), SetFill(1, 0),
 
				NWidget(WWT_TEXT, COLOUR_GREY, WID_CF_BALANCE_VALUE), SetDataTip(STR_FINANCES_TOTAL_CURRENCY, STR_NULL), SetAlignment(SA_VERT_CENTER | SA_RIGHT),
 
			EndContainer(),
 
			NWidget(NWID_SELECTION, INVALID_COLOUR, WID_CF_SEL_MAXLOAN),
 
				NWidget(NWID_HORIZONTAL),
 
					NWidget(NWID_SPACER), SetFill(0, 1), SetMinimalSize(25, 0),
 
					NWidget(NWID_VERTICAL), // Max loan information
 
						NWidget(WWT_EMPTY, COLOUR_GREY, WID_CF_MAXLOAN_GAP), SetFill(0, 0),
 
						NWidget(WWT_TEXT, COLOUR_GREY, WID_CF_INTEREST_RATE), SetDataTip(STR_FINANCES_INTEREST_RATE, STR_NULL),
 
						NWidget(WWT_TEXT, COLOUR_GREY, WID_CF_MAXLOAN_VALUE), SetDataTip(STR_FINANCES_MAX_LOAN, STR_NULL),
 
						NWidget(NWID_SPACER), SetFill(0, 1),
 
					EndContainer(),
 
				EndContainer(),
 
			EndContainer(),
 
			NWidget(NWID_SPACER), SetFill(1, 1),
 
@@ -326,18 +379,22 @@ struct CompanyFinancesWindow : Window {
 
			case WID_CF_LOAN_VALUE: {
 
				const Company *c = Company::Get((CompanyID)this->window_number);
 
				SetDParam(0, c->current_loan);
 
				break;
 
			}
 

	
 
			case WID_CF_TOTAL_VALUE: {
 
			case WID_CF_OWN_VALUE: {
 
				const Company *c = Company::Get((CompanyID)this->window_number);
 
				SetDParam(0, c->money - c->current_loan);
 
				break;
 
			}
 

	
 
			case WID_CF_INTEREST_RATE:
 
				SetDParam(0, _settings_game.difficulty.initial_interest);
 
				break;
 

	
 
			case WID_CF_MAXLOAN_VALUE:
 
				SetDParam(0, _economy.max_loan);
 
				break;
 

	
 
			case WID_CF_INCREASE_LOAN:
 
			case WID_CF_REPAY_LOAN:
 
@@ -345,33 +402,32 @@ struct CompanyFinancesWindow : Window {
 
				break;
 
		}
 
	}
 

	
 
	void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
 
	{
 
		int type = _settings_client.gui.expenses_layout;
 
		switch (widget) {
 
			case WID_CF_EXPS_CATEGORY:
 
				size->width  = _expenses_list_types[type].GetCategoriesWidth();
 
				size->height = _expenses_list_types[type].GetHeight();
 
				size->width  = GetMaxCategoriesWidth();
 
				size->height = GetTotalCategoriesHeight();
 
				break;
 

	
 
			case WID_CF_EXPS_PRICE1:
 
			case WID_CF_EXPS_PRICE2:
 
			case WID_CF_EXPS_PRICE3:
 
				size->height = _expenses_list_types[type].GetHeight();
 
				size->height = GetTotalCategoriesHeight();
 
				FALLTHROUGH;
 

	
 
			case WID_CF_BALANCE_VALUE:
 
			case WID_CF_LOAN_VALUE:
 
			case WID_CF_TOTAL_VALUE:
 
			case WID_CF_OWN_VALUE:
 
				SetDParamMaxValue(0, CompanyFinancesWindow::max_money);
 
				size->width = std::max(GetStringBoundingBox(STR_FINANCES_NEGATIVE_INCOME).width, GetStringBoundingBox(STR_FINANCES_POSITIVE_INCOME).width) + padding.width;
 
				break;
 

	
 
			case WID_CF_MAXLOAN_GAP:
 
			case WID_CF_INTEREST_RATE:
 
				size->height = FONT_HEIGHT_NORMAL;
 
				break;
 
		}
 
	}
 

	
 
	void DrawWidget(const Rect &r, int widget) const override
 
@@ -390,13 +446,13 @@ struct CompanyFinancesWindow : Window {
 
				if (wid_offset <= age) {
 
					DrawYearColumn(r, _cur_year - (age - wid_offset), c->yearly_expenses + (age - wid_offset));
 
				}
 
				break;
 
			}
 

	
 
			case WID_CF_LOAN_LINE:
 
			case WID_CF_BALANCE_LINE:
 
				GfxFillRect(r.left, r.top, r.right, r.top, PC_BLACK);
 
				break;
 
		}
 
	}
 

	
 
	/**
 
@@ -416,14 +472,13 @@ struct CompanyFinancesWindow : Window {
 

	
 
	void OnPaint() override
 
	{
 
		if (!this->IsShaded()) {
 
			if (!this->small) {
 
				/* Check that the expenses panel height matches the height needed for the layout. */
 
				int type = _settings_client.gui.expenses_layout;
 
				if (_expenses_list_types[type].GetHeight() != this->GetWidget<NWidgetBase>(WID_CF_EXPS_CATEGORY)->current_y) {
 
				if (GetTotalCategoriesHeight() != this->GetWidget<NWidgetBase>(WID_CF_EXPS_CATEGORY)->current_y) {
 
					this->SetupWidgets();
 
					this->ReInit();
 
					return;
 
				}
 
			}
 

	
src/lang/english.txt
Show inline comments
 
@@ -1650,15 +1650,12 @@ STR_CONFIG_SETTING_DEFAULT_RAIL_TYPE_MOS
 
STR_CONFIG_SETTING_SHOW_TRACK_RESERVATION                       :Show path reservations for tracks: {STRING2}
 
STR_CONFIG_SETTING_SHOW_TRACK_RESERVATION_HELPTEXT              :Give reserved tracks a different colour to assist in problems with trains refusing to enter path-based blocks
 

	
 
STR_CONFIG_SETTING_PERSISTENT_BUILDINGTOOLS                     :Keep building tools active after usage: {STRING2}
 
STR_CONFIG_SETTING_PERSISTENT_BUILDINGTOOLS_HELPTEXT            :Keep the building tools for bridges, tunnels, etc. open after use
 

	
 
STR_CONFIG_SETTING_EXPENSES_LAYOUT                              :Group expenses in company finance window: {STRING2}
 
STR_CONFIG_SETTING_EXPENSES_LAYOUT_HELPTEXT                     :Define the layout for the company expenses window
 

	
 
STR_CONFIG_SETTING_AUTO_REMOVE_SIGNALS                          :Automatically remove signals during rail construction: {STRING2}
 
STR_CONFIG_SETTING_AUTO_REMOVE_SIGNALS_HELPTEXT                 :Automatically remove signals during rail construction if the signals are in the way. Note that this can potentially lead to train crashes.
 

	
 
STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT                     :Fast forward speed limit: {STRING2}
 
STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_HELPTEXT            :Limit on how fast the game goes when fast forward is enabled. 0 = no limit (as fast as your computer allows). Values below 100% slow the game down. The upper-limit depends on the specification of your computer and can vary depending on the game.
 
STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_VAL                 :{NUM}% normal game speed
 
@@ -3691,27 +3688,32 @@ STR_BUOY_VIEW_CENTER_TOOLTIP            
 
STR_BUOY_VIEW_CHANGE_BUOY_NAME                                  :{BLACK}Change buoy name
 

	
 
STR_EDIT_WAYPOINT_NAME                                          :{WHITE}Edit waypoint name
 

	
 
# Finances window
 
STR_FINANCES_CAPTION                                            :{WHITE}{COMPANY} Finances {BLACK}{COMPANY_NUM}
 
STR_FINANCES_EXPENDITURE_INCOME_TITLE                           :{WHITE}Expenditure/Income
 
STR_FINANCES_YEAR                                               :{WHITE}{NUM}
 

	
 
###length 23
 
###length 3
 
STR_FINANCES_REVENUE_TITLE                                      :{WHITE}Revenue
 
STR_FINANCES_OPERATING_EXPENSES_TITLE                           :{WHITE}Operating Expenses
 
STR_FINANCES_CAPITAL_EXPENSES_TITLE                             :{WHITE}Capital Expenses
 

	
 

	
 
###length 13
 
STR_FINANCES_SECTION_CONSTRUCTION                               :{GOLD}Misc Construction
 
STR_FINANCES_SECTION_NEW_VEHICLES                               :{GOLD}New Vehicles
 
STR_FINANCES_SECTION_TRAIN_RUNNING_COSTS                        :{GOLD}Train Running Costs
 
STR_FINANCES_SECTION_ROAD_VEHICLE_RUNNING_COSTS                 :{GOLD}Road Vehicle Running Costs
 
STR_FINANCES_SECTION_AIRCRAFT_RUNNING_COSTS                     :{GOLD}Aircraft Running Costs
 
STR_FINANCES_SECTION_SHIP_RUNNING_COSTS                         :{GOLD}Ship Running Costs
 
STR_FINANCES_SECTION_PROPERTY_MAINTENANCE                       :{GOLD}Property Maintenance
 
STR_FINANCES_SECTION_TRAIN_INCOME                               :{GOLD}Train Income
 
STR_FINANCES_SECTION_ROAD_VEHICLE_INCOME                        :{GOLD}Road Vehicle Income
 
STR_FINANCES_SECTION_AIRCRAFT_INCOME                            :{GOLD}Aircraft Income
 
STR_FINANCES_SECTION_SHIP_INCOME                                :{GOLD}Ship Income
 
STR_FINANCES_SECTION_TRAIN_RUNNING_COSTS                        :{GOLD}Trains
 
STR_FINANCES_SECTION_ROAD_VEHICLE_RUNNING_COSTS                 :{GOLD}Road Vehicles
 
STR_FINANCES_SECTION_AIRCRAFT_RUNNING_COSTS                     :{GOLD}Aircraft
 
STR_FINANCES_SECTION_SHIP_RUNNING_COSTS                         :{GOLD}Ships
 
STR_FINANCES_SECTION_INFRASTRUCTURE                             :{GOLD}Infrastructure
 
STR_FINANCES_SECTION_TRAIN_REVENUE                              :{GOLD}Trains
 
STR_FINANCES_SECTION_ROAD_VEHICLE_REVENUE                       :{GOLD}Road Vehicles
 
STR_FINANCES_SECTION_AIRCRAFT_REVENUE                           :{GOLD}Aircraft
 
STR_FINANCES_SECTION_SHIP_REVENUE                               :{GOLD}Ships
 
STR_FINANCES_SECTION_LOAN_INTEREST                              :{GOLD}Loan Interest
 
STR_FINANCES_SECTION_OTHER                                      :{GOLD}Other
 
STR_FINANCES_SECTION_T_TRAIN_CON                                :{GOLD}Railway Construction
 
STR_FINANCES_SECTION_T_ROAD_CON                                 :{GOLD}Road Construction
 
STR_FINANCES_SECTION_T_AIRCRAFT_CON                             :{GOLD}Airport Construction
 
STR_FINANCES_SECTION_T_SHIP_CON                                 :{GOLD}Waterways Construction
 
@@ -3719,17 +3721,19 @@ STR_FINANCES_SECTION_T_TREES_CON        
 
STR_FINANCES_SECTION_T_SCENERY_CON                              :{GOLD}Object Construction
 
STR_FINANCES_SECTION_T_LANDSCAPING                              :{GOLD}Landscaping
 
STR_FINANCES_SECTION_T_DEMOLITION                               :{GOLD}Demolition
 
STR_FINANCES_SECTION_T_REWARD_INC                               :{GOLD}Reward Income
 
STR_FINANCES_SECTION_T_DILAPIDATION                             :{GOLD}Station Dilapidation
 

	
 
STR_FINANCES_NEGATIVE_INCOME                                    :{BLACK}-{CURRENCY_LONG}
 
STR_FINANCES_POSITIVE_INCOME                                    :{BLACK}+{CURRENCY_LONG}
 
STR_FINANCES_TOTAL_CAPTION                                      :{WHITE}Total:
 
STR_FINANCES_NEGATIVE_INCOME                                    :-{CURRENCY_LONG}
 
STR_FINANCES_POSITIVE_INCOME                                    :+{CURRENCY_LONG}
 
STR_FINANCES_NET_PROFIT                                         :{WHITE}Net Profit
 
STR_FINANCES_BANK_BALANCE_TITLE                                 :{WHITE}Bank Balance
 
STR_FINANCES_OWN_FUNDS_TITLE                                    :{WHITE}Own Funds
 
STR_FINANCES_LOAN_TITLE                                         :{WHITE}Loan
 
STR_FINANCES_INTEREST_RATE                                      :{WHITE}Loan Interest: {BLACK}{NUM}%
 
STR_FINANCES_MAX_LOAN                                           :{WHITE}Maximum Loan: {BLACK}{CURRENCY_LONG}
 
STR_FINANCES_TOTAL_CURRENCY                                     :{BLACK}{CURRENCY_LONG}
 
STR_FINANCES_BORROW_BUTTON                                      :{BLACK}Borrow {CURRENCY_LONG}
 
STR_FINANCES_BORROW_TOOLTIP                                     :{BLACK}Increase size of loan. Ctrl+Click borrows as much as possible
 
STR_FINANCES_REPAY_BUTTON                                       :{BLACK}Repay {CURRENCY_LONG}
 
STR_FINANCES_REPAY_TOOLTIP                                      :{BLACK}Repay part of loan. Ctrl+Click repays as much loan as possible
src/settings_gui.cpp
Show inline comments
 
@@ -1636,13 +1636,12 @@ static SettingsContainer &GetSettingsTre
 
			interface->Add(new SettingEntry("gui.toolbar_pos"));
 
			interface->Add(new SettingEntry("gui.statusbar_pos"));
 
			interface->Add(new SettingEntry("gui.prefer_teamchat"));
 
			interface->Add(new SettingEntry("gui.advanced_vehicle_list"));
 
			interface->Add(new SettingEntry("gui.timetable_in_ticks"));
 
			interface->Add(new SettingEntry("gui.timetable_arrival_departure"));
 
			interface->Add(new SettingEntry("gui.expenses_layout"));
 
			interface->Add(new SettingEntry("gui.show_newgrf_name"));
 
		}
 

	
 
		SettingsPage *advisors = main->Add(new SettingsPage(STR_CONFIG_SETTING_ADVISORS));
 
		{
 
			advisors->Add(new SettingEntry("gui.coloured_news_year"));
src/table/settings/gui_settings.ini
Show inline comments
 
@@ -677,20 +677,12 @@ var      = gui.persistent_buildingtools
 
flags    = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
 
def      = true
 
str      = STR_CONFIG_SETTING_PERSISTENT_BUILDINGTOOLS
 
strhelp  = STR_CONFIG_SETTING_PERSISTENT_BUILDINGTOOLS_HELPTEXT
 
cat      = SC_BASIC
 

	
 
[SDTC_BOOL]
 
var      = gui.expenses_layout
 
flags    = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
 
def      = true
 
str      = STR_CONFIG_SETTING_EXPENSES_LAYOUT
 
strhelp  = STR_CONFIG_SETTING_EXPENSES_LAYOUT_HELPTEXT
 
post_cb  = [](auto) { MarkWholeScreenDirty(); }
 

	
 
[SDTC_VAR]
 
var      = gui.station_gui_group_order
 
type     = SLE_UINT8
 
flags    = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
 
def      = 0
 
min      = 0
src/widgets/company_widget.h
Show inline comments
 
@@ -65,15 +65,15 @@ enum CompanyFinancesWidgets {
 
	WID_CF_EXPS_PRICE2,    ///< Column for year Y-1 expenses.
 
	WID_CF_EXPS_PRICE3,    ///< Column for year Y expenses.
 
	WID_CF_TOTAL_PANEL,    ///< Panel for totals.
 
	WID_CF_SEL_MAXLOAN,    ///< Selection of maxloan column.
 
	WID_CF_BALANCE_VALUE,  ///< Bank balance value.
 
	WID_CF_LOAN_VALUE,     ///< Loan.
 
	WID_CF_LOAN_LINE,      ///< Line for summing bank balance and loan.
 
	WID_CF_TOTAL_VALUE,    ///< Total.
 
	WID_CF_MAXLOAN_GAP,    ///< Gap above max loan widget.
 
	WID_CF_BALANCE_LINE,   ///< Available cash.
 
	WID_CF_OWN_VALUE,      ///< Own funds, not including loan.
 
	WID_CF_INTEREST_RATE,  ///< Loan interest rate.
 
	WID_CF_MAXLOAN_VALUE,  ///< Max loan widget.
 
	WID_CF_SEL_BUTTONS,    ///< Selection of buttons.
 
	WID_CF_INCREASE_LOAN,  ///< Increase loan.
 
	WID_CF_REPAY_LOAN,     ///< Decrease loan..
 
	WID_CF_INFRASTRUCTURE, ///< View company infrastructure.
 
};
0 comments (0 inline, 0 general)