Changeset - r21523:9ad9d8c6e4bc
[Not reviewed]
master
0 5 0
frosch - 10 years ago 2014-06-10 16:37:25
frosch@openttd.org
(svn r26640) -Cleanup: Remove some pointless STR_JUST_STRING detours.
5 files changed with 17 insertions and 24 deletions:
0 comments (0 inline, 0 general)
src/autoreplace_gui.cpp
Show inline comments
 
@@ -278,10 +278,8 @@ public:
 
			}
 

	
 
			case WID_RV_INFO_TAB: {
 
				SetDParam(0, STR_REPLACE_NOT_REPLACING);
 
				Dimension d = GetStringBoundingBox(STR_BLACK_STRING);
 
				SetDParam(0, STR_REPLACE_NOT_REPLACING_VEHICLE_SELECTED);
 
				d = maxdim(d, GetStringBoundingBox(STR_BLACK_STRING));
 
				Dimension d = GetStringBoundingBox(STR_REPLACE_NOT_REPLACING);
 
				d = maxdim(d, GetStringBoundingBox(STR_REPLACE_NOT_REPLACING_VEHICLE_SELECTED));
 
				d.width += WD_FRAMETEXT_LEFT +  WD_FRAMETEXT_RIGHT;
 
				d.height += WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM;
 
				*size = maxdim(*size, d);
 
@@ -353,20 +351,21 @@ public:
 
		switch (widget) {
 
			case WID_RV_INFO_TAB: {
 
				const Company *c = Company::Get(_local_company);
 
				StringID str;
 
				if (this->sel_engine[0] != INVALID_ENGINE) {
 
					if (!EngineHasReplacementForCompany(c, this->sel_engine[0], this->sel_group)) {
 
						SetDParam(0, STR_REPLACE_NOT_REPLACING);
 
						str = STR_REPLACE_NOT_REPLACING;
 
					} else {
 
						bool when_old = false;
 
						EngineID e = EngineReplacementForCompany(c, this->sel_engine[0], this->sel_group, &when_old);
 
						SetDParam(0, when_old ? STR_REPLACE_REPLACING_WHEN_OLD : STR_ENGINE_NAME);
 
						SetDParam(1, e);
 
						str = when_old ? STR_REPLACE_REPLACING_WHEN_OLD : STR_ENGINE_NAME;
 
						SetDParam(0, e);
 
					}
 
				} else {
 
					SetDParam(0, STR_REPLACE_NOT_REPLACING_VEHICLE_SELECTED);
 
					str = STR_REPLACE_NOT_REPLACING_VEHICLE_SELECTED;
 
				}
 

	
 
				DrawString(r.left + WD_FRAMETEXT_LEFT, r.right - WD_FRAMETEXT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_BLACK_STRING, TC_FROMSTRING, SA_HOR_CENTER);
 
				DrawString(r.left + WD_FRAMETEXT_LEFT, r.right - WD_FRAMETEXT_RIGHT, r.top + WD_FRAMERECT_TOP, str, TC_BLACK, SA_HOR_CENTER);
 
				break;
 
			}
 

	
src/industry_gui.cpp
Show inline comments
 
@@ -119,12 +119,10 @@ static int CDECL IndustryTypeNameSorter(
 
	static char industry_name[2][64];
 

	
 
	const IndustrySpec *indsp1 = GetIndustrySpec(*a);
 
	SetDParam(0, indsp1->name);
 
	GetString(industry_name[0], STR_JUST_STRING, lastof(industry_name[0]));
 
	GetString(industry_name[0], indsp1->name, lastof(industry_name[0]));
 

	
 
	const IndustrySpec *indsp2 = GetIndustrySpec(*b);
 
	SetDParam(0, indsp2->name);
 
	GetString(industry_name[1], STR_JUST_STRING, lastof(industry_name[1]));
 
	GetString(industry_name[1], indsp2->name, lastof(industry_name[1]));
 

	
 
	int r = strnatcmp(industry_name[0], industry_name[1]); // Sort by name (natural sorting).
 

	
 
@@ -1671,8 +1669,7 @@ struct CargoesField {
 
				ypos += (normal_height - FONT_HEIGHT_NORMAL) / 2;
 
				if (this->u.industry.ind_type < NUM_INDUSTRYTYPES) {
 
					const IndustrySpec *indsp = GetIndustrySpec(this->u.industry.ind_type);
 
					SetDParam(0, indsp->name);
 
					DrawString(xpos, xpos2, ypos, STR_JUST_STRING, TC_WHITE, SA_HOR_CENTER);
 
					DrawString(xpos, xpos2, ypos, indsp->name, TC_WHITE, SA_HOR_CENTER);
 

	
 
					/* Draw the industry legend. */
 
					int blob_left, blob_right;
src/newgrf_gui.cpp
Show inline comments
 
@@ -137,9 +137,8 @@ static void ShowNewGRFInfo(const GRFConf
 

	
 
	/* Draw GRF info if it exists */
 
	if (!StrEmpty(c->GetDescription())) {
 
		SetDParam(0, STR_JUST_RAW_STRING);
 
		SetDParamStr(1, c->GetDescription());
 
		y = DrawStringMultiLine(x, right, y, bottom, STR_BLACK_STRING);
 
		SetDParamStr(0, c->GetDescription());
 
		y = DrawStringMultiLine(x, right, y, bottom, STR_BLACK_RAW_STRING);
 
	} else {
 
		y = DrawStringMultiLine(x, right, y, bottom, STR_NEWGRF_SETTINGS_NO_INFO);
 
	}
src/object_gui.cpp
Show inline comments
 
@@ -211,8 +211,7 @@ public:
 
					ObjectClass *objclass = ObjectClass::Get((ObjectClassID)i);
 
					if (objclass->GetUISpecCount() == 0) continue;
 
					if (!this->vscroll->IsVisible(pos++)) continue;
 
					SetDParam(0, objclass->name);
 
					DrawString(r.left + WD_MATRIX_LEFT, r.right - WD_MATRIX_RIGHT, y + WD_MATRIX_TOP, STR_JUST_STRING,
 
					DrawString(r.left + WD_MATRIX_LEFT, r.right - WD_MATRIX_RIGHT, y + WD_MATRIX_TOP, objclass->name,
 
							((int)i == _selected_object_class) ? TC_WHITE : TC_BLACK);
 
					y += this->line_height;
 
				}
src/rail_gui.cpp
Show inline comments
 
@@ -1040,8 +1040,7 @@ public:
 
				Dimension d = {0, 0};
 
				for (uint i = 0; i < StationClass::GetClassCount(); i++) {
 
					if (i == STAT_CLASS_WAYP) continue;
 
					SetDParam(0, StationClass::Get((StationClassID)i)->name);
 
					d = maxdim(d, GetStringBoundingBox(STR_BLACK_STRING));
 
					d = maxdim(d, GetStringBoundingBox(StationClass::Get((StationClassID)i)->name));
 
				}
 
				size->width = max(size->width, d.width + padding.width);
 
				this->line_height = FONT_HEIGHT_NORMAL + WD_MATRIX_TOP + WD_MATRIX_BOTTOM;
 
@@ -1119,8 +1118,8 @@ public:
 
				for (uint i = 0; i < StationClass::GetClassCount(); i++) {
 
					if (i == STAT_CLASS_WAYP) continue;
 
					if (this->vscroll->IsVisible(statclass)) {
 
						SetDParam(0, StationClass::Get((StationClassID)i)->name);
 
						DrawString(r.left + WD_MATRIX_LEFT, r.right - WD_MATRIX_RIGHT, row * this->line_height + r.top + WD_MATRIX_TOP, STR_JUST_STRING,
 
						DrawString(r.left + WD_MATRIX_LEFT, r.right - WD_MATRIX_RIGHT, row * this->line_height + r.top + WD_MATRIX_TOP,
 
								StationClass::Get((StationClassID)i)->name,
 
								(StationClassID)i == _railstation.station_class ? TC_WHITE : TC_BLACK);
 
						row++;
 
					}
0 comments (0 inline, 0 general)