|
@@ -71,13 +71,13 @@ struct GraphLegendWindow : Window {
|
|
|
if (!IsInsideMM(widget, GLW_FIRST_COMPANY, MAX_COMPANIES + GLW_FIRST_COMPANY)) return;
|
|
|
|
|
|
CompanyID cid = (CompanyID)(widget - GLW_FIRST_COMPANY);
|
|
|
|
|
|
if (!Company::IsValidID(cid)) return;
|
|
|
|
|
|
bool rtl = _dynlang.text_dir == TD_RTL;
|
|
|
bool rtl = _current_text_dir == TD_RTL;
|
|
|
|
|
|
DrawCompanyIcon(cid, rtl ? r.right - 16 : r.left + 2, r.top + 2 + (FONT_HEIGHT_NORMAL - 10) / 2);
|
|
|
|
|
|
SetDParam(0, cid);
|
|
|
SetDParam(1, cid);
|
|
|
DrawString(r.left + (rtl ? WD_FRAMERECT_LEFT : 19), r.right - (rtl ? 19 : WD_FRAMERECT_RIGHT), r.top + WD_FRAMERECT_TOP, STR_COMPANY_NAME_COMPANY_NUM, HasBit(_legend_excluded_companies, cid) ? TC_BLACK : TC_WHITE);
|
|
@@ -961,13 +961,13 @@ struct PaymentRatesGraphWindow : BaseGra
|
|
|
if (widget < CPW_CARGO_FIRST) {
|
|
|
BaseGraphWindow::DrawWidget(r, widget);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
const CargoSpec *cs = _sorted_cargo_specs[widget - CPW_CARGO_FIRST];
|
|
|
bool rtl = _dynlang.text_dir == TD_RTL;
|
|
|
bool rtl = _current_text_dir == TD_RTL;
|
|
|
|
|
|
/* Since the buttons have no text, no images,
|
|
|
* both the text and the coloured box have to be manually painted.
|
|
|
* clk_dif will move one pixel down and one pixel to the right
|
|
|
* when the button is clicked */
|
|
|
byte clk_dif = this->IsWidgetLowered(widget) ? 1 : 0;
|
|
@@ -1193,13 +1193,13 @@ public:
|
|
|
{
|
|
|
if (widget != CLW_BACKGROUND) return;
|
|
|
|
|
|
uint y = r.top + WD_FRAMERECT_TOP;
|
|
|
int icon_y_offset = 1 + (FONT_HEIGHT_NORMAL - 10) / 2;
|
|
|
|
|
|
bool rtl = _dynlang.text_dir == TD_RTL;
|
|
|
bool rtl = _current_text_dir == TD_RTL;
|
|
|
uint ordinal_left = rtl ? r.right - WD_FRAMERECT_LEFT - this->ordinal_width : r.left + WD_FRAMERECT_LEFT;
|
|
|
uint ordinal_right = rtl ? r.right - WD_FRAMERECT_LEFT : r.left + WD_FRAMERECT_LEFT + this->ordinal_width;
|
|
|
uint icon_left = r.left + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT + (rtl ? this->text_width : this->ordinal_width);
|
|
|
uint text_left = rtl ? r.left + WD_FRAMERECT_LEFT : r.right - WD_FRAMERECT_LEFT - this->text_width;
|
|
|
uint text_right = rtl ? r.left + WD_FRAMERECT_LEFT + this->text_width : r.right - WD_FRAMERECT_LEFT;
|
|
|
|
|
@@ -1378,13 +1378,13 @@ struct PerformanceRatingDetailWindow : W
|
|
|
uint score_detail_width = GetStringBoundingBox(STR_PERFORMANCE_DETAIL_AMOUNT_CURRENCY).width;
|
|
|
|
|
|
size->width = 7 + score_info_width + 5 + this->bar_width + 5 + score_detail_width + 7;
|
|
|
uint left = 7;
|
|
|
uint right = size->width - 7;
|
|
|
|
|
|
bool rtl = _dynlang.text_dir == TD_RTL;
|
|
|
bool rtl = _current_text_dir == TD_RTL;
|
|
|
this->score_info_left = rtl ? right - score_info_width : left;
|
|
|
this->score_info_right = rtl ? right : left + score_info_width;
|
|
|
|
|
|
this->score_detail_left = rtl ? left : right - score_detail_width;
|
|
|
this->score_detail_right = rtl ? left + score_detail_width : right;
|
|
|
|
|
@@ -1441,13 +1441,13 @@ struct PerformanceRatingDetailWindow : W
|
|
|
/* Draw the score */
|
|
|
SetDParam(0, score);
|
|
|
DrawString(this->score_info_left, this->score_info_right, text_top, STR_BLACK_COMMA, TC_FROMSTRING, SA_RIGHT);
|
|
|
|
|
|
/* Calculate the %-bar */
|
|
|
uint x = Clamp(val, 0, needed) * this->bar_width / needed;
|
|
|
bool rtl = _dynlang.text_dir == TD_RTL;
|
|
|
bool rtl = _current_text_dir == TD_RTL;
|
|
|
if (rtl) {
|
|
|
x = this->bar_right - x;
|
|
|
} else {
|
|
|
x = this->bar_left + x;
|
|
|
}
|
|
|
|