Changeset - r23226:7603f5eb773b
[Not reviewed]
master
0 1 0
Peter Nelson - 6 years ago 2019-01-27 12:33:54
peter1138@openttd.org
Fix: Group hierarchy not visible in RTL languages.
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/group_gui.cpp
Show inline comments
 
@@ -251,25 +251,25 @@ private:
 

	
 
		/* draw group name */
 
		StringID str;
 
		if (IsAllGroupID(g_id)) {
 
			str = STR_GROUP_ALL_TRAINS + this->vli.vtype;
 
		} else if (IsDefaultGroupID(g_id)) {
 
			str = STR_GROUP_DEFAULT_TRAINS + this->vli.vtype;
 
		} else {
 
			SetDParam(0, g_id);
 
			str = STR_GROUP_NAME;
 
		}
 
		int x = rtl ? right - WD_FRAMERECT_RIGHT - 8 - this->column_size[VGC_NAME].width + 1 : left + WD_FRAMERECT_LEFT + 8;
 
		DrawString(x + indent * LEVEL_WIDTH, x + this->column_size[VGC_NAME].width - 1, y + (this->tiny_step_height - this->column_size[VGC_NAME].height) / 2, str, colour);
 
		DrawString(x + (rtl ? 0 : indent), x + this->column_size[VGC_NAME].width - 1 - (rtl ? indent : 0), y + (this->tiny_step_height - this->column_size[VGC_NAME].height) / 2, str, colour);
 

	
 
		/* draw autoreplace protection */
 
		x = rtl ? x - 8 - this->column_size[VGC_PROTECT].width : x + 8 + this->column_size[VGC_NAME].width;
 
		if (protection) DrawSprite(SPR_GROUP_REPLACE_PROTECT, PAL_NONE, x, y + (this->tiny_step_height - this->column_size[VGC_PROTECT].height) / 2);
 

	
 
		/* draw autoreplace status */
 
		x = rtl ? x - 2 - this->column_size[VGC_AUTOREPLACE].width : x + 2 + this->column_size[VGC_PROTECT].width;
 
		if (stats.autoreplace_defined) DrawSprite(SPR_GROUP_REPLACE_ACTIVE, stats.autoreplace_finished ? PALETTE_CRASH : PAL_NONE, x, y + (this->tiny_step_height - this->column_size[VGC_AUTOREPLACE].height) / 2);
 

	
 
		/* draw the profit icon */
 
		x = rtl ? x - 2 - this->column_size[VGC_PROFIT].width : x + 2 + this->column_size[VGC_AUTOREPLACE].width;
 
		SpriteID spr;
 
@@ -573,25 +573,25 @@ public:
 

	
 
				break;
 
			}
 

	
 
			case WID_GL_LIST_GROUP: {
 
				int y1 = r.top + WD_FRAMERECT_TOP;
 
				int max = min(this->group_sb->GetPosition() + this->group_sb->GetCapacity(), this->groups.Length());
 
				for (int i = this->group_sb->GetPosition(); i < max; ++i) {
 
					const Group *g = this->groups[i];
 

	
 
					assert(g->owner == this->owner);
 

	
 
					DrawGroupInfo(y1, r.left, r.right, g->index, this->indents[i], g->replace_protection);
 
					DrawGroupInfo(y1, r.left, r.right, g->index, this->indents[i] * LEVEL_WIDTH, g->replace_protection);
 

	
 
					y1 += this->tiny_step_height;
 
				}
 
				if ((uint)this->group_sb->GetPosition() + this->group_sb->GetCapacity() > this->groups.Length()) {
 
					DrawGroupInfo(y1, r.left, r.right, NEW_GROUP);
 
				}
 
				break;
 
			}
 

	
 
			case WID_GL_SORT_BY_ORDER:
 
				this->DrawSortButtonState(WID_GL_SORT_BY_ORDER, this->vehicles.IsDescSortOrder() ? SBS_DOWN : SBS_UP);
 
				break;
0 comments (0 inline, 0 general)