industry_gui.c
changeset 4171 5c6e60c392c3
parent 3689 50a3fd4ba752
child 4192 eaf5d315891c
equal deleted inserted replaced
4170:81bafc4dd1b9 4171:5c6e60c392c3
   277 	// WP(w,vp2_d).data_2 is for the clickline
   277 	// WP(w,vp2_d).data_2 is for the clickline
   278 	// WP(w,vp2_d).data_3 is for the click pos (left or right)
   278 	// WP(w,vp2_d).data_3 is for the click pos (left or right)
   279 
   279 
   280 	switch (e->event) {
   280 	switch (e->event) {
   281 	case WE_PAINT: {
   281 	case WE_PAINT: {
   282 		const Industry* i = GetIndustry(w->window_number);
   282 		const Industry *i = GetIndustry(w->window_number);
   283 
   283 
   284 		SetDParam(0, w->window_number);
   284 		SetDParam(0, w->window_number);
   285 		DrawWindowWidgets(w);
   285 		DrawWindowWidgets(w);
   286 
   286 
   287 		if (i->accepts_cargo[0] != CT_INVALID) {
   287 		if (i->accepts_cargo[0] != CT_INVALID) {
   431 	IndustryViewWndProc
   431 	IndustryViewWndProc
   432 };
   432 };
   433 
   433 
   434 void ShowIndustryViewWindow(int industry)
   434 void ShowIndustryViewWindow(int industry)
   435 {
   435 {
   436 	Window* w = AllocateWindowDescFront(&_industry_view_desc, industry);
   436 	Window *w = AllocateWindowDescFront(&_industry_view_desc, industry);
   437 
   437 
   438 	if (w != NULL) {
   438 	if (w != NULL) {
   439 		w->flags4 |= WF_DISABLE_VP_SCROLL;
   439 		w->flags4 |= WF_DISABLE_VP_SCROLL;
   440 		WP(w,vp2_d).data_1 = 0;
   440 		WP(w,vp2_d).data_1 = 0;
   441 		WP(w,vp2_d).data_2 = 0;
   441 		WP(w,vp2_d).data_2 = 0;
   569 
   569 
   570 		p = w->vscroll.pos;
   570 		p = w->vscroll.pos;
   571 		n = 0;
   571 		n = 0;
   572 
   572 
   573 		while (p < _num_industry_sort) {
   573 		while (p < _num_industry_sort) {
   574 			const Industry* i = GetIndustry(_industry_sort[p]);
   574 			const Industry *i = GetIndustry(_industry_sort[p]);
   575 
   575 
   576 			SetDParam(0, i->index);
   576 			SetDParam(0, i->index);
   577 			if (i->produced_cargo[0] != CT_INVALID) {
   577 			if (i->produced_cargo[0] != CT_INVALID) {
   578 				SetDParam(1, _cargoc.names_long[i->produced_cargo[0]]);
   578 				SetDParam(1, _cargoc.names_long[i->produced_cargo[0]]);
   579 				SetDParam(2, i->total_production[0]);
   579 				SetDParam(2, i->total_production[0]);
   656 };
   656 };
   657 
   657 
   658 
   658 
   659 void ShowIndustryDirectory(void)
   659 void ShowIndustryDirectory(void)
   660 {
   660 {
   661 	Window* w = AllocateWindowDescFront(&_industry_directory_desc, 0);
   661 	Window *w = AllocateWindowDescFront(&_industry_directory_desc, 0);
   662 
   662 
   663 	if (w != NULL) {
   663 	if (w != NULL) {
   664 		w->vscroll.cap = 16;
   664 		w->vscroll.cap = 16;
   665 		w->resize.height = w->height - 6 * 10; // minimum 10 items
   665 		w->resize.height = w->height - 6 * 10; // minimum 10 items
   666 		w->resize.step_height = 10;
   666 		w->resize.step_height = 10;