summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2013-10-01 20:16:44 +0000
committeralberth <alberth@openttd.org>2013-10-01 20:16:44 +0000
commit5437a588a0ee819487ac6dd0da511d70d5824bff (patch)
treed8ff87fc2df21562edf24ff3c9fe475e18add326
parent3efc999c009fc4c8be4ca93ed5ee606e07f419ca (diff)
downloadopenttd-5437a588a0ee819487ac6dd0da511d70d5824bff.tar.xz
(svn r25803) -Fix[FS#5738]: Draw start/stop graphics of the vehicle bar at the right place in rtl mode (adf88).
-rw-r--r--bin/baseset/orig_dos.obg1
-rw-r--r--src/vehicle_gui.cpp12
2 files changed, 10 insertions, 3 deletions
diff --git a/bin/baseset/orig_dos.obg b/bin/baseset/orig_dos.obg
index 609b5c016..22bc6d703 100644
--- a/bin/baseset/orig_dos.obg
+++ b/bin/baseset/orig_dos.obg
@@ -51,6 +51,7 @@ description.sv_SE = Originalgrafiken från Transport Tycoon Deluxe, DOS-utgåvan
description.ta_IN = அசல் டிரான்ஸ்ஃபோர்ட் டைகூன் டீலக்ஸ் DOS பதிப்பு அசைவூட்டங்கள்.
description.th_TH = กราฟฟิกต้นตำหรับของ Transport Tycoon Deluxe DOS edition
description.tr_TR = Orijinal Transport Tycoon Deluxe DOS sürümü grafikleri.
+description.uk_UA = Оригінальна графіка з Transport Tycoon Deluxe DOS edition.
description.vi_VN = Đồ họa gốc từ phiên bản Transport Tycoon Deluxe trên DOS
description.zh_CN = 运输大亨DOS豪华版原版图形包.
description.zh_TW = 原版 Transport Tycoon Deluxe DOS 版的圖形。
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index ff8719c07..17e9dcc96 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -2619,9 +2619,15 @@ public:
}
}
- /* draw the flag plus orders */
- DrawSprite(v->vehstatus & VS_STOPPED ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING, PAL_NONE, WD_FRAMERECT_LEFT, r.top + WD_FRAMERECT_TOP);
- DrawString(r.left + WD_FRAMERECT_LEFT + 6, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, str, TC_FROMSTRING, SA_HOR_CENTER);
+ /* Draw the flag plus orders. */
+ bool rtl = (_current_text_dir == TD_RTL);
+ uint text_offset = max(GetSpriteSize(SPR_FLAG_VEH_STOPPED).width, GetSpriteSize(SPR_FLAG_VEH_RUNNING).width) + WD_IMGBTN_LEFT + WD_IMGBTN_RIGHT;
+ int text_left = r.left + (rtl ? (uint)WD_FRAMERECT_LEFT : text_offset);
+ int text_right = r.right - (rtl ? text_offset : (uint)WD_FRAMERECT_RIGHT);
+ int image_left = (rtl ? text_right + 1 : r.left) + WD_IMGBTN_LEFT;
+ int image = ((v->vehstatus & VS_STOPPED) != 0) ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING;
+ DrawSprite(image, PAL_NONE, image_left, r.top + WD_IMGBTN_TOP);
+ DrawString(text_left, text_right, r.top + WD_FRAMERECT_TOP, str, TC_FROMSTRING, SA_HOR_CENTER);
}
virtual void OnClick(Point pt, int widget, int click_count)