Mercurial > hg > openttd
changeset 13650:24c6119e2667 draft
(svn r18174) -Codechange: make the sign list RTL aware
author | rubidium <rubidium@openttd.org> |
---|---|
date | Wed, 18 Nov 2009 21:27:13 +0000 |
parents | 327d2027f7ff |
children | 5a604d7988c1 |
files | src/signs_gui.cpp |
diffstat | 1 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -119,14 +119,19 @@ return; } + bool rtl = _dynlang.text_dir == TD_RTL; + uint icon_left = 4 + (rtl ? r.right - this->text_offset : r.left); + uint text_left = r.left + (rtl ? WD_FRAMERECT_LEFT : this->text_offset); + uint text_right = r.right - (rtl ? this->text_offset : WD_FRAMERECT_RIGHT); + /* At least one sign available. */ for (uint16 i = this->vscroll.GetPosition(); this->vscroll.IsVisible(i) && i < this->vscroll.GetCount(); i++) { const Sign *si = this->signs[i]; - if (si->owner != OWNER_NONE) DrawCompanyIcon(si->owner, r.left + 4, y + 1); + if (si->owner != OWNER_NONE) DrawCompanyIcon(si->owner, icon_left, y + 1); SetDParam(0, si->index); - DrawString(r.left + this->text_offset, r.right - WD_FRAMETEXT_RIGHT, y, STR_SIGN_NAME, TC_YELLOW); + DrawString(text_left, text_right, y, STR_SIGN_NAME, TC_YELLOW); y += this->resize.step_height; } break;