@ -766,36 +766,50 @@ public:
CargoSuffix cargo_suffix [ 3 ] ;
CargoSuffix cargo_suffix [ 3 ] ;
GetAllCargoSuffixes ( 0 , CST_VIEW , i , i - > type , ind , i - > accepts_cargo , cargo_suffix ) ;
GetAllCargoSuffixes ( 0 , CST_VIEW , i , i - > type , ind , i - > accepts_cargo , cargo_suffix ) ;
if ( HasBit ( ind - > callback_mask , CBM_IND_PRODUCTION_CARGO_ARRIVAL ) | | HasBit ( ind - > callback_mask , CBM_IND_PRODUCTION_256_TICKS ) ) {
bool stockpiling = HasBit ( ind - > callback_mask , CBM_IND_PRODUCTION_CARGO_ARRIVAL ) | | HasBit ( ind - > callback_mask , CBM_IND_PRODUCTION_256_TICKS ) ;
uint left_side = left + WD_FRAMERECT_LEFT * 4 ; // Indent accepted cargoes.
for ( byte j = 0 ; j < lengthof ( i - > accepts_cargo ) ; j + + ) {
for ( byte j = 0 ; j < lengthof ( i - > accepts_cargo ) ; j + + ) {
if ( i - > accepts_cargo [ j ] = = CT_INVALID ) continue ;
if ( i - > accepts_cargo [ j ] = = CT_INVALID ) continue ;
has_accept = true ;
has_accept = true ;
if ( first ) {
if ( first ) {
DrawString ( left + WD_FRAMERECT_LEFT , right - WD_FRAMERECT_RIGHT , y , STR_INDUSTRY_VIEW_ WAITING_FOR_PROCESSING ) ;
DrawString ( left + WD_FRAMERECT_LEFT , right - WD_FRAMERECT_RIGHT , y , STR_INDUSTRY_VIEW_ REQUIRES ) ;
y + = FONT_HEIGHT_NORMAL ;
y + = FONT_HEIGHT_NORMAL ;
first = false ;
first = false ;
}
}
switch ( cargo_suffix [ j ] . display ) {
case CSD_CARGO_AMOUNT :
if ( stockpiling ) {
SetDParam ( 0 , i - > accepts_cargo [ j ] ) ;
SetDParam ( 0 , i - > accepts_cargo [ j ] ) ;
SetDParam ( 1 , i - > incoming_cargo_waiting [ j ] ) ;
SetDParam ( 1 , i - > incoming_cargo_waiting [ j ] ) ;
SetDParamStr ( 2 , cargo_suffix [ j ] . text ) ;
DrawString ( left_side , right - WD_FRAMERECT_RIGHT , y , STR_INDUSTRY_VIEW_ACCEPT_CARGO_AMOUNT ) ;
DrawString ( left + WD_FRAMETEXT_LEFT , right - WD_FRAMERECT_RIGHT , y , STR_INDUSTRY_VIEW_WAITING_STOCKPILE_CARGO ) ;
break ;
y + = FONT_HEIGHT_NORMAL ;
}
}
} else {
/* FALL THROUGH */
StringID str = STR_INDUSTRY_VIEW_REQUIRES_CARGO ;
byte p = 0 ;
case CSD_CARGO :
for ( byte j = 0 ; j < lengthof ( i - > accepts_cargo ) ; j + + ) {
SetDParam ( 0 , CargoSpec : : Get ( i - > accepts_cargo [ j ] ) - > name ) ;
if ( i - > accepts_cargo [ j ] = = CT_INVALID ) continue ;
DrawString ( left_side , right - WD_FRAMERECT_RIGHT , y , STR_INDUSTRY_VIEW_ACCEPT_CARGO ) ;
has_accept = true ;
break ;
if ( p > 0 ) str + + ;
SetDParam ( p + + , CargoSpec : : Get ( i - > accepts_cargo [ j ] ) - > name ) ;
case CSD_CARGO_TEXT :
SetDParamStr ( p + + , cargo_suffix [ j ] . text ) ;
SetDParam ( 0 , CargoSpec : : Get ( i - > accepts_cargo [ j ] ) - > name ) ;
SetDParamStr ( 1 , cargo_suffix [ j ] . text ) ;
DrawString ( left_side , right - WD_FRAMERECT_RIGHT , y , STR_INDUSTRY_VIEW_ACCEPT_CARGO_TEXT ) ;
break ;
case CSD_CARGO_AMOUNT_TEXT :
SetDParam ( 0 , i - > accepts_cargo [ j ] ) ;
SetDParam ( 1 , i - > incoming_cargo_waiting [ j ] ) ;
SetDParamStr ( 2 , cargo_suffix [ j ] . text ) ;
DrawString ( left_side , right - WD_FRAMERECT_RIGHT , y , STR_INDUSTRY_VIEW_ACCEPT_CARGO_AMOUNT_TEXT ) ;
break ;
default :
NOT_REACHED ( ) ;
}
}
if ( has_accept ) {
DrawString ( left + WD_FRAMERECT_LEFT , right - WD_FRAMERECT_RIGHT , y , str ) ;
y + = FONT_HEIGHT_NORMAL ;
y + = FONT_HEIGHT_NORMAL ;
}
}
}
GetAllCargoSuffixes ( 3 , CST_VIEW , i , i - > type , ind , i - > produced_cargo , cargo_suffix ) ;
GetAllCargoSuffixes ( 3 , CST_VIEW , i , i - > type , ind , i - > produced_cargo , cargo_suffix ) ;
first = true ;
first = true ;