File diff r12404:d58b2d050240 → r12405:ba094e765533
src/industry_gui.cpp
Show inline comments
 
@@ -252,39 +252,39 @@ public:
 
			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;
 
		SetDParam(0, STR_JUST_NOTHING);
 
		SetDParam(1, STR_EMPTY);
 
		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++, CargoSpec::Get(indsp->accepts_cargo[j])->name);
 
			SetDParam(p++, GetCargoSuffix(j, CST_FUND, NULL, this->selected_type, indsp));
 
		}
 
		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);
 
		SetDParam(1, STR_EMPTY);
 
		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++, CargoSpec::Get(indsp->produced_cargo[j])->name);
 
			SetDParam(p++, GetCargoSuffix(j + 3, CST_FUND, NULL, this->selected_type, indsp));
 
		}
 
		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);
 
				if (callback_res != CALLBACK_FAILED) {  // Did it failed?
 
					StringID newtxt = GetGRFStringID(indsp->grf_prop.grffile->grfid, 0xD000 + callback_res);  // No. here's the new string
 
					this->text[this->selected_index] = newtxt;   // Store it for further usage
 
@@ -513,25 +513,25 @@ public:
 
				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);
 
				y += 10;
 
			}
 
		} else {
 
			StringID str = STR_INDUSTRY_VIEW_REQUIRES_CARGO;
 
			byte p = 0;
 
			for (byte j = 0; j < lengthof(i->accepts_cargo); j++) {
 
				if (i->accepts_cargo[j] == CT_INVALID) continue;
 
				has_accept = true;
 
				if (p > 0) str++;
 
				SetDParam(p++, GetCargo(i->accepts_cargo[j])->name);
 
				SetDParam(p++, CargoSpec::Get(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);
 
				y += 10;
 
			}
 
		}
 

	
 
		first = true;
 
		for (byte j = 0; j < lengthof(i->produced_cargo); j++) {
 
			if (i->produced_cargo[j] == CT_INVALID) continue;
 
			if (first) {