(svn r6908) - Codechange: Modify DrawStringMultiLine() to return the number of pixel lines used, and use it for drawing NewGRF additional text (mart3p)

This commit is contained in:
peter1138
2006-10-23 18:13:24 +00:00
parent ba60e4ac34
commit 61611711e3
4 changed files with 11 additions and 7 deletions

View File

@@ -482,13 +482,14 @@ void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order)
}
/* Display additional text from NewGRF in the purchase information window */
int ShowAdditionalText(int x, int y, int w, EngineID engine)
uint ShowAdditionalText(int x, int y, int w, EngineID engine)
{
uint16 callback = GetVehicleCallback(CBID_VEHICLE_ADDITIONAL_TEXT, 0, 0, engine, NULL);
if (callback == CALLBACK_FAILED) return 0;
DrawStringTruncated(x, y, GetGRFStringID(GetEngineGRFID(engine), 0xD000 + callback), 16, w);
return 10;
// STR_02BD is used to start the string with {BLACK}
SetDParam(0, GetGRFStringID(GetEngineGRFID(engine), 0xD000 + callback));
return DrawStringMultiLine(x, y, STR_02BD, w);
}