mirror of https://github.com/OpenTTD/OpenTTD
Fix: Small order list arrow was wrong direction for RTL text. (#14174)
Add sprite for small left arrow and use for small order list when using an RTL language.pull/14184/head
parent
41b113840a
commit
d958d50985
Binary file not shown.
|
@ -1 +1 @@
|
|||
019dba4830a64ee4345d3d647633e1da
|
||||
ff92f892a34a3b9d7a08e68281a7e9b1
|
||||
|
|
|
@ -840,3 +840,7 @@
|
|||
-1 sprites/chars.png 8bpp 630 400 6 21 0 -2 normal
|
||||
-1 sprites/mono.png 8bpp 325 270 7 13 0 0 normal
|
||||
-1 sprites/mono.png 8bpp 340 270 7 13 0 0 normal
|
||||
|
||||
// U+E29D: Small left arrow
|
||||
-1 * 6 12 01 01 01 9D E2
|
||||
-1 sprites/chars.png 8bpp 10 430 5 5 0 1 normal
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
@ -5888,6 +5888,7 @@ STR_CURRENCY_SHORT_GIGA :{NBSP}bn
|
|||
STR_CURRENCY_SHORT_TERA :{NBSP}tn
|
||||
|
||||
STR_JUST_CARGO :{CARGO_LONG}
|
||||
STR_JUST_LEFT_ARROW :{LEFT_ARROW}
|
||||
STR_JUST_RIGHT_ARROW :{RIGHT_ARROW}
|
||||
STR_JUST_CHECKMARK :{CHECKMARK}
|
||||
STR_JUST_COMMA :{COMMA}
|
||||
|
|
|
@ -171,6 +171,7 @@ enum StringControlCode : uint16_t {
|
|||
* These are mapped to the original glyphs */
|
||||
SCC_LESS_THAN = SCC_SPRITE_START + 0x3C,
|
||||
SCC_GREATER_THAN = SCC_SPRITE_START + 0x3E,
|
||||
SCC_LEFT_ARROW = SCC_SPRITE_START + 0x9D,
|
||||
SCC_UP_ARROW = SCC_SPRITE_START + 0xA0,
|
||||
SCC_DOWN_ARROW = SCC_SPRITE_START + 0xAA,
|
||||
SCC_CHECKMARK = SCC_SPRITE_START + 0xAC,
|
||||
|
|
|
@ -142,6 +142,7 @@ static const CmdStruct _cmd_structs[] = {
|
|||
{"DOWN_ARROW", EmitSingleChar, SCC_DOWN_ARROW, 0, std::nullopt, {CmdFlag::DontCount}},
|
||||
{"CHECKMARK", EmitSingleChar, SCC_CHECKMARK, 0, std::nullopt, {CmdFlag::DontCount}},
|
||||
{"CROSS", EmitSingleChar, SCC_CROSS, 0, std::nullopt, {CmdFlag::DontCount}},
|
||||
{"LEFT_ARROW", EmitSingleChar, SCC_LEFT_ARROW, 0, std::nullopt, {CmdFlag::DontCount}},
|
||||
{"RIGHT_ARROW", EmitSingleChar, SCC_RIGHT_ARROW, 0, std::nullopt, {CmdFlag::DontCount}},
|
||||
{"SMALL_LEFT_ARROW", EmitSingleChar, SCC_LESS_THAN, 0, std::nullopt, {CmdFlag::DontCount}},
|
||||
{"SMALL_RIGHT_ARROW", EmitSingleChar, SCC_GREATER_THAN, 0, std::nullopt, {CmdFlag::DontCount}},
|
||||
|
|
|
@ -477,7 +477,7 @@ Dimension BaseVehicleListWindow::GetActionDropdownSize(bool show_autoreplace, bo
|
|||
|
||||
void BaseVehicleListWindow::OnInit()
|
||||
{
|
||||
this->order_arrow_width = GetStringBoundingBox(STR_JUST_RIGHT_ARROW, FS_SMALL).width;
|
||||
this->order_arrow_width = std::max(GetStringBoundingBox(STR_JUST_LEFT_ARROW, FS_SMALL).width, GetStringBoundingBox(STR_JUST_RIGHT_ARROW, FS_SMALL).width);
|
||||
this->SetCargoFilterArray();
|
||||
}
|
||||
|
||||
|
@ -1666,7 +1666,7 @@ static void DrawSmallOrderList(const Vehicle *v, int left, int right, int y, uin
|
|||
VehicleOrderID oid = start;
|
||||
|
||||
do {
|
||||
if (oid == v->cur_real_order_index) DrawString(left, right, y, STR_JUST_RIGHT_ARROW, TC_BLACK, SA_LEFT, false, FS_SMALL);
|
||||
if (oid == v->cur_real_order_index) DrawString(left, right, y, rtl ? STR_JUST_LEFT_ARROW : STR_JUST_RIGHT_ARROW, TC_BLACK, SA_LEFT, false, FS_SMALL);
|
||||
|
||||
if (order->IsType(OT_GOTO_STATION)) {
|
||||
DrawString(left + l_offset, right - r_offset, y, GetString(STR_STATION_NAME, order->GetDestination()), TC_BLACK, SA_LEFT, false, FS_SMALL);
|
||||
|
|
Loading…
Reference in New Issue