summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-05-23 15:17:05 +0000
committerfrosch <frosch@openttd.org>2010-05-23 15:17:05 +0000
commit50bcc852f98f226d1ddbf1cf62646e7647b71d82 (patch)
tree64c56e635dfeb0dc0ab3b6876f1be20b6cfb5a96
parent58ddfd0fbbea9d1f47b9463835f7aa2b61a812c9 (diff)
downloadopenttd-50bcc852f98f226d1ddbf1cf62646e7647b71d82.tar.xz
(svn r19890) -Codechange: Use real spritewidths for drawing town authority window.
-rw-r--r--src/town_gui.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/town_gui.cpp b/src/town_gui.cpp
index 02ea76b6a..a6f463cc6 100644
--- a/src/town_gui.cpp
+++ b/src/town_gui.cpp
@@ -136,11 +136,13 @@ public:
y += FONT_HEIGHT_NORMAL;
int sprite_y_offset = (FONT_HEIGHT_NORMAL - 10) / 2;
+ uint icon_width = GetSpriteSize(SPR_COMPANY_ICON).width;
+ uint exclusive_width = GetSpriteSize(SPR_BLOT).width;
bool rtl = _dynlang.text_dir == TD_RTL;
- uint text_left = left + (rtl ? 0 : 26);
- uint text_right = right - (rtl ? 26 : 0);
- uint icon_left = rtl ? right - 14 : left;
- uint blob_left = rtl ? right - 24 : left + 16;
+ uint text_left = left + (rtl ? 0 : icon_width + exclusive_width + 4);
+ uint text_right = right - (rtl ? icon_width + exclusive_width + 4 : 0);
+ uint icon_left = rtl ? right - icon_width : left;
+ uint exclusive_left = rtl ? right - icon_width - exclusive_width - 2 : left + icon_width + 2;
/* Draw list of companies */
const Company *c;
@@ -163,8 +165,8 @@ public:
(str++, true); // Outstanding
SetDParam(2, str);
- if (this->town->exclusivity == c->index) { // red icon for company with exclusive rights
- DrawSprite(SPR_BLOT, PALETTE_TO_RED, blob_left, y + sprite_y_offset);
+ if (this->town->exclusivity == c->index) {
+ DrawSprite(SPR_BLOT, PALETTE_TO_RED, exclusive_left, y + sprite_y_offset);
}
DrawString(text_left, text_right, y, STR_LOCAL_AUTHORITY_COMPANY_RATING);