graph_gui.c
changeset 2639 eeaefdabfdfd
parent 2482 374f6395847d
child 2656 a27063f732cc
equal deleted inserted replaced
2638:0811adaec525 2639:eeaefdabfdfd
   222 	const Player* p;
   222 	const Player* p;
   223 
   223 
   224 	switch(e->event) {
   224 	switch(e->event) {
   225 	case WE_PAINT:
   225 	case WE_PAINT:
   226 		FOR_ALL_PLAYERS(p) {
   226 		FOR_ALL_PLAYERS(p) {
   227 			if (!p->is_active)
   227 			if (!p->is_active) SETBIT(_legend_excludebits, p->index);
   228 				SETBIT(_legend_excludebits, p->index);
   228 		}
   229 		}
   229 		w->click_state = (~_legend_excludebits) << 3;
   230 		w->click_state = ((~_legend_excludebits) << 3);
       
   231 		DrawWindowWidgets(w);
   230 		DrawWindowWidgets(w);
   232 
   231 
   233 		FOR_ALL_PLAYERS(p) {
   232 		FOR_ALL_PLAYERS(p) {
   234 			if (!p->is_active)
   233 			if (!p->is_active) continue;
   235 				continue;
       
   236 
   234 
   237 			DrawPlayerIcon(p->index, 4, 18+p->index*12);
   235 			DrawPlayerIcon(p->index, 4, 18+p->index*12);
   238 
   236 
   239 			SetDParam(0, p->name_1);
   237 			SetDParam(0, p->name_1);
   240 			SetDParam(1, p->name_2);
   238 			SetDParam(1, p->name_2);
   243 		}
   241 		}
   244 		break;
   242 		break;
   245 
   243 
   246 	case WE_CLICK:
   244 	case WE_CLICK:
   247 		if (IS_INT_INSIDE(e->click.widget, 3, 11)) {
   245 		if (IS_INT_INSIDE(e->click.widget, 3, 11)) {
   248 			_legend_excludebits ^= (1 << (e->click.widget-3));
   246 			_legend_excludebits ^= (1 << (e->click.widget - 3));
   249 			SetWindowDirty(w);
   247 			SetWindowDirty(w);
   250 			InvalidateWindow(WC_INCOME_GRAPH, 0);
   248 			InvalidateWindow(WC_INCOME_GRAPH, 0);
   251 			InvalidateWindow(WC_OPERATING_PROFIT, 0);
   249 			InvalidateWindow(WC_OPERATING_PROFIT, 0);
   252 			InvalidateWindow(WC_DELIVERED_CARGO, 0);
   250 			InvalidateWindow(WC_DELIVERED_CARGO, 0);
   253 			InvalidateWindow(WC_PERFORMANCE_HISTORY, 0);
   251 			InvalidateWindow(WC_PERFORMANCE_HISTORY, 0);