Changeset - r11765:7d9f5e4316b0
[Not reviewed]
master
0 24 0
rubidium - 15 years ago 2009-04-26 14:52:56
rubidium@openttd.org
(svn r16160) -Codechange: remove the need for explicit TC_FROMSTRING for DrawString.
24 files changed with 130 insertions and 130 deletions:
0 comments (0 inline, 0 general)
src/ai/ai_gui.cpp
Show inline comments
 
@@ -520,13 +520,13 @@ struct AIConfigWindow : public Window {
 
		this->SetWidgetDisabledState(AIC_WIDGET_CONFIGURE, selected_slot == INVALID_COMPANY);
 
		this->DrawWidgets();
 

	
 
		byte max_competitors = _settings_newgame.difficulty.max_no_competitors;
 
		DrawArrowButtons(10, 18, COLOUR_YELLOW, this->clicked_button ? 1 + !!this->clicked_increase : 0, max_competitors > 0, max_competitors < MAX_COMPANIES - 1);
 
		SetDParam(0, _settings_newgame.difficulty.max_no_competitors);
 
		DrawString(36, this->widget[AIC_WIDGET_BACKGROUND].right, 18, STR_DIFFICULTY_LEVEL_SETTING_MAXIMUM_NO_COMPETITORS, TC_FROMSTRING);
 
		DrawString(36, this->widget[AIC_WIDGET_BACKGROUND].right, 18, STR_DIFFICULTY_LEVEL_SETTING_MAXIMUM_NO_COMPETITORS);
 

	
 
		int y = this->widget[AIC_WIDGET_LIST].top;
 
		for (int i = this->vscroll.pos; i < this->vscroll.pos + this->vscroll.cap && i < MAX_COMPANIES; i++) {
 
			StringID text;
 

	
 
			if (AIConfig::GetConfig((CompanyID)i)->GetInfo() != NULL) {
src/aircraft_gui.cpp
Show inline comments
 
@@ -29,39 +29,39 @@ void DrawAircraftDetails(const Vehicle *
 

	
 
	for (const Vehicle *u = v ; u != NULL ; u = u->Next()) {
 
		if (IsNormalAircraft(u)) {
 
			SetDParam(0, u->engine_type);
 
			SetDParam(1, u->build_year);
 
			SetDParam(2, u->value);
 
			DrawString(left, right, y, STR_VEHICLE_INFO_BUILT_VALUE, TC_FROMSTRING);
 
			DrawString(left, right, y, STR_VEHICLE_INFO_BUILT_VALUE);
 

	
 
			SetDParam(0, u->cargo_type);
 
			SetDParam(1, u->cargo_cap);
 
			SetDParam(2, u->Next()->cargo_type);
 
			SetDParam(3, u->Next()->cargo_cap);
 
			SetDParam(4, GetCargoSubtypeText(u));
 
			DrawString(left, right, y + 10, (u->Next()->cargo_cap != 0) ? STR_VEHICLE_INFO_CAPACITY_CAPACITY : STR_VEHICLE_INFO_CAPACITY, TC_FROMSTRING);
 
			DrawString(left, right, y + 10, (u->Next()->cargo_cap != 0) ? STR_VEHICLE_INFO_CAPACITY_CAPACITY : STR_VEHICLE_INFO_CAPACITY);
 
		}
 

	
 
		if (u->cargo_cap != 0) {
 
			uint cargo_count = u->cargo.Count();
 

	
 
			y_offset += 11;
 
			if (cargo_count != 0) {
 
				/* Cargo names (fix pluralness) */
 
				SetDParam(0, u->cargo_type);
 
				SetDParam(1, cargo_count);
 
				SetDParam(2, u->cargo.Source());
 
				DrawString(left, right, y + 21 + y_offset, STR_VEHICLE_DETAILS_CARGO_FROM, TC_FROMSTRING);
 
				DrawString(left, right, y + 21 + y_offset, STR_VEHICLE_DETAILS_CARGO_FROM);
 
				feeder_share += u->cargo.FeederShare();
 
			}
 
		}
 
	}
 

	
 
	SetDParam(0, feeder_share);
 
	DrawString(left, right, y + 33 + y_offset, STR_FEEDER_CARGO_VALUE, TC_FROMSTRING);
 
	DrawString(left, right, y + 33 + y_offset, STR_FEEDER_CARGO_VALUE);
 
}
 

	
 

	
 
void DrawAircraftImage(const Vehicle *v, int x, int y, VehicleID selection)
 
{
 
	SpriteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v);
src/airport_gui.cpp
Show inline comments
 
@@ -250,13 +250,13 @@ public:
 
		this->DrawWidgets();
 

	
 
		/* only show the station (airport) noise, if the noise option is activated */
 
		if (_settings_game.economy.station_noise_level) {
 
			/* show the noise of the selected airport */
 
			SetDParam(0, airport->noise_level);
 
			DrawString(2, this->width - 2, 206, STR_STATION_NOISE, TC_FROMSTRING);
 
			DrawString(2, this->width - 2, 206, STR_STATION_NOISE);
 
			y_noise_offset = 10;
 
		}
 

	
 
		/* strings such as 'Size' and 'Coverage Area' */
 
		int text_end = DrawStationCoverageAreaText(2, this->widget[BAW_BTN_DOHILIGHT].bottom + 4 + y_noise_offset, SCT_ALL, rad, false);
 
		text_end = DrawStationCoverageAreaText(2, text_end + 4, SCT_ALL, rad, true) + 4;
src/build_vehicle_gui.cpp
Show inline comments
 
@@ -415,13 +415,13 @@ static int DrawCargoCapacityInfo(int lef
 
	for (uint c = 0; c < NUM_CARGO; c++) {
 
		if (cap[c] == 0) continue;
 

	
 
		SetDParam(0, c);
 
		SetDParam(1, cap[c]);
 
		SetDParam(2, refittable ? STR_REFITTABLE : STR_EMPTY);
 
		DrawString(left, right, y, STR_PURCHASE_INFO_CAPACITY, TC_FROMSTRING);
 
		DrawString(left, right, y, STR_PURCHASE_INFO_CAPACITY);
 
		y += FONT_HEIGHT_NORMAL;
 

	
 
		/* Only show as refittable once */
 
		refittable = false;
 
	}
 

	
 
@@ -432,37 +432,37 @@ static int DrawCargoCapacityInfo(int lef
 
static int DrawRailWagonPurchaseInfo(int left, int right, int y, EngineID engine_number, const RailVehicleInfo *rvi)
 
{
 
	const Engine *e = GetEngine(engine_number);
 

	
 
	/* Purchase cost */
 
	SetDParam(0, e->GetCost());
 
	DrawString(left, right, y, STR_PURCHASE_INFO_COST, TC_FROMSTRING);
 
	DrawString(left, right, y, STR_PURCHASE_INFO_COST);
 
	y += FONT_HEIGHT_NORMAL;
 

	
 
	/* Wagon weight - (including cargo) */
 
	uint weight = e->GetDisplayWeight();
 
	SetDParam(0, weight);
 
	uint cargo_weight = (e->CanCarryCargo() ? GetCargo(e->GetDefaultCargoType())->weight * e->GetDisplayDefaultCapacity() >> 4 : 0);
 
	SetDParam(1, cargo_weight + weight);
 
	DrawString(left, right, y, STR_PURCHASE_INFO_WEIGHT_CWEIGHT, TC_FROMSTRING);
 
	DrawString(left, right, y, STR_PURCHASE_INFO_WEIGHT_CWEIGHT);
 
	y += FONT_HEIGHT_NORMAL;
 

	
 
	/* Wagon speed limit, displayed if above zero */
 
	if (_settings_game.vehicle.wagon_speed_limits) {
 
		uint max_speed = e->GetDisplayMaxSpeed();
 
		if (max_speed > 0) {
 
			SetDParam(0, max_speed);
 
			DrawString(left, right, y, STR_PURCHASE_INFO_SPEED, TC_FROMSTRING);
 
			DrawString(left, right, y, STR_PURCHASE_INFO_SPEED);
 
			y += FONT_HEIGHT_NORMAL;
 
		}
 
	}
 

	
 
	/* Running cost */
 
	if (rvi->running_cost_class != 0xFF) {
 
		SetDParam(0, e->GetRunningCost());
 
		DrawString(left, right, y, STR_PURCHASE_INFO_RUNNINGCOST, TC_FROMSTRING);
 
		DrawString(left, right, y, STR_PURCHASE_INFO_RUNNINGCOST);
 
		y += FONT_HEIGHT_NORMAL;
 
	}
 

	
 
	return y;
 
}
 

	
 
@@ -471,40 +471,40 @@ static int DrawRailEnginePurchaseInfo(in
 
{
 
	const Engine *e = GetEngine(engine_number);
 

	
 
	/* Purchase Cost - Engine weight */
 
	SetDParam(0, e->GetCost());
 
	SetDParam(1, e->GetDisplayWeight());
 
	DrawString(left, right, y, STR_PURCHASE_INFO_COST_WEIGHT, TC_FROMSTRING);
 
	DrawString(left, right, y, STR_PURCHASE_INFO_COST_WEIGHT);
 
	y += FONT_HEIGHT_NORMAL;
 

	
 
	/* Max speed - Engine power */
 
	SetDParam(0, e->GetDisplayMaxSpeed());
 
	SetDParam(1, e->GetPower());
 
	DrawString(left, right, y, STR_PURCHASE_INFO_SPEED_POWER, TC_FROMSTRING);
 
	DrawString(left, right, y, STR_PURCHASE_INFO_SPEED_POWER);
 
	y += FONT_HEIGHT_NORMAL;
 

	
 
	/* Max tractive effort - not applicable if old acceleration or maglev */
 
	if (_settings_game.vehicle.train_acceleration_model != TAM_ORIGINAL && rvi->railtype != RAILTYPE_MAGLEV) {
 
		SetDParam(0, e->GetDisplayMaxTractiveEffort());
 
		DrawString(left, right, y, STR_PURCHASE_INFO_MAX_TE, TC_FROMSTRING);
 
		DrawString(left, right, y, STR_PURCHASE_INFO_MAX_TE);
 
		y += FONT_HEIGHT_NORMAL;
 
	}
 

	
 
	/* Running cost */
 
	if (rvi->running_cost_class != 0xFF) {
 
		SetDParam(0, e->GetRunningCost());
 
		DrawString(left, right, y, STR_PURCHASE_INFO_RUNNINGCOST, TC_FROMSTRING);
 
		DrawString(left, right, y, STR_PURCHASE_INFO_RUNNINGCOST);
 
		y += FONT_HEIGHT_NORMAL;
 
	}
 

	
 
	/* Powered wagons power - Powered wagons extra weight */
 
	if (rvi->pow_wag_power != 0) {
 
		SetDParam(0, rvi->pow_wag_power);
 
		SetDParam(1, rvi->pow_wag_weight);
 
		DrawString(left, right, y, STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT, TC_FROMSTRING);
 
		DrawString(left, right, y, STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT);
 
		y += FONT_HEIGHT_NORMAL;
 
	};
 

	
 
	return y;
 
}
 

	
 
@@ -513,18 +513,18 @@ static int DrawRoadVehPurchaseInfo(int l
 
{
 
	const Engine *e = GetEngine(engine_number);
 

	
 
	/* Purchase cost - Max speed */
 
	SetDParam(0, e->GetCost());
 
	SetDParam(1, e->GetDisplayMaxSpeed());
 
	DrawString(left, right, y, STR_PURCHASE_INFO_COST_SPEED, TC_FROMSTRING);
 
	DrawString(left, right, y, STR_PURCHASE_INFO_COST_SPEED);
 
	y += FONT_HEIGHT_NORMAL;
 

	
 
	/* Running cost */
 
	SetDParam(0, e->GetRunningCost());
 
	DrawString(left, right, y, STR_PURCHASE_INFO_RUNNINGCOST, TC_FROMSTRING);
 
	DrawString(left, right, y, STR_PURCHASE_INFO_RUNNINGCOST);
 
	y += FONT_HEIGHT_NORMAL;
 

	
 
	return y;
 
}
 

	
 
/* Draw ship specific details */
 
@@ -532,25 +532,25 @@ static int DrawShipPurchaseInfo(int left
 
{
 
	const Engine *e = GetEngine(engine_number);
 

	
 
	/* Purchase cost - Max speed */
 
	SetDParam(0, e->GetCost());
 
	SetDParam(1, e->GetDisplayMaxSpeed());
 
	DrawString(left, right, y, STR_PURCHASE_INFO_COST_SPEED, TC_FROMSTRING);
 
	DrawString(left, right, y, STR_PURCHASE_INFO_COST_SPEED);
 
	y += FONT_HEIGHT_NORMAL;
 

	
 
	/* Cargo type + capacity */
 
	SetDParam(0, e->GetDefaultCargoType());
 
	SetDParam(1, e->GetDisplayDefaultCapacity());
 
	SetDParam(2, refittable ? STR_REFITTABLE : STR_EMPTY);
 
	DrawString(left, right, y, STR_PURCHASE_INFO_CAPACITY, TC_FROMSTRING);
 
	DrawString(left, right, y, STR_PURCHASE_INFO_CAPACITY);
 
	y += FONT_HEIGHT_NORMAL;
 

	
 
	/* Running cost */
 
	SetDParam(0, e->GetRunningCost());
 
	DrawString(left, right, y, STR_PURCHASE_INFO_RUNNINGCOST, TC_FROMSTRING);
 
	DrawString(left, right, y, STR_PURCHASE_INFO_RUNNINGCOST);
 
	y += FONT_HEIGHT_NORMAL;
 

	
 
	return y;
 
}
 

	
 
/* Draw aircraft specific details */
 
@@ -559,35 +559,35 @@ static int DrawAircraftPurchaseInfo(int 
 
	const Engine *e = GetEngine(engine_number);
 
	CargoID cargo = e->GetDefaultCargoType();
 

	
 
	/* Purchase cost - Max speed */
 
	SetDParam(0, e->GetCost());
 
	SetDParam(1, e->GetDisplayMaxSpeed());
 
	DrawString(left, right, y, STR_PURCHASE_INFO_COST_SPEED, TC_FROMSTRING);
 
	DrawString(left, right, y, STR_PURCHASE_INFO_COST_SPEED);
 
	y += FONT_HEIGHT_NORMAL;
 

	
 
	/* Cargo capacity */
 
	if (cargo == CT_INVALID || cargo == CT_PASSENGERS) {
 
		SetDParam(0, CT_PASSENGERS);
 
		SetDParam(1, e->GetDisplayDefaultCapacity());
 
		SetDParam(2, CT_MAIL);
 
		SetDParam(3, avi->mail_capacity);
 
		DrawString(left, right, y, STR_PURCHASE_INFO_AIRCRAFT_CAPACITY, TC_FROMSTRING);
 
		DrawString(left, right, y, STR_PURCHASE_INFO_AIRCRAFT_CAPACITY);
 
	} else {
 
		/* Note, if the default capacity is selected by the refit capacity
 
		 * callback, then the capacity shown is likely to be incorrect. */
 
		SetDParam(0, cargo);
 
		SetDParam(1, e->GetDisplayDefaultCapacity());
 
		SetDParam(2, refittable ? STR_REFITTABLE : STR_EMPTY);
 
		DrawString(left, right, y, STR_PURCHASE_INFO_CAPACITY, TC_FROMSTRING);
 
		DrawString(left, right, y, STR_PURCHASE_INFO_CAPACITY);
 
	}
 
	y += FONT_HEIGHT_NORMAL;
 

	
 
	/* Running cost */
 
	SetDParam(0, e->GetRunningCost());
 
	DrawString(left, right, y, STR_PURCHASE_INFO_RUNNINGCOST, TC_FROMSTRING);
 
	DrawString(left, right, y, STR_PURCHASE_INFO_RUNNINGCOST);
 
	y += FONT_HEIGHT_NORMAL;
 

	
 
	return y;
 
}
 

	
 
/**
 
@@ -616,13 +616,13 @@ int DrawVehiclePurchaseInfo(int left, in
 
			/* Cargo type + capacity, or N/A */
 
			int new_y = DrawCargoCapacityInfo(left, right, y, engine_number, VEH_TRAIN, refittable);
 

	
 
			if (new_y == y) {
 
				SetDParam(0, CT_INVALID);
 
				SetDParam(2, STR_EMPTY);
 
				DrawString(left, right, y, STR_PURCHASE_INFO_CAPACITY, TC_FROMSTRING);
 
				DrawString(left, right, y, STR_PURCHASE_INFO_CAPACITY);
 
				y += FONT_HEIGHT_NORMAL;
 
			} else {
 
				y = new_y;
 
			}
 
			break;
 
		}
 
@@ -632,13 +632,13 @@ int DrawVehiclePurchaseInfo(int left, in
 
			/* Cargo type + capacity, or N/A */
 
			int new_y = DrawCargoCapacityInfo(left, right, y, engine_number, VEH_ROAD, refittable);
 

	
 
			if (new_y == y) {
 
				SetDParam(0, CT_INVALID);
 
				SetDParam(2, STR_EMPTY);
 
				DrawString(left, right, y, STR_PURCHASE_INFO_CAPACITY, TC_FROMSTRING);
 
				DrawString(left, right, y, STR_PURCHASE_INFO_CAPACITY);
 
				y += FONT_HEIGHT_NORMAL;
 
			} else {
 
				y = new_y;
 
			}
 
			break;
 
		}
 
@@ -652,18 +652,18 @@ int DrawVehiclePurchaseInfo(int left, in
 

	
 
	/* Draw details, that applies to all types except rail wagons */
 
	if (e->type != VEH_TRAIN || RailVehInfo(engine_number)->railveh_type != RAILVEH_WAGON) {
 
		/* Design date - Life length */
 
		SetDParam(0, ymd.year);
 
		SetDParam(1, e->lifelength);
 
		DrawString(left, right, y, STR_PURCHASE_INFO_DESIGNED_LIFE, TC_FROMSTRING);
 
		DrawString(left, right, y, STR_PURCHASE_INFO_DESIGNED_LIFE);
 
		y += FONT_HEIGHT_NORMAL;
 

	
 
		/* Reliability */
 
		SetDParam(0, e->reliability * 100 >> 16);
 
		DrawString(left, right, y, STR_PURCHASE_INFO_RELIABILITY, TC_FROMSTRING);
 
		DrawString(left, right, y, STR_PURCHASE_INFO_RELIABILITY);
 
		y += FONT_HEIGHT_NORMAL;
 
	}
 

	
 
	/* Additional text from NewGRF */
 
	y = ShowAdditionalText(left, right, y, engine_number);
 
	if (refittable) y = ShowRefitOptionsList(left, right, y, engine_number);
src/cheat_gui.cpp
Show inline comments
 
@@ -190,13 +190,13 @@ struct CheatWindow : Window {
 
						/* Fallthrough */
 
						default: SetDParam(0, val);
 
					}
 
				} break;
 
			}
 

	
 
			DrawString(50, this->width, y + 1, ce->str, TC_FROMSTRING);
 
			DrawString(50, this->width, y + 1, ce->str);
 

	
 
			y += 12;
 
		}
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
src/company_gui.cpp
Show inline comments
 
@@ -119,13 +119,13 @@ static void DrawCompanyEconomyStats(cons
 
			ExpensesType et = _expenses_list_types[type].et[i];
 
			if (et == INVALID_EXPENSES) {
 
				y += 2;
 
				DrawString(w->left + 2, w->right - 2, y, STR_FINANCES_TOTAL_CAPTION, TC_FROMSTRING, SA_RIGHT);
 
				y += 20;
 
			} else {
 
				DrawString(w->left + 2, w->right - 2, y, STR_FINANCES_SECTION_CONSTRUCTION + et, TC_FROMSTRING);
 
				DrawString(w->left + 2, w->right - 2, y, STR_FINANCES_SECTION_CONSTRUCTION + et);
 
				y += 10;
 
			}
 
		}
 

	
 
		DrawString(w->left + 2, w->right - 2, y + 2, STR_FINANCES_TOTAL_CAPTION, TC_FROMSTRING, SA_RIGHT);
 

	
 
@@ -182,24 +182,24 @@ static void DrawCompanyEconomyStats(cons
 
		} while (--j != 0);
 

	
 
		y += 14;
 

	
 
		/* draw max loan aligned to loan below (y += 10) */
 
		SetDParam(0, _economy.max_loan);
 
		DrawString(widget[CFW_TOTAL_MAXLOAN].left, widget[CFW_TOTAL_MAXLOAN].right, y + 10, STR_MAX_LOAN, TC_FROMSTRING);
 
		DrawString(widget[CFW_TOTAL_MAXLOAN].left, widget[CFW_TOTAL_MAXLOAN].right, y + 10, STR_MAX_LOAN);
 
	} else {
 
		y = 15;
 
	}
 

	
 
	DrawString(widget[CFW_TOTAL_LABELS].left, widget[CFW_TOTAL_LABELS].right, y, STR_FINANCES_BANK_BALANCE_TITLE, TC_FROMSTRING);
 
	DrawString(widget[CFW_TOTAL_LABELS].left, widget[CFW_TOTAL_LABELS].right, y, STR_FINANCES_BANK_BALANCE_TITLE);
 
	SetDParam(0, c->money);
 
	DrawString(widget[CFW_TOTAL_VALUES].left, widget[CFW_TOTAL_VALUES].right, y, STR_FINANCES_TOTAL_CURRENCY, TC_FROMSTRING, SA_RIGHT);
 

	
 
	y += 10;
 

	
 
	DrawString(widget[CFW_TOTAL_LABELS].left, widget[CFW_TOTAL_LABELS].right, y, STR_FINANCES_LOAN_TITLE, TC_FROMSTRING);
 
	DrawString(widget[CFW_TOTAL_LABELS].left, widget[CFW_TOTAL_LABELS].right, y, STR_FINANCES_LOAN_TITLE);
 
	SetDParam(0, c->current_loan);
 
	DrawString(widget[CFW_TOTAL_VALUES].left, widget[CFW_TOTAL_VALUES].right, y, STR_FINANCES_TOTAL_CURRENCY, TC_FROMSTRING, SA_RIGHT);
 

	
 
	y += 12;
 

	
 
	GfxFillRect(widget[CFW_TOTAL_VALUES].left, y - 2, widget[CFW_TOTAL_VALUES].right, y - 2, 215);
 
@@ -1427,13 +1427,13 @@ static void DrawCompanyVehiclesAmount(Co
 
	const Vehicle *v;
 
	uint train = 0;
 
	uint road  = 0;
 
	uint air   = 0;
 
	uint ship  = 0;
 

	
 
	DrawString(x, right, y, STR_COMPANY_VIEW_VEHICLES_TITLE, TC_FROMSTRING);
 
	DrawString(x, right, y, STR_COMPANY_VIEW_VEHICLES_TITLE);
 

	
 
	FOR_ALL_VEHICLES(v) {
 
		if (v->owner == company) {
 
			switch (v->type) {
 
				case VEH_TRAIN:    if (IsFrontEngine(v)) train++; break;
 
				case VEH_ROAD:     if (IsRoadVehFront(v)) road++; break;
 
@@ -1442,35 +1442,35 @@ static void DrawCompanyVehiclesAmount(Co
 
				default: break;
 
			}
 
		}
 
	}
 

	
 
	if (train + road + air + ship == 0) {
 
		DrawString(x + 70, right, y, STR_COMPANY_VIEW_VEHICLES_NONE, TC_FROMSTRING);
 
		DrawString(x + 70, right, y, STR_COMPANY_VIEW_VEHICLES_NONE);
 
	} else {
 
		if (train != 0) {
 
			SetDParam(0, train);
 
			DrawString(x + 70, right, y, STR_TRAINS, TC_FROMSTRING);
 
			DrawString(x + 70, right, y, STR_TRAINS);
 
			y += 10;
 
		}
 

	
 
		if (road != 0) {
 
			SetDParam(0, road);
 
			DrawString(x + 70, right, y, STR_ROAD_VEHICLES, TC_FROMSTRING);
 
			DrawString(x + 70, right, y, STR_ROAD_VEHICLES);
 
			y += 10;
 
		}
 

	
 
		if (air != 0) {
 
			SetDParam(0, air);
 
			DrawString(x + 70, right, y, STR_AIRCRAFT, TC_FROMSTRING);
 
			DrawString(x + 70, right, y, STR_AIRCRAFT);
 
			y += 10;
 
		}
 

	
 
		if (ship != 0) {
 
			SetDParam(0, ship);
 
			DrawString(x + 70, right, y, STR_SHIPS, TC_FROMSTRING);
 
			DrawString(x + 70, right, y, STR_SHIPS);
 
		}
 
	}
 
}
 

	
 
int GetAmountOwnedBy(const Company *c, Owner owner)
 
{
 
@@ -1493,13 +1493,13 @@ static void DrawCompanyOwnerText(const C
 
	FOR_ALL_COMPANIES(c2) {
 
		uint amt = GetAmountOwnedBy(c, c2->index);
 
		if (amt != 0) {
 
			SetDParam(0, amt * 25);
 
			SetDParam(1, c2->index);
 

	
 
			DrawString(120, 359, (num++) * height + 116, STR_COMPANY_VIEW_SHARES_OWNED_BY, TC_FROMSTRING);
 
			DrawString(120, 359, (num++) * height + 116, STR_COMPANY_VIEW_SHARES_OWNED_BY);
 
		}
 
	}
 
}
 

	
 
/**
 
 * Window with general information about a company
 
@@ -1569,25 +1569,25 @@ struct CompanyWindow : Window
 
		/* "xxx (Manager)" */
 
		SetDParam(0, c->index);
 
		DrawStringMultiLine(48 - MAX_LENGTH_PRESIDENT_NAME_PIXELS / 2, 48 + MAX_LENGTH_PRESIDENT_NAME_PIXELS / 2, 135, 157, STR_COMPANY_VIEW_PRESIDENT_MANAGER_TITLE, TC_FROMSTRING, SA_CENTER);
 

	
 
		/* "Inaugurated:" */
 
		SetDParam(0, c->inaugurated_year);
 
		DrawString(110, this->width, 23, STR_COMPANY_VIEW_INAUGURATED_TITLE, TC_FROMSTRING);
 
		DrawString(110, this->width, 23, STR_COMPANY_VIEW_INAUGURATED_TITLE);
 

	
 
		/* "Colour scheme:" */
 
		DrawString(110, this->width, 43, STR_COMPANY_VIEW_COLOUR_SCHEME_TITLE, TC_FROMSTRING);
 
		DrawString(110, this->width, 43, STR_COMPANY_VIEW_COLOUR_SCHEME_TITLE);
 
		/* Draw company-colour bus */
 
		DrawSprite(SPR_VEH_BUS_SW_VIEW, COMPANY_SPRITE_COLOUR(c->index), 215, 44);
 

	
 
		/* "Vehicles:" */
 
		DrawCompanyVehiclesAmount((CompanyID)this->window_number, this->width);
 

	
 
		/* "Company value:" */
 
		SetDParam(0, CalculateCompanyValue(c));
 
		DrawString(110, this->width, 106, STR_COMPANY_VIEW_COMPANY_VALUE, TC_FROMSTRING);
 
		DrawString(110, this->width, 106, STR_COMPANY_VIEW_COMPANY_VALUE);
 

	
 
		/* Shares list */
 
		DrawCompanyOwnerText(c);
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
src/depot_gui.cpp
Show inline comments
 
@@ -294,13 +294,13 @@ struct DepotWindow : Window {
 
			diff_y = 12;
 
		}
 

	
 
		DrawSprite((v->vehstatus & VS_STOPPED) ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING, PAL_NONE, x + diff_x, y + diff_y);
 

	
 
		SetDParam(0, v->unitnumber);
 
		DrawString(x, this->widget[DEPOT_WIDGET_MATRIX].right - 1, y + 2, (uint16)(v->max_age - DAYS_IN_LEAP_YEAR) >= v->age ? STR_BLACK_COMMA : STR_RED_COMMA, TC_FROMSTRING);
 
		DrawString(x, this->widget[DEPOT_WIDGET_MATRIX].right - 1, y + 2, (uint16)(v->max_age - DAYS_IN_LEAP_YEAR) >= v->age ? STR_BLACK_COMMA : STR_RED_COMMA);
 
	}
 

	
 
	void DrawDepotWindow(Window *w)
 
	{
 
		TileIndex tile = this->window_number;
 
		int x, y, i, maxval;
 
@@ -366,13 +366,13 @@ struct DepotWindow : Window {
 
		/* draw the train wagons, that do not have an engine in front */
 
		for (; num < maxval; num++, y += 14) {
 
			const Vehicle *v = this->wagon_list[num - this->vehicle_list.Length()];
 
			const Vehicle *u;
 

	
 
			DrawTrainImage(v, x + 50, y, this->sel, this->hscroll.cap - 29, 0);
 
			DrawString(x, this->widget[DEPOT_WIDGET_MATRIX].right - 1, y + 2, STR_DEPOT_NO_ENGINE, TC_FROMSTRING);
 
			DrawString(x, this->widget[DEPOT_WIDGET_MATRIX].right - 1, y + 2, STR_DEPOT_NO_ENGINE);
 

	
 
			/* Draw the train counter */
 
			i = 0;
 
			u = v;
 
			do i++; while ((u = u->Next()) != NULL); // Determine length of train
 
			SetDParam(0, i);                      // Set the counter
src/gfx_func.h
Show inline comments
 
@@ -92,14 +92,14 @@ enum StringAlignment {
 
	SA_RIGHT,     ///< Right align the text
 
	SA_MASK  = 3, ///< Mask for base alignment
 
	SA_FORCE = 4, ///< Force the alignment, i.e. don't swap for RTL languages.
 
};
 
DECLARE_ENUM_AS_BIT_SET(StringAlignment);
 

	
 
int DrawString(int left, int right, int top, const char *str, TextColour colour, StringAlignment align = SA_LEFT, bool underline = false);
 
int DrawString(int left, int right, int top, StringID str, TextColour colour, StringAlignment align = SA_LEFT, bool underline = false);
 
int DrawString(int left, int right, int top, const char *str, TextColour colour = TC_FROMSTRING, StringAlignment align = SA_LEFT, bool underline = false);
 
int DrawString(int left, int right, int top, StringID str, TextColour colour = TC_FROMSTRING, StringAlignment align = SA_LEFT, bool underline = false);
 
int DrawStringMultiLine(int left, int right, int top, int bottom, StringID str, TextColour colour = TC_FROMSTRING, StringAlignment align = SA_LEFT, bool underline = false);
 

	
 
void DrawCharCentered(uint32 c, int x, int y, TextColour colour);
 

	
 
void GfxFillRect(int left, int top, int right, int bottom, int colour, FillRectMode mode = FILLRECT_OPAQUE);
 
void GfxDrawLine(int left, int top, int right, int bottom, int colour);
src/graph_gui.cpp
Show inline comments
 
@@ -785,13 +785,13 @@ struct PaymentRatesGraphWindow : BaseGra
 
				 * when the button is clicked */
 
				byte clk_dif = this->IsWidgetLowered(i + 3) ? 1 : 0;
 

	
 
				GfxFillRect(x + clk_dif, y + clk_dif, x + 8 + clk_dif, y + 5 + clk_dif, 0);
 
				GfxFillRect(x + 1 + clk_dif, y + 1 + clk_dif, x + 7 + clk_dif, y + 4 + clk_dif, cs->legend_colour);
 
				SetDParam(0, cs->name);
 
				DrawString(x + 14 + clk_dif, this->width, y + clk_dif, STR_GRAPH_CARGO_PAYMENT_CARGO, TC_FROMSTRING);
 
				DrawString(x + 14 + clk_dif, this->width, y + clk_dif, STR_GRAPH_CARGO_PAYMENT_CARGO);
 
				y += 8;
 
			}
 

	
 
			this->colours[i] = cs->legend_colour;
 
			for (uint j = 0; j != 20; j++) {
 
				this->cost[i][j] = GetTransportedGoodsIncome(10, 20, j * 4 + 4, c);
 
@@ -800,14 +800,14 @@ struct PaymentRatesGraphWindow : BaseGra
 
			i++;
 
		}
 
		this->num_dataset = i;
 

	
 
		this->DrawGraph();
 

	
 
		DrawString(2 + 46, this->width, 24 + this->gd_height + 7, STR_GRAPH_CARGO_PAYMENT_RATES_X_LABEL, TC_FROMSTRING);
 
		DrawString(2 + 84, this->width, 24 - 9, STR_GRAPH_CARGO_PAYMENT_RATES_TITLE, TC_FROMSTRING);
 
		DrawString(2 + 46, this->width, 24 + this->gd_height + 7, STR_GRAPH_CARGO_PAYMENT_RATES_X_LABEL);
 
		DrawString(2 + 84, this->width, 24 - 9, STR_GRAPH_CARGO_PAYMENT_RATES_TITLE);
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
 
	{
 
		if (widget >= 3) {
 
			ToggleBit(_legend_excluded_cargo, widget - 3);
 
@@ -928,13 +928,13 @@ public:
 
			const Company *c = this->companies[i];
 
			SetDParam(0, i + STR_ORDINAL_NUMBER_1ST);
 
			SetDParam(1, c->index);
 
			SetDParam(2, c->index);
 
			SetDParam(3, GetPerformanceTitleFromValue(c->old_economy[1].performance_history));
 

	
 
			DrawString(2, this->width, 15 + i * 10, i == 0 ? STR_COMPANY_LEAGUE_FIRST : STR_COMPANY_LEAGUE_OTHER, TC_FROMSTRING);
 
			DrawString(2, this->width, 15 + i * 10, i == 0 ? STR_COMPANY_LEAGUE_FIRST : STR_COMPANY_LEAGUE_OTHER);
 
			DrawCompanyIcon(c->index, 27, 16 + i * 10);
 
		}
 
	}
 

	
 
	virtual void OnTick()
 
	{
 
@@ -1116,13 +1116,13 @@ struct PerformanceRatingDetailWindow : W
 
				needed = total_score;
 
				score = SCORE_MAX;
 
			} else {
 
				total_score += score;
 
			}
 

	
 
			DrawString(7, 107, y, STR_PERFORMANCE_DETAIL_VEHICLES + i, TC_FROMSTRING);
 
			DrawString(7, 107, y, STR_PERFORMANCE_DETAIL_VEHICLES + i);
 

	
 
			/* Draw the score */
 
			SetDParam(0, score);
 
			DrawString(7, 107, y, STR_PERFORMANCE_DETAIL_INT, TC_FROMSTRING, SA_RIGHT);
 

	
 
			/* Calculate the %-bar */
 
@@ -1155,16 +1155,16 @@ struct PerformanceRatingDetailWindow : W
 
			switch (i) {
 
				case SCORE_MIN_PROFIT:
 
				case SCORE_MIN_INCOME:
 
				case SCORE_MAX_INCOME:
 
				case SCORE_MONEY:
 
				case SCORE_LOAN:
 
					DrawString(167, this->width, y, STR_PERFORMANCE_DETAIL_AMOUNT_CURRENCY, TC_FROMSTRING);
 
					DrawString(167, this->width, y, STR_PERFORMANCE_DETAIL_AMOUNT_CURRENCY);
 
					break;
 
				default:
 
					DrawString(167, this->width, y, STR_PERFORMANCE_DETAIL_AMOUNT_INT, TC_FROMSTRING);
 
					DrawString(167, this->width, y, STR_PERFORMANCE_DETAIL_AMOUNT_INT);
 
			}
 
		}
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
 
	{
src/industry_gui.cpp
Show inline comments
 
@@ -246,13 +246,13 @@ public:
 
			DrawStringMultiLine(x_str, x_str + max_width, y_str, wi->bottom, STR_RANDOM_INDUSTRIES_TIP);
 
			return;
 
		}
 

	
 
		if (_game_mode != GM_EDITOR) {
 
			SetDParam(0, indsp->GetConstructionCost());
 
			DrawString(x_str, right, y_str, STR_INDUSTRY_BUILD_COST, TC_FROMSTRING);
 
			DrawString(x_str, right, y_str, STR_INDUSTRY_BUILD_COST);
 
			y_str += 11;
 
		}
 

	
 
		/* Draw the accepted cargos, if any. Otherwhise, will print "Nothing" */
 
		StringID str = STR_INDUSTRY_VIEW_REQUIRES_CARGO;
 
		byte p = 0;
 
@@ -261,13 +261,13 @@ public:
 
		for (byte j = 0; j < lengthof(indsp->accepts_cargo); j++) {
 
			if (indsp->accepts_cargo[j] == CT_INVALID) continue;
 
			if (p > 0) str++;
 
			SetDParam(p++, GetCargo(indsp->accepts_cargo[j])->name);
 
			SetDParam(p++, GetCargoSuffix(j, CST_FUND, NULL, this->selected_type, indsp));
 
		}
 
		DrawString(x_str, right, y_str, str, TC_FROMSTRING);
 
		DrawString(x_str, right, y_str, str);
 
		y_str += 11;
 

	
 
		/* Draw the produced cargos, if any. Otherwhise, will print "Nothing" */
 
		str = STR_INDUSTRY_VIEW_PRODUCES_CARGO;
 
		p = 0;
 
		SetDParam(0, STR_JUST_NOTHING);
 
@@ -275,13 +275,13 @@ public:
 
		for (byte j = 0; j < lengthof(indsp->produced_cargo); j++) {
 
			if (indsp->produced_cargo[j] == CT_INVALID) continue;
 
			if (p > 0) str++;
 
			SetDParam(p++, GetCargo(indsp->produced_cargo[j])->name);
 
			SetDParam(p++, GetCargoSuffix(j + 3, CST_FUND, NULL, this->selected_type, indsp));
 
		}
 
		DrawString(x_str, right, y_str, str, TC_FROMSTRING);
 
		DrawString(x_str, right, y_str, str);
 
		y_str += 11;
 

	
 
		/* Get the additional purchase info text, if it has not already been */
 
		if (this->text[this->selected_index] == STR_NULL) {   // Have i been called already?
 
			if (HasBit(indsp->callback_flags, CBM_IND_FUND_MORE_TEXT)) {          // No. Can it be called?
 
				uint16 callback_res = GetIndustryCallback(CBID_INDUSTRY_FUND_MORE_TEXT, 0, 0, NULL, this->selected_type, INVALID_TILE);
 
@@ -502,20 +502,20 @@ public:
 

	
 
		if (HasBit(ind->callback_flags, CBM_IND_PRODUCTION_CARGO_ARRIVAL) || HasBit(ind->callback_flags, CBM_IND_PRODUCTION_256_TICKS)) {
 
			for (byte j = 0; j < lengthof(i->accepts_cargo); j++) {
 
				if (i->accepts_cargo[j] == CT_INVALID) continue;
 
				has_accept = true;
 
				if (first) {
 
					DrawString(2, this->widget[IVW_INFO].right, y, STR_INDUSTRY_VIEW_WAITING_FOR_PROCESSING, TC_FROMSTRING);
 
					DrawString(2, this->widget[IVW_INFO].right, y, STR_INDUSTRY_VIEW_WAITING_FOR_PROCESSING);
 
					y += 10;
 
					first = false;
 
				}
 
				SetDParam(0, i->accepts_cargo[j]);
 
				SetDParam(1, i->incoming_cargo_waiting[j]);
 
				SetDParam(2, GetCargoSuffix(j, CST_VIEW, i, i->type, ind));
 
				DrawString(4, this->widget[IVW_INFO].right, y, STR_INDUSTRY_VIEW_WAITING_STOCKPILE_CARGO, TC_FROMSTRING);
 
				DrawString(4, this->widget[IVW_INFO].right, y, STR_INDUSTRY_VIEW_WAITING_STOCKPILE_CARGO);
 
				y += 10;
 
			}
 
		} else {
 
			StringID str = STR_INDUSTRY_VIEW_REQUIRES_CARGO;
 
			byte p = 0;
 
			for (byte j = 0; j < lengthof(i->accepts_cargo); j++) {
 
@@ -523,35 +523,35 @@ public:
 
				has_accept = true;
 
				if (p > 0) str++;
 
				SetDParam(p++, GetCargo(i->accepts_cargo[j])->name);
 
				SetDParam(p++, GetCargoSuffix(j, CST_VIEW, i, i->type, ind));
 
			}
 
			if (has_accept) {
 
				DrawString(2, this->widget[IVW_INFO].right, y, str, TC_FROMSTRING);
 
				DrawString(2, this->widget[IVW_INFO].right, y, str);
 
				y += 10;
 
			}
 
		}
 

	
 
		first = true;
 
		for (byte j = 0; j < lengthof(i->produced_cargo); j++) {
 
			if (i->produced_cargo[j] == CT_INVALID) continue;
 
			if (first) {
 
				if (has_accept) y += 10;
 
				DrawString(2, this->widget[IVW_INFO].right, y, STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE, TC_FROMSTRING);
 
				DrawString(2, this->widget[IVW_INFO].right, y, STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE);
 
				y += 10;
 
				this->production_offset_y = y;
 
				first = false;
 
			}
 

	
 
			SetDParam(0, i->produced_cargo[j]);
 
			SetDParam(1, i->last_month_production[j]);
 
			SetDParam(2, GetCargoSuffix(j + 3, CST_VIEW, i, i->type, ind));
 

	
 
			SetDParam(3, i->last_month_pct_transported[j] * 100 >> 8);
 
			uint x = 4 + (IsProductionAlterable(i) ? 30 : 0);
 
			DrawString(x, this->widget[IVW_INFO].right, y, STR_INDUSTRY_VIEW_TRANSPORTED, TC_FROMSTRING);
 
			DrawString(x, this->widget[IVW_INFO].right, y, STR_INDUSTRY_VIEW_TRANSPORTED);
 
			/* Let's put out those buttons.. */
 
			if (IsProductionAlterable(i)) {
 
				DrawArrowButtons(5, y, COLOUR_YELLOW, (this->clicked_line == j + 1) ? this->clicked_button : 0,
 
						!IsProductionMinimum(i, j), !IsProductionMaximum(i, j));
 
			}
 
			y += 10;
 
@@ -963,13 +963,13 @@ public:
 
				SetDParam(p++, i->last_month_pct_transported[j] * 100 >> 8);
 
			}
 

	
 
			/* Drawing the right string */
 
			StringID str = STR_INDUSTRYDIR_ITEM_NOPROD;
 
			if (p != 1) str = (p == 5) ? STR_INDUSTRYDIR_ITEM : STR_INDUSTRYDIR_ITEM_TWO;
 
			DrawString(4, this->widget[IDW_INDUSTRY_LIST].right, y, str, TC_FROMSTRING);
 
			DrawString(4, this->widget[IDW_INDUSTRY_LIST].right, y, str);
 

	
 
			y += 10;
 
		}
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
src/misc_gui.cpp
Show inline comments
 
@@ -1475,13 +1475,13 @@ static void DrawFiosTexts(int left, int 
 
	if (_fios_path_changed) {
 
		str = FiosGetDescText(&path, &tot);
 
		_fios_path_changed = false;
 
	}
 

	
 
	if (str != STR_ERROR_UNABLE_TO_READ_DRIVE) SetDParam(0, tot);
 
	DrawString(left + 2, right - 2, 37, str, TC_FROMSTRING);
 
	DrawString(left + 2, right - 2, 37, str);
 
	DrawString(left + 2, right - 2, 27, path, TC_BLACK);
 
}
 

	
 
static void MakeSortedSaveGameList()
 
{
 
	uint sort_start = 0;
src/music_gui.cpp
Show inline comments
 
@@ -230,13 +230,13 @@ struct MusicTrackSelectionWindow : publi
 
		DrawString(this->widget[MTSW_LIST_RIGHT].left + 2, this->widget[MTSW_LIST_RIGHT].right - 2, 15, STR_PLAYLIST_PROGRAM, TC_FROMSTRING, SA_CENTER);
 

	
 
		for (uint i = 1; i <= NUM_SONGS_AVAILABLE; i++) {
 
			SetDParam(0, i);
 
			SetDParam(2, i);
 
			SetDParam(1, SPECSTR_SONGNAME);
 
			DrawString(this->widget[MTSW_LIST_LEFT].left + 2, this->widget[MTSW_LIST_LEFT].right - 2, 23 + (i - 1) * 6, (i < 10) ? STR_PLAYLIST_TRACK_SINGLE_DIGIT : STR_PLAYLIST_TRACK_DOUBLE_DIGIT, TC_FROMSTRING);
 
			DrawString(this->widget[MTSW_LIST_LEFT].left + 2, this->widget[MTSW_LIST_LEFT].right - 2, 23 + (i - 1) * 6, (i < 10) ? STR_PLAYLIST_TRACK_SINGLE_DIGIT : STR_PLAYLIST_TRACK_DOUBLE_DIGIT);
 
		}
 

	
 
		for (uint i = 0; i != 6; i++) {
 
			DrawString(this->widget[MTSW_ALL].left + 2, this->widget[MTSW_ALL].right - 2, 45 + i * 8, STR_MUSIC_PLAYLIST_ALL + i, (i == msf.playlist) ? TC_WHITE : TC_BLACK, SA_CENTER);
 
		}
 

	
 
@@ -248,13 +248,13 @@ struct MusicTrackSelectionWindow : publi
 
		int y = 23;
 
		for (const byte *p = _playlists[msf.playlist]; *p != 0; p++) {
 
			uint i = *p;
 
			SetDParam(0, i);
 
			SetDParam(1, SPECSTR_SONGNAME);
 
			SetDParam(2, i);
 
			DrawString(this->widget[MTSW_LIST_RIGHT].left + 2, this->widget[MTSW_LIST_RIGHT].right - 2, y, (i < 10) ? STR_PLAYLIST_TRACK_SINGLE_DIGIT : STR_PLAYLIST_TRACK_DOUBLE_DIGIT, TC_FROMSTRING);
 
			DrawString(this->widget[MTSW_LIST_RIGHT].left + 2, this->widget[MTSW_LIST_RIGHT].right - 2, y, (i < 10) ? STR_PLAYLIST_TRACK_SINGLE_DIGIT : STR_PLAYLIST_TRACK_DOUBLE_DIGIT);
 
			y += 6;
 
		}
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
 
	{
 
@@ -438,23 +438,23 @@ struct MusicWindow : public Window {
 

	
 
		StringID str = STR_MUSIC_TRACK_NONE;
 
		if (_song_is_active != 0 && _music_wnd_cursong != 0) {
 
			SetDParam(0, _music_wnd_cursong);
 
			str = (_music_wnd_cursong < 10) ? STR_MUSIC_TRACK_SINGLE_DIGIT : STR_MUSIC_TRACK_DOUBLE_DIGIT;
 
		}
 
		DrawString(this->widget[MW_INFO].left + 3, this->widget[MW_INFO].right - 3, 46, str, TC_FROMSTRING);
 
		DrawString(this->widget[MW_INFO].left + 3, this->widget[MW_INFO].right - 3, 46, str);
 

	
 
		str = STR_MUSIC_TITLE_NONE;
 
		if (_song_is_active != 0 && _music_wnd_cursong != 0) {
 
			str = STR_MUSIC_TITLE_NAME;
 
			SetDParam(0, SPECSTR_SONGNAME);
 
			SetDParam(1, _music_wnd_cursong);
 
		}
 
		DrawString(this->widget[MW_INFO].left, this->widget[MW_INFO].right, 46, str, TC_FROMSTRING, SA_CENTER);
 

	
 
		DrawString(this->widget[MW_INFO].left + 1, this->widget[MW_INFO].right, 38, STR_MUSIC_TRACK_XTITLE, TC_FROMSTRING);
 
		DrawString(this->widget[MW_INFO].left + 1, this->widget[MW_INFO].right, 38, STR_MUSIC_TRACK_XTITLE);
 

	
 
		for (uint i = 0; i != 6; i++) {
 
			DrawString(this->widget[i + MW_ALL].left, this->widget[i + MW_ALL].right, 59, STR_MUSIC_PLAYLIST_ALL + i, msf.playlist == i ? TC_WHITE : TC_BLACK, SA_CENTER);
 
		}
 

	
 
		DrawString(this->widget[MW_SHUFFLE].left, this->widget[MW_SHUFFLE].right, this->widget[MW_SHUFFLE].top + 1, STR_MUSIC_SHUFFLE, (msf.shuffle ? TC_WHITE : TC_BLACK), SA_CENTER);
src/news_gui.cpp
Show inline comments
 
@@ -181,13 +181,13 @@ struct NewsWindow : Window {
 

	
 
		GfxFillRect(left,  top,    left,  bottom, 0xD7);
 
		GfxFillRect(right, top,    right, bottom, 0xD7);
 
		GfxFillRect(left,  top,    right, top,    0xD7);
 
		GfxFillRect(left,  bottom, right, bottom, 0xD7);
 

	
 
		DrawString(left + 2, right - 2, top + 1, STR_SILVER_CROSS, TC_FROMSTRING);
 
		DrawString(left + 2, right - 2, top + 1, STR_SILVER_CROSS);
 
	}
 

	
 
	virtual void OnPaint()
 
	{
 
		const NewsMode display_mode = _news_subtype_data[this->ni->subtype].display_mode;
 

	
 
@@ -198,13 +198,13 @@ struct NewsWindow : Window {
 

	
 
				if (_news_subtype_data[this->ni->subtype].callback != NULL) {
 
					(_news_subtype_data[this->ni->subtype].callback)(this, ni);
 
					break;
 
				}
 

	
 
				DrawString(2, this->width - 1, 1, STR_SILVER_CROSS, TC_FROMSTRING);
 
				DrawString(2, this->width - 1, 1, STR_SILVER_CROSS);
 

	
 
				SetDParam(0, this->ni->date);
 
				DrawString(2, this->width - 1, 1, STR_DATE_LONG_SMALL, TC_FROMSTRING, SA_RIGHT);
 

	
 
				if (!(this->ni->flags & NF_VIEWPORT)) {
 
					CopyInDParam(0, this->ni->params, lengthof(this->ni->params));
src/roadveh_gui.cpp
Show inline comments
 
@@ -28,13 +28,13 @@ void DrawRoadVehDetails(const Vehicle *v
 
	StringID str;
 
	Money feeder_share = 0;
 

	
 
	SetDParam(0, v->engine_type);
 
	SetDParam(1, v->build_year);
 
	SetDParam(2, v->value);
 
	DrawString(left, right, y + y_offset, STR_VEHICLE_INFO_BUILT_VALUE, TC_FROMSTRING);
 
	DrawString(left, right, y + y_offset, STR_VEHICLE_INFO_BUILT_VALUE);
 

	
 
	if (RoadVehHasArticPart(v)) {
 
		AcceptedCargo max_cargo;
 
		StringID subtype_text[NUM_CARGO];
 
		char capacity[512];
 

	
 
@@ -83,38 +83,38 @@ void DrawRoadVehDetails(const Vehicle *v
 
				SetDParam(0, u->cargo_type);
 
				SetDParam(1, u->cargo.Count());
 
				SetDParam(2, u->cargo.Source());
 
				str = STR_VEHICLE_DETAILS_CARGO_FROM;
 
				feeder_share += u->cargo.FeederShare();
 
			}
 
			DrawString(left, right, y + 21 + y_offset, str, TC_FROMSTRING);
 
			DrawString(left, right, y + 21 + y_offset, str);
 

	
 
			y_offset += 11;
 
		}
 

	
 
		y_offset -= 11;
 
	} else {
 
		SetDParam(0, v->cargo_type);
 
		SetDParam(1, v->cargo_cap);
 
		SetDParam(4, GetCargoSubtypeText(v));
 
		DrawString(left, right, y + 10 + y_offset, STR_VEHICLE_INFO_CAPACITY, TC_FROMSTRING);
 
		DrawString(left, right, y + 10 + y_offset, STR_VEHICLE_INFO_CAPACITY);
 

	
 
		str = STR_VEHICLE_DETAILS_CARGO_EMPTY;
 
		if (!v->cargo.Empty()) {
 
			SetDParam(0, v->cargo_type);
 
			SetDParam(1, v->cargo.Count());
 
			SetDParam(2, v->cargo.Source());
 
			str = STR_VEHICLE_DETAILS_CARGO_FROM;
 
			feeder_share += v->cargo.FeederShare();
 
		}
 
		DrawString(left, right, y + 21 + y_offset, str, TC_FROMSTRING);
 
		DrawString(left, right, y + 21 + y_offset, str);
 
	}
 

	
 
	/* Draw Transfer credits text */
 
	SetDParam(0, feeder_share);
 
	DrawString(left, right, y + 33 + y_offset, STR_FEEDER_CARGO_VALUE, TC_FROMSTRING);
 
	DrawString(left, right, y + 33 + y_offset, STR_FEEDER_CARGO_VALUE);
 
}
 

	
 

	
 
static inline int RoadVehLengthToPixels(int length)
 
{
 
	return (length * 28) / 8;
src/settings_gui.cpp
Show inline comments
 
@@ -564,13 +564,13 @@ public:
 
					(this->clicked_button == i) ? 1 + !!this->clicked_increase : 0,
 
					editable && sdb->min != value,
 
					editable && sdb->max != value);
 

	
 
			value += sdb->str;
 
			SetDParam(0, value);
 
			DrawString(30, this->width, y, str, TC_FROMSTRING);
 
			DrawString(30, this->width, y, str);
 

	
 
			y += GAMEDIFF_WND_ROWSIZE + 2; // space items apart a bit
 
			str++;
 
		}
 
	}
 

	
 
@@ -938,13 +938,13 @@ uint SettingEntry::Draw(GameSettings *se
 
			}
 
			cur_row++;
 
			break;
 
		case SEF_SUBTREE_KIND:
 
			if (cur_row >= first_row) {
 
				DrawSprite((this->d.sub.folded ? SPR_CIRCLE_FOLDED : SPR_CIRCLE_UNFOLDED), PAL_NONE, x, y);
 
				DrawString(x + 12, max_x, y, this->d.sub.title, TC_FROMSTRING);
 
				DrawString(x + 12, max_x, y, this->d.sub.title);
 
			}
 
			cur_row++;
 
			if (!this->d.sub.folded) {
 
				if (this->flags & SEF_LAST_FIELD) {
 
					assert(this->level < sizeof(parent_last));
 
					SetBit(parent_last, this->level); // Add own last-field state
 
@@ -1005,13 +1005,13 @@ void SettingEntry::DrawSetting(GameSetti
 
			} else {
 
				SetDParam(0, (sdb->flags & SGF_NOCOMMA) ? STR_CONFIG_SETTING_INT32 : STR_JUST_COMMA);
 
			}
 
			SetDParam(1, value);
 
		}
 
	}
 
	DrawString(x + 25, max_x, y, (sdb->str) + disabled, TC_FROMSTRING);
 
	DrawString(x + 25, max_x, y, (sdb->str) + disabled);
 
}
 

	
 

	
 
/* == SettingsPage methods == */
 

	
 
/**
src/ship_gui.cpp
Show inline comments
 
@@ -44,26 +44,26 @@ void CcBuildShip(bool success, TileIndex
 
 */
 
void DrawShipDetails(const Vehicle *v, int left, int right, int y)
 
{
 
	SetDParam(0, v->engine_type);
 
	SetDParam(1, v->build_year);
 
	SetDParam(2, v->value);
 
	DrawString(left, right, y, STR_VEHICLE_INFO_BUILT_VALUE, TC_FROMSTRING);
 
	DrawString(left, right, y, STR_VEHICLE_INFO_BUILT_VALUE);
 

	
 
	SetDParam(0, v->cargo_type);
 
	SetDParam(1, v->cargo_cap);
 
	SetDParam(4, GetCargoSubtypeText(v));
 
	DrawString(left, right, y + 10, STR_VEHICLE_INFO_CAPACITY, TC_FROMSTRING);
 
	DrawString(left, right, y + 10, STR_VEHICLE_INFO_CAPACITY);
 

	
 
	StringID str = STR_VEHICLE_DETAILS_CARGO_EMPTY;
 
	if (!v->cargo.Empty()) {
 
		SetDParam(0, v->cargo_type);
 
		SetDParam(1, v->cargo.Count());
 
		SetDParam(2, v->cargo.Source());
 
		str = STR_VEHICLE_DETAILS_CARGO_FROM;
 
	}
 
	DrawString(left, right, y + 21, str, TC_FROMSTRING);
 
	DrawString(left, right, y + 21, str);
 

	
 
	/* Draw Transfer credits text */
 
	SetDParam(0, v->cargo.FeederShare());
 
	DrawString(left, right, y + 33, STR_FEEDER_CARGO_VALUE, TC_FROMSTRING);
 
	DrawString(left, right, y + 33, STR_FEEDER_CARGO_VALUE);
 
}
src/signs_gui.cpp
Show inline comments
 
@@ -103,13 +103,13 @@ struct SignListWindow : Window, SignList
 
		SetDParam(0, this->vscroll.count);
 
		this->DrawWidgets();
 

	
 
		/* No signs? */
 
		int y = this->widget[SLW_LIST].top + 2; // offset from top of widget
 
		if (this->vscroll.count == 0) {
 
			DrawString(this->widget[SLW_LIST].left + 2, this->widget[SLW_LIST].right, y, STR_STATION_LIST_NONE, TC_FROMSTRING);
 
			DrawString(this->widget[SLW_LIST].left + 2, this->widget[SLW_LIST].right, y, STR_STATION_LIST_NONE);
 
			return;
 
		}
 

	
 
		/* Start drawing the signs */
 
		for (uint16 i = this->vscroll.pos; i < this->vscroll.cap + this->vscroll.pos && i < this->vscroll.count; i++) {
 
			const Sign *si = this->signs[i];
src/smallmap_gui.cpp
Show inline comments
 
@@ -862,13 +862,13 @@ public:
 
					DrawString(x + 11, x + COLUMN_WIDTH - 1, y, STR_SMALLMAP_INDUSTRY, TC_BLACK);
 
					GfxFillRect(x, y + 1, x + 8, y + 5, 0); // outer border of the legend colour
 
				}
 
			} else {
 
				/* Anything that is not an industry is using normal process */
 
				GfxFillRect(x, y + 1, x + 8, y + 5, 0);
 
				DrawString(x + 11, x + COLUMN_WIDTH - 1, y, tbl->legend, TC_FROMSTRING);
 
				DrawString(x + 11, x + COLUMN_WIDTH - 1, y, tbl->legend);
 
			}
 
			GfxFillRect(x + 1, y + 2, x + 7, y + 4, tbl->colour); // legend colour
 

	
 
			y += 6;
 
		}
 

	
src/station_gui.cpp
Show inline comments
 
@@ -363,13 +363,13 @@ public:
 
		DrawString(x + cg_ofst, x + cg_ofst + 12, y + cg_ofst, STR_ABBREV_ALL, TC_BLACK, SA_CENTER);
 

	
 
		cg_ofst = this->IsWidgetLowered(SLW_FACILALL) ? 2 : 1;
 
		DrawString(71 + cg_ofst, 71 + cg_ofst + 12, y + cg_ofst, STR_ABBREV_ALL, TC_BLACK);
 

	
 
		if (this->vscroll.count == 0) { // company has no stations
 
			DrawString(xb, this->width, 40, STR_STATION_LIST_NONE, TC_FROMSTRING);
 
			DrawString(xb, this->width, 40, STR_STATION_LIST_NONE);
 
			return;
 
		}
 

	
 
		int max = min(this->vscroll.pos + this->vscroll.cap, this->stations.Length());
 
		y = 40; // start of the list-widget
 

	
 
@@ -382,13 +382,13 @@ public:
 
			/* Do not do the complex check HasStationInUse here, it may be even false
 
			 * when the order had been removed and the station list hasn't been removed yet */
 
			assert(st->owner == owner || (st->owner == OWNER_NONE && !st->IsBuoy()));
 

	
 
			SetDParam(0, st->index);
 
			SetDParam(1, st->facilities);
 
			x = DrawString(xb, this->widget[SLW_LIST].right, y, STR_STATION_LIST_STATION, TC_FROMSTRING) + 5;
 
			x = DrawString(xb, this->widget[SLW_LIST].right, y, STR_STATION_LIST_STATION) + 5;
 

	
 
			/* show cargo waiting and station ratings */
 
			for (CargoID j = 0; j < NUM_CARGO; j++) {
 
				if (!st->goods[j].cargo.Empty()) {
 
					StationsWndShowStationRating(x, this->widget[SLW_LIST].right, y, j, st->goods[j].cargo.Count(), st->goods[j].rating);
 
					x += 20;
 
@@ -818,13 +818,13 @@ struct StationViewWindow : public Window
 
		if (--pos < 0) {
 
			str = STR_JUST_NOTHING;
 
			for (CargoID i = 0; i < NUM_CARGO; i++) {
 
				if (!st->goods[i].cargo.Empty()) str = STR_EMPTY;
 
			}
 
			SetDParam(0, str);
 
			DrawString(x, this->widget[SVW_WAITING].right - 2, y, STR_STATION_VIEW_WAITING_TITLE, TC_FROMSTRING);
 
			DrawString(x, this->widget[SVW_WAITING].right - 2, y, STR_STATION_VIEW_WAITING_TITLE);
 
			y += 10;
 
		}
 

	
 
		for (CargoDataList::const_iterator it = cargolist.begin(); it != cargolist.end() && pos > -maxrows; ++it) {
 
			if (--pos < 0) {
 
				const CargoData *cd = &(*it);
 
@@ -883,26 +883,26 @@ struct StationViewWindow : public Window
 

	
 
			SetDParamStr(0, string);
 
			DrawStringMultiLine(this->widget[SVW_ACCEPTLIST].left + 2, this->widget[SVW_ACCEPTLIST].right - 2, this->widget[SVW_ACCEPTLIST].top + 1, this->widget[SVW_ACCEPTLIST].bottom - 1, STR_JUST_RAW_STRING);
 
		} else { // extended window with list of cargo ratings
 
			y = this->widget[SVW_RATINGLIST].top + 1;
 

	
 
			DrawString(this->widget[SVW_ACCEPTLIST].left + 2, this->widget[SVW_ACCEPTLIST].right - 2, y, STR_STATION_VIEW_CARGO_RATINGS_TITLE, TC_FROMSTRING);
 
			DrawString(this->widget[SVW_ACCEPTLIST].left + 2, this->widget[SVW_ACCEPTLIST].right - 2, y, STR_STATION_VIEW_CARGO_RATINGS_TITLE);
 
			y += 10;
 

	
 
			for (CargoID i = 0; i < NUM_CARGO; i++) {
 
				const CargoSpec *cs = GetCargo(i);
 
				if (!cs->IsValid()) continue;
 

	
 
				const GoodsEntry *ge = &st->goods[i];
 
				if (!HasBit(ge->acceptance_pickup, GoodsEntry::PICKUP)) continue;
 

	
 
				SetDParam(0, cs->name);
 
				SetDParam(2, ge->rating * 101 >> 8);
 
				SetDParam(1, STR_CARGO_RATING_APPALLING + (ge->rating >> 5));
 
				DrawString(this->widget[SVW_ACCEPTLIST].left + 8, this->widget[SVW_ACCEPTLIST].right - 2, y, STR_STATION_VIEW_CARGO_RATING, TC_FROMSTRING);
 
				DrawString(this->widget[SVW_ACCEPTLIST].left + 8, this->widget[SVW_ACCEPTLIST].right - 2, y, STR_STATION_VIEW_CARGO_RATING);
 
				y += 10;
 
			}
 
		}
 
	}
 

	
 
	void HandleCargoWaitingClick(int row)
 
@@ -1158,24 +1158,24 @@ struct SelectStationWindow : Window {
 
		SetVScrollCount(this, _stations_nearby_list.Length() + 1);
 

	
 
		this->DrawWidgets();
 

	
 
		uint y = 17;
 
		if (this->vscroll.pos == 0) {
 
			DrawString(3, this->widget[JSW_PANEL].right - 2, y, STR_CREATE_SPLITTED_STATION, TC_FROMSTRING);
 
			DrawString(3, this->widget[JSW_PANEL].right - 2, y, STR_CREATE_SPLITTED_STATION);
 
			y += 10;
 
		}
 

	
 
		for (uint i = max<uint>(1, this->vscroll.pos); i <= _stations_nearby_list.Length(); ++i, y += 10) {
 
			/* Don't draw anything if it extends past the end of the window. */
 
			if (i - this->vscroll.pos >= this->vscroll.cap) break;
 

	
 
			const Station *st = GetStation(_stations_nearby_list[i - 1]);
 
			SetDParam(0, st->index);
 
			SetDParam(1, st->facilities);
 
			DrawString(3, this->widget[JSW_PANEL].right - 2, y, STR_STATION_LIST_STATION, TC_FROMSTRING);
 
			DrawString(3, this->widget[JSW_PANEL].right - 2, y, STR_STATION_LIST_STATION);
 
		}
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
 
	{
 
		if (widget != JSW_PANEL) return;
src/subsidy_gui.cpp
Show inline comments
 
@@ -119,53 +119,53 @@ struct SubsidyListWindow : Window {
 

	
 
		int right = this->widget[SLW_PANEL].right;
 
		int y = this->widget[SLW_PANEL].top + 1;
 
		int x = this->widget[SLW_PANEL].left + 1;
 

	
 
		/* Section for drawing the offered subisidies */
 
		DrawString(x, right, y, STR_SUBSIDIES_OFFERED_TITLE, TC_FROMSTRING);
 
		DrawString(x, right, y, STR_SUBSIDIES_OFFERED_TITLE);
 
		y += FONT_HEIGHT_NORMAL;
 
		uint num = 0;
 

	
 
		for (s = _subsidies; s != endof(_subsidies); s++) {
 
			if (s->cargo_type != CT_INVALID && s->age < 12) {
 
				/* Displays the two offered towns */
 
				SetupSubsidyDecodeParam(s, 1);
 
				SetDParam(7, _date - ymd.day + 384 - s->age * 32);
 
				DrawString(x + 2, right - 2, y, STR_SUBSIDIES_OFFERED_FROM_TO, TC_FROMSTRING);
 
				DrawString(x + 2, right - 2, y, STR_SUBSIDIES_OFFERED_FROM_TO);
 

	
 
				y += FONT_HEIGHT_NORMAL;
 
				num++;
 
			}
 
		}
 

	
 
		if (num == 0) {
 
			DrawString(x + 2, right - 2, y, STR_SUBSIDIES_NONE, TC_FROMSTRING);
 
			DrawString(x + 2, right - 2, y, STR_SUBSIDIES_NONE);
 
			y += FONT_HEIGHT_NORMAL;
 
		}
 

	
 
		/* Section for drawing the already granted subisidies */
 
		DrawString(x, right, y + 1, STR_SUBSIDIES_SUBSIDISED_TITLE, TC_FROMSTRING);
 
		DrawString(x, right, y + 1, STR_SUBSIDIES_SUBSIDISED_TITLE);
 
		y += FONT_HEIGHT_NORMAL;
 
		num = 0;
 

	
 
		for (s = _subsidies; s != endof(_subsidies); s++) {
 
			if (s->cargo_type != CT_INVALID && s->age >= 12) {
 
				SetupSubsidyDecodeParam(s, 1);
 
				SetDParam(3, GetStation(s->to)->owner);
 
				SetDParam(4, _date - ymd.day + 768 - s->age * 32);
 

	
 
				/* Displays the two connected stations */
 
				DrawString(x + 2, right - 2, y, STR_SUBSIDIES_SUBSIDISED_FROM_TO, TC_FROMSTRING);
 
				DrawString(x + 2, right - 2, y, STR_SUBSIDIES_SUBSIDISED_FROM_TO);
 

	
 
				y += FONT_HEIGHT_NORMAL;
 
				num++;
 
			}
 
		}
 

	
 
		if (num == 0) DrawString(x + 2, right - 2, y, STR_SUBSIDIES_NONE, TC_FROMSTRING);
 
		if (num == 0) DrawString(x + 2, right - 2, y, STR_SUBSIDIES_NONE);
 
	}
 
};
 

	
 
static const Widget _subsidies_list_widgets[] = {
 
{   WWT_CLOSEBOX, RESIZE_NONE,   COLOUR_BROWN,   0,  10,   0,  13, STR_BLACK_CROSS,       STR_TOOLTIP_CLOSE_WINDOW},                       // SLW_CLOSEBOX
 
{    WWT_CAPTION, RESIZE_RIGHT,  COLOUR_BROWN,  11, 307,   0,  13, STR_SUBSIDIES_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS},             // SLW_CAPTION
src/town_gui.cpp
Show inline comments
 
@@ -121,13 +121,13 @@ public:
 

	
 
		SetDParam(0, this->window_number);
 
		this->DrawWidgets();
 

	
 
		int y = this->widget[TWA_RATING_INFO].top + 1;
 

	
 
		DrawString(this->widget[TWA_RATING_INFO].left + 2, this->widget[TWA_RATING_INFO].right - 2, y, STR_LOCAL_AUTHORITY_COMPANY_RATINGS, TC_FROMSTRING);
 
		DrawString(this->widget[TWA_RATING_INFO].left + 2, this->widget[TWA_RATING_INFO].right - 2, y, STR_LOCAL_AUTHORITY_COMPANY_RATINGS);
 
		y += 10;
 

	
 
		/* Draw list of companies */
 
		const Company *c;
 
		FOR_ALL_COMPANIES(c) {
 
			if ((HasBit(this->town->have_ratings, c->index) || this->town->exclusivity == c->index)) {
 
@@ -149,13 +149,13 @@ public:
 

	
 
				SetDParam(2, str);
 
				if (this->town->exclusivity == c->index) { // red icon for company with exclusive rights
 
					DrawSprite(SPR_BLOT, PALETTE_TO_RED, 18, y);
 
				}
 

	
 
				DrawString(this->widget[TWA_RATING_INFO].left + 28, this->widget[TWA_RATING_INFO].right - 2, y, STR_LOCAL_AUTHORITY_COMPANY_RATING, TC_FROMSTRING);
 
				DrawString(this->widget[TWA_RATING_INFO].left + 28, this->widget[TWA_RATING_INFO].right - 2, y, STR_LOCAL_AUTHORITY_COMPANY_RATING);
 
				y += 10;
 
			}
 
		}
 

	
 
		if (y > this->widget[TWA_RATING_INFO].bottom) {
 
			/* If the company list is too big to fit, mark ourself dirty and draw again. */
 
@@ -165,13 +165,13 @@ public:
 
		}
 

	
 
		y = this->widget[TWA_COMMAND_LIST].top + 1;
 
		int pos = this->vscroll.pos;
 

	
 
		if (--pos < 0) {
 
			DrawString(this->widget[TWA_COMMAND_LIST].left + 2, this->widget[TWA_COMMAND_LIST].right - 2, y, STR_LOCAL_AUTHORITY_ACTIONS_TITLE, TC_FROMSTRING);
 
			DrawString(this->widget[TWA_COMMAND_LIST].left + 2, this->widget[TWA_COMMAND_LIST].right - 2, y, STR_LOCAL_AUTHORITY_ACTIONS_TITLE);
 
			y += 10;
 
		}
 

	
 
		for (int i = 0; buttons; i++, buttons >>= 1) {
 
			if (pos <= -5) break; ///< Draw only the 5 fitting lines
 

	
 
@@ -299,21 +299,21 @@ public:
 
		this->DrawWidgets();
 

	
 
		uint y = 107;
 

	
 
		SetDParam(0, this->town->population);
 
		SetDParam(1, this->town->num_houses);
 
		DrawString(2, this->width - 2, y, STR_TOWN_VIEW_POPULATION_HOUSES, TC_FROMSTRING);
 
		DrawString(2, this->width - 2, y, STR_TOWN_VIEW_POPULATION_HOUSES);
 

	
 
		SetDParam(0, this->town->act_pass);
 
		SetDParam(1, this->town->max_pass);
 
		DrawString(2, this->width - 2, y += 10, STR_TOWN_VIEW_PASSENGERS_LAST_MONTH_MAX, TC_FROMSTRING);
 
		DrawString(2, this->width - 2, y += 10, STR_TOWN_VIEW_PASSENGERS_LAST_MONTH_MAX);
 

	
 
		SetDParam(0, this->town->act_mail);
 
		SetDParam(1, this->town->max_mail);
 
		DrawString(2, this->width - 2, y += 10, STR_TOWN_VIEW_MAIL_LAST_MONTH_MAX, TC_FROMSTRING);
 
		DrawString(2, this->width - 2, y += 10, STR_TOWN_VIEW_MAIL_LAST_MONTH_MAX);
 

	
 
		uint cargo_needed_for_growth = 0;
 
		switch (_settings_game.game_creation.landscape) {
 
			case LT_ARCTIC:
 
				if (TilePixelHeight(this->town->xy) >= LowestSnowLine()) cargo_needed_for_growth = 1;
 
				break;
 
@@ -323,13 +323,13 @@ public:
 
				break;
 

	
 
			default: break;
 
		}
 

	
 
		if (cargo_needed_for_growth > 0) {
 
			DrawString(2, this->width - 2, y += 10, STR_CARGO_FOR_TOWNGROWTH, TC_FROMSTRING);
 
			DrawString(2, this->width - 2, y += 10, STR_CARGO_FOR_TOWNGROWTH);
 

	
 
			CargoID first_food_cargo = CT_INVALID;
 
			StringID food_name = STR_CARGO_PLURAL_FOOD;
 
			CargoID first_water_cargo = CT_INVALID;
 
			StringID water_name = STR_CARGO_PLURAL_WATER;
 
			for (CargoID cid = 0; cid < NUM_CARGO; cid++) {
 
@@ -344,37 +344,37 @@ public:
 
				}
 
			}
 

	
 
			if (first_food_cargo != CT_INVALID && this->town->act_food > 0) {
 
				SetDParam(0, first_food_cargo);
 
				SetDParam(1, this->town->act_food);
 
				DrawString(2, this->width - 2, y += 10, STR_CARGO_FOR_TOWNGROWTH_LAST_MONTH, TC_FROMSTRING);
 
				DrawString(2, this->width - 2, y += 10, STR_CARGO_FOR_TOWNGROWTH_LAST_MONTH);
 
			} else {
 
				SetDParam(0, food_name);
 
				DrawString(2, this->width - 2, y += 10, STR_CARGO_FOR_TOWNGROWTH_REQUIRED, TC_FROMSTRING);
 
				DrawString(2, this->width - 2, y += 10, STR_CARGO_FOR_TOWNGROWTH_REQUIRED);
 
			}
 

	
 
			if (cargo_needed_for_growth > 1) {
 
				if (first_water_cargo != CT_INVALID && this->town->act_water > 0) {
 
					SetDParam(0, first_water_cargo);
 
					SetDParam(1, this->town->act_water);
 
					DrawString(2, this->width - 2, y += 10, STR_CARGO_FOR_TOWNGROWTH_LAST_MONTH, TC_FROMSTRING);
 
					DrawString(2, this->width - 2, y += 10, STR_CARGO_FOR_TOWNGROWTH_LAST_MONTH);
 
				} else {
 
					SetDParam(0, water_name);
 
					DrawString(2, this->width - 2, y += 10, STR_CARGO_FOR_TOWNGROWTH_REQUIRED, TC_FROMSTRING);
 
					DrawString(2, this->width - 2, y += 10, STR_CARGO_FOR_TOWNGROWTH_REQUIRED);
 
				}
 
			}
 
		}
 

	
 
		this->DrawViewport();
 

	
 
		/* only show the town noise, if the noise option is activated. */
 
		if (_settings_game.economy.station_noise_level) {
 
			SetDParam(0, this->town->noise_reached);
 
			SetDParam(1, this->town->MaxTownNoise());
 
			DrawString(2, this->width - 2, y += 10, STR_NOISE_IN_TOWN, TC_FROMSTRING);
 
			DrawString(2, this->width - 2, y += 10, STR_NOISE_IN_TOWN);
 
		}
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
 
	{
 
		switch (widget) {
 
@@ -636,21 +636,21 @@ public:
 
				const Town *t = this->towns[i];
 

	
 
				assert(t->xy != INVALID_TILE);
 

	
 
				SetDParam(0, t->index);
 
				SetDParam(1, t->population);
 
				DrawString(2, this->width - 2, y, STR_TOWN_DIRECTORY_TOWN, TC_FROMSTRING);
 
				DrawString(2, this->width - 2, y, STR_TOWN_DIRECTORY_TOWN);
 

	
 
				y += 10;
 
				i++;
 
				if (++n == this->vscroll.cap) break; // max number of towns in 1 window
 
			}
 

	
 
			SetDParam(0, GetWorldPopulation());
 
			DrawString(3, this->width - 3, this->height - 12 + 2, STR_TOWN_POPULATION, TC_FROMSTRING);
 
			DrawString(3, this->width - 3, this->height - 12 + 2, STR_TOWN_POPULATION);
 
		}
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
 
	{
 
		switch (widget) {
src/train_gui.cpp
Show inline comments
 
@@ -127,13 +127,13 @@ static void TrainDetailsCargoTab(const V
 
			SetDParam(0, v->cargo_type);
 
			SetDParam(1, v->cargo.Count());
 
			SetDParam(2, v->cargo.Source());
 
			SetDParam(3, _settings_game.vehicle.freight_trains);
 
			str = FreightWagonMult(v->cargo_type) > 1 ? STR_VEHICLE_DETAILS_CARGO_FROM_MULT : STR_VEHICLE_DETAILS_CARGO_FROM;
 
		}
 
		DrawString(left, right, y, str, TC_FROMSTRING);
 
		DrawString(left, right, y, str);
 
	}
 
}
 

	
 
/**
 
 * Draw the details info tab for the given vehicle at the given position
 
 *
 
@@ -168,13 +168,13 @@ static void TrainDetailsCapacityTab(cons
 
{
 
	if (v->cargo_cap != 0) {
 
		SetDParam(0, v->cargo_type);
 
		SetDParam(1, v->cargo_cap);
 
		SetDParam(4, GetCargoSubtypeText(v));
 
		SetDParam(5, _settings_game.vehicle.freight_trains);
 
		DrawString(left, right, y, FreightWagonMult(v->cargo_type) > 1 ? STR_VEHICLE_INFO_CAPACITY_MULT : STR_VEHICLE_INFO_CAPACITY, TC_FROMSTRING);
 
		DrawString(left, right, y, FreightWagonMult(v->cargo_type) > 1 ? STR_VEHICLE_INFO_CAPACITY_MULT : STR_VEHICLE_INFO_CAPACITY);
 
	}
 
}
 

	
 
int GetTrainDetailsWndVScroll(VehicleID veh_id, byte det_tab)
 
{
 
	AcceptedCargo act_cargo;
 
@@ -268,22 +268,22 @@ void DrawTrainDetails(const Vehicle *v, 
 
			act_cargo[u->cargo_type] += u->cargo.Count();
 
			max_cargo[u->cargo_type] += u->cargo_cap;
 
			feeder_share             += u->cargo.FeederShare();
 
		}
 

	
 
		/* draw total cargo tab */
 
		DrawString(left, right, y + 2, STR_TOTAL_CAPACITY_TEXT, TC_FROMSTRING);
 
		DrawString(left, right, y + 2, STR_TOTAL_CAPACITY_TEXT);
 
		for (CargoID i = 0; i < NUM_CARGO; i++) {
 
			if (max_cargo[i] > 0 && --vscroll_pos < 0 && vscroll_pos > -vscroll_cap) {
 
				y += 14;
 
				SetDParam(0, i);            // {CARGO} #1
 
				SetDParam(1, act_cargo[i]); // {CARGO} #2
 
				SetDParam(2, i);            // {SHORTCARGO} #1
 
				SetDParam(3, max_cargo[i]); // {SHORTCARGO} #2
 
				SetDParam(4, _settings_game.vehicle.freight_trains);
 
				DrawString(left, right, y + 2, FreightWagonMult(i) > 1 ? STR_TOTAL_CAPACITY_MULT : STR_TOTAL_CAPACITY, TC_FROMSTRING);
 
				DrawString(left, right, y + 2, FreightWagonMult(i) > 1 ? STR_TOTAL_CAPACITY_MULT : STR_TOTAL_CAPACITY);
 
			}
 
		}
 
		SetDParam(0, feeder_share);
 
		DrawString(left, right, y + 15, STR_FEEDER_CARGO_VALUE, TC_FROMSTRING);
 
		DrawString(left, right, y + 15, STR_FEEDER_CARGO_VALUE);
 
	}
 
}
src/vehicle_gui.cpp
Show inline comments
 
@@ -361,13 +361,13 @@ struct RefitWindow : public Window {
 
							 DC_QUERY_COST, GetCmdRefitVeh(v->type));
 

	
 
			if (CmdSucceeded(cost)) {
 
				SetDParam(0, this->cargo->cargo);
 
				SetDParam(1, _returned_refit_capacity);
 
				SetDParam(2, cost.GetCost());
 
				DrawStringMultiLine(2, this->width - 2, this->widget[VRW_INFOPANEL].top + 1, this->widget[VRW_INFOPANEL].bottom, STR_REFIT_NEW_CAPACITY_COST_OF_REFIT, TC_FROMSTRING);
 
				DrawStringMultiLine(2, this->width - 2, this->widget[VRW_INFOPANEL].top + 1, this->widget[VRW_INFOPANEL].bottom, STR_REFIT_NEW_CAPACITY_COST_OF_REFIT);
 
			}
 
		}
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget)
 
	{
 
@@ -796,13 +796,13 @@ static void DrawSmallOrderList(const Veh
 
		sel--;
 

	
 
		if (order->IsType(OT_GOTO_STATION)) {
 
			if (v->type == VEH_SHIP && GetStation(order->GetDestination())->IsBuoy()) continue;
 

	
 
			SetDParam(0, order->GetDestination());
 
			DrawString(left, right, y, STR_ORDER_STATION_SMALL, TC_FROMSTRING);
 
			DrawString(left, right, y, STR_ORDER_STATION_SMALL);
 

	
 
			y += 6;
 
			if (++i == 4) break;
 
		}
 
	}
 
}
 
@@ -832,18 +832,18 @@ void BaseVehicleListWindow::DrawVehicleL
 
		StringID str;
 

	
 
		SetDParam(0, v->GetDisplayProfitThisYear());
 
		SetDParam(1, v->GetDisplayProfitLastYear());
 

	
 
		DrawVehicleImage(v, x + 19, y + 6, selected_vehicle, this->widget[VLW_WIDGET_LIST].right - this->widget[VLW_WIDGET_LIST].left - 20, 0);
 
		DrawString(x + 19, this->widget[VLW_WIDGET_LIST].right, y + this->resize.step_height - 8, STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR, TC_FROMSTRING);
 
		DrawString(x + 19, this->widget[VLW_WIDGET_LIST].right, y + this->resize.step_height - 8, STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR);
 

	
 
		if (v->name != NULL) {
 
			/* The vehicle got a name so we will print it */
 
			SetDParam(0, v->index);
 
			DrawString(x + 19, this->widget[VLW_WIDGET_LIST].right, y, STR_VEHICLE_NAME_SMALL, TC_FROMSTRING);
 
			DrawString(x + 19, this->widget[VLW_WIDGET_LIST].right, y, STR_VEHICLE_NAME_SMALL);
 
		} else if (v->group_id != DEFAULT_GROUP) {
 
			/* The vehicle has no name, but is member of a group, so print group name */
 
			SetDParam(0, v->group_id);
 
			DrawString(x + 19, this->widget[VLW_WIDGET_LIST].right, y, STR_GROUP_TINY_NAME, TC_BLACK);
 
		}
 

	
 
@@ -853,13 +853,13 @@ void BaseVehicleListWindow::DrawVehicleL
 
			str = STR_BLUE_NUMBER;
 
		} else {
 
			str = (v->age > v->max_age - DAYS_IN_LEAP_YEAR) ? STR_RED_COMMA : STR_BLACK_COMMA;
 
		}
 

	
 
		SetDParam(0, v->unitnumber);
 
		DrawString(x, this->widget[VLW_WIDGET_LIST].right, y + 2, str, TC_FROMSTRING);
 
		DrawString(x, this->widget[VLW_WIDGET_LIST].right, y + 2, str);
 

	
 
		DrawVehicleProfitButton(v, x, y + 13);
 

	
 
		y += this->resize.step_height;
 
	}
 
}
 
@@ -1470,50 +1470,50 @@ struct VehicleDetailsWindow : Window {
 

	
 
		/* Draw running cost */
 
		SetDParam(1, v->age / DAYS_IN_LEAP_YEAR);
 
		SetDParam(0, (v->age + DAYS_IN_YEAR < v->max_age) ? STR_AGE : STR_AGE_RED);
 
		SetDParam(2, v->max_age / DAYS_IN_LEAP_YEAR);
 
		SetDParam(3, v->GetDisplayRunningCost());
 
		DrawString(2, this->width - 2, 15, STR_VEHICLE_INFO_AGE_RUNNING_COST_YR, TC_FROMSTRING);
 
		DrawString(2, this->width - 2, 15, STR_VEHICLE_INFO_AGE_RUNNING_COST_YR);
 

	
 
		/* Draw max speed */
 
		switch (v->type) {
 
			case VEH_TRAIN:
 
				SetDParam(2, v->GetDisplayMaxSpeed());
 
				SetDParam(1, v->u.rail.cached_power);
 
				SetDParam(0, v->u.rail.cached_weight);
 
				SetDParam(3, v->u.rail.cached_max_te / 1000);
 
				DrawString(2, this->width - 2, 25, (_settings_game.vehicle.train_acceleration_model != TAM_ORIGINAL && v->u.rail.railtype != RAILTYPE_MAGLEV) ?
 
					STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :
 
					STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED, TC_FROMSTRING);
 
					STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED);
 
				break;
 

	
 
			case VEH_ROAD:
 
			case VEH_SHIP:
 
			case VEH_AIRCRAFT:
 
				SetDParam(0, v->GetDisplayMaxSpeed());
 
				DrawString(2, this->width - 2, 25, STR_VEHICLE_INFO_MAX_SPEED, TC_FROMSTRING);
 
				DrawString(2, this->width - 2, 25, STR_VEHICLE_INFO_MAX_SPEED);
 
				break;
 

	
 
			default: NOT_REACHED();
 
		}
 

	
 
		/* Draw profit */
 
		SetDParam(0, v->GetDisplayProfitThisYear());
 
		SetDParam(1, v->GetDisplayProfitLastYear());
 
		DrawString(2, this->width - 2, 35, STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR, TC_FROMSTRING);
 
		DrawString(2, this->width - 2, 35, STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR);
 

	
 
		/* Draw breakdown & reliability */
 
		SetDParam(0, v->reliability * 100 >> 16);
 
		SetDParam(1, v->breakdowns_since_last_service);
 
		DrawString(2, this->width - 2, 45, STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS, TC_FROMSTRING);
 
		DrawString(2, this->width - 2, 45, STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS);
 

	
 
		/* Draw service interval text */
 
		SetDParam(0, v->service_interval);
 
		SetDParam(1, v->date_of_last_service);
 
		DrawString(13, this->width - 2, this->height - (v->type != VEH_TRAIN ? 11 : 23), _settings_game.vehicle.servint_ispercent ? STR_VEHICLE_DETAILS_SERVICING_INTERVAL_PERCENT : STR_VEHICLE_DETAILS_SERVICING_INTERVAL_DAYS, TC_FROMSTRING);
 
		DrawString(13, this->width - 2, this->height - (v->type != VEH_TRAIN ? 11 : 23), _settings_game.vehicle.servint_ispercent ? STR_VEHICLE_DETAILS_SERVICING_INTERVAL_PERCENT : STR_VEHICLE_DETAILS_SERVICING_INTERVAL_DAYS);
 

	
 
		switch (v->type) {
 
			case VEH_TRAIN:
 
				DrawVehicleDetails(v, 2, this->width - 2, 57, this->vscroll.pos, this->vscroll.cap, det_tab);
 
				break;
 

	
src/widget.cpp
Show inline comments
 
@@ -264,13 +264,13 @@ void Window::DrawWidgets() const
 
		}
 

	
 
		case WWT_INSET: {
 
			const StringID str = wi->data;
 
			DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->colour, FR_LOWERED | FR_DARKENED);
 

	
 
			if (str != STR_NULL) DrawString(r.left + 2, r.right - 2, r.top + 1, str, TC_FROMSTRING);
 
			if (str != STR_NULL) DrawString(r.left + 2, r.right - 2, r.top + 1, str);
 
			break;
 
		}
 

	
 
		case WWT_MATRIX: {
 
			DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->colour, (clicked) ? FR_LOWERED : FR_NONE);
 

	
 
@@ -408,13 +408,13 @@ void Window::DrawWidgets() const
 
		}
 

	
 
		case WWT_FRAME: {
 
			const StringID str = wi->data;
 
			int x2 = r.left; // by default the left side is the left side of the widget
 

	
 
			if (str != STR_NULL) x2 = DrawString(r.left + 6, r.right - 6, r.top, str, TC_FROMSTRING);
 
			if (str != STR_NULL) x2 = DrawString(r.left + 6, r.right - 6, r.top, str);
 

	
 
			int c1 = _colour_gradient[wi->colour][3];
 
			int c2 = _colour_gradient[wi->colour][7];
 

	
 
			if (_dynlang.text_dir == TD_LTR) {
 
				/* Line from upper left corner to start of text */
0 comments (0 inline, 0 general)