37 case WE_PAINT: |
37 case WE_PAINT: |
38 DrawWindowWidgets(w); |
38 DrawWindowWidgets(w); |
39 if (_thd.place_mode == 1 && _thd.window_class == WC_BUILD_INDUSTRY) { |
39 if (_thd.place_mode == 1 && _thd.window_class == WC_BUILD_INDUSTRY) { |
40 int ind_type = _build_industry_types[_opt_ptr->landscape][WP(w, def_d).data_1]; |
40 int ind_type = _build_industry_types[_opt_ptr->landscape][WP(w, def_d).data_1]; |
41 |
41 |
42 SetDParam(0, (_eco->GetPrice(CEconomy::BUILD_INDUSTRY) >> 5) * GetIndustrySpec(ind_type)->cost_multiplier); |
42 SetDParam(0, (_eco->GetPrice(CEconomy::BUILD_INDUSTRY) >> 8) * GetIndustrySpec(ind_type)->cost_multiplier); |
43 DrawStringCentered(85, w->height - 21, STR_482F_COST, 0); |
43 DrawStringCentered(85, w->height - 21, STR_482F_COST, 0); |
44 } |
44 } |
45 break; |
45 break; |
46 |
46 |
47 case WE_CLICK: { |
47 case WE_CLICK: { |
324 |
324 |
325 if (ind->produced_cargo[0] != CT_INVALID) { |
325 if (ind->produced_cargo[0] != CT_INVALID) { |
326 DrawString(2, 117, STR_482A_PRODUCTION_LAST_MONTH, 0); |
326 DrawString(2, 117, STR_482A_PRODUCTION_LAST_MONTH, 0); |
327 |
327 |
328 SetDParam(0, ind->produced_cargo[0]); |
328 SetDParam(0, ind->produced_cargo[0]); |
329 SetDParam(1, i->total_production[0]); |
329 SetDParam(1, i->last_month_production[0]); |
330 |
330 |
331 SetDParam(2, i->pct_transported[0] * 100 >> 8); |
331 SetDParam(2, i->last_month_pct_transported[0] * 100 >> 8); |
332 DrawString(4 + (IsProductionAlterable(i) ? 30 : 0), 127, STR_482B_TRANSPORTED, 0); |
332 DrawString(4 + (IsProductionAlterable(i) ? 30 : 0), 127, STR_482B_TRANSPORTED, 0); |
333 /* Let's put out those buttons.. */ |
333 /* Let's put out those buttons.. */ |
334 if (IsProductionAlterable(i)) { |
334 if (IsProductionAlterable(i)) { |
335 DrawArrowButtons(5, 127, 3, (WP(w, vp2_d).data_2 == 1) ? WP(w, vp2_d).data_3 : 0, |
335 DrawArrowButtons(5, 127, 3, (WP(w, vp2_d).data_2 == 1) ? WP(w, vp2_d).data_3 : 0, |
336 !isProductionMinimum(i, 0), !isProductionMaximum(i, 0)); |
336 !isProductionMinimum(i, 0), !isProductionMaximum(i, 0)); |
337 } |
337 } |
338 |
338 |
339 if (ind->produced_cargo[1] != CT_INVALID) { |
339 if (ind->produced_cargo[1] != CT_INVALID) { |
340 SetDParam(0, ind->produced_cargo[1]); |
340 SetDParam(0, ind->produced_cargo[1]); |
341 SetDParam(1, i->total_production[1]); |
341 SetDParam(1, i->last_month_production[1]); |
342 SetDParam(2, i->pct_transported[1] * 100 >> 8); |
342 SetDParam(2, i->last_month_pct_transported[1] * 100 >> 8); |
343 DrawString(4 + (IsProductionAlterable(i) ? 30 : 0), 137, STR_482B_TRANSPORTED, 0); |
343 DrawString(4 + (IsProductionAlterable(i) ? 30 : 0), 137, STR_482B_TRANSPORTED, 0); |
344 /* Let's put out those buttons.. */ |
344 /* Let's put out those buttons.. */ |
345 if (IsProductionAlterable(i)) { |
345 if (IsProductionAlterable(i)) { |
346 DrawArrowButtons(5, 137, 3, (WP(w, vp2_d).data_2 == 2) ? WP(w, vp2_d).data_3 : 0, |
346 DrawArrowButtons(5, 137, 3, (WP(w, vp2_d).data_2 == 2) ? WP(w, vp2_d).data_3 : 0, |
347 !isProductionMinimum(i, 1), !isProductionMaximum(i, 1)); |
347 !isProductionMinimum(i, 1), !isProductionMaximum(i, 1)); |
616 const IndustrySpec *ind = GetIndustrySpec(i->type); |
616 const IndustrySpec *ind = GetIndustrySpec(i->type); |
617 |
617 |
618 SetDParam(0, i->index); |
618 SetDParam(0, i->index); |
619 if (ind->produced_cargo[0] != CT_INVALID) { |
619 if (ind->produced_cargo[0] != CT_INVALID) { |
620 SetDParam(1, ind->produced_cargo[0]); |
620 SetDParam(1, ind->produced_cargo[0]); |
621 SetDParam(2, i->total_production[0]); |
621 SetDParam(2, i->last_month_production[0]); |
622 |
622 |
623 if (ind->produced_cargo[1] != CT_INVALID) { |
623 if (ind->produced_cargo[1] != CT_INVALID) { |
624 SetDParam(3, ind->produced_cargo[1]); |
624 SetDParam(3, ind->produced_cargo[1]); |
625 SetDParam(4, i->total_production[1]); |
625 SetDParam(4, i->last_month_production[1]); |
626 SetDParam(5, i->pct_transported[0] * 100 >> 8); |
626 SetDParam(5, i->last_month_pct_transported[0] * 100 >> 8); |
627 SetDParam(6, i->pct_transported[1] * 100 >> 8); |
627 SetDParam(6, i->last_month_pct_transported[1] * 100 >> 8); |
628 DrawString(4, 28 + n * 10, STR_INDUSTRYDIR_ITEM_TWO, 0); |
628 DrawString(4, 28 + n * 10, STR_INDUSTRYDIR_ITEM_TWO, 0); |
629 } else { |
629 } else { |
630 SetDParam(3, i->pct_transported[0] * 100 >> 8); |
630 SetDParam(3, i->last_month_pct_transported[0] * 100 >> 8); |
631 DrawString(4, 28 + n * 10, STR_INDUSTRYDIR_ITEM, 0); |
631 DrawString(4, 28 + n * 10, STR_INDUSTRYDIR_ITEM, 0); |
632 } |
632 } |
633 } else { |
633 } else { |
634 DrawString(4, 28 + n * 10, STR_INDUSTRYDIR_ITEM_NOPROD, 0); |
634 DrawString(4, 28 + n * 10, STR_INDUSTRYDIR_ITEM_NOPROD, 0); |
635 } |
635 } |