settings_gui.c
changeset 2952 58522ed8f0f1
parent 2916 b687477adcba
child 3107 d743cfa2d832
equal deleted inserted replaced
2951:2de6d3a59743 2952:58522ed8f0f1
   897 		}
   897 		}
   898 		break;
   898 		break;
   899 	}
   899 	}
   900 
   900 
   901 	case WE_CLICK:
   901 	case WE_CLICK:
   902 		switch(e->click.widget) {
   902 		switch (e->click.widget) {
   903 		case 3: {
   903 		case 3: {
   904 			int x,y;
   904 			int x,y;
   905 			uint btn;
   905 			uint btn;
   906 			const PatchPage *page;
   906 			const PatchPage *page;
   907 			const PatchEntry *pe;
   907 			const PatchEntry *pe;
   924 				return;
   924 				return;
   925 
   925 
   926 			if (x < 21) { // clicked on the icon on the left side. Either scroller or bool on/off
   926 			if (x < 21) { // clicked on the icon on the left side. Either scroller or bool on/off
   927 				int32 val = ReadPE(pe), oval = val;
   927 				int32 val = ReadPE(pe), oval = val;
   928 
   928 
   929 				switch(pe->type) {
   929 				switch (pe->type) {
   930 				case PE_BOOL:
   930 				case PE_BOOL:
   931 					val ^= 1;
   931 					val ^= 1;
   932 					break;
   932 					break;
   933 				case PE_UINT8:
   933 				case PE_UINT8:
   934 				case PE_INT16:
   934 				case PE_INT16:
  1214 			DrawString(x + 2, 209, STR_SPEC_USERSTRING, 0x01);
  1214 			DrawString(x + 2, 209, STR_SPEC_USERSTRING, 0x01);
  1215 		}
  1215 		}
  1216 	} break;
  1216 	} break;
  1217 
  1217 
  1218 	case WE_CLICK:
  1218 	case WE_CLICK:
  1219 		switch(e->click.widget) {
  1219 		switch (e->click.widget) {
  1220 		case 3: { // select a grf file
  1220 		case 3: { // select a grf file
  1221 			int y = (e->click.pt.y - NEWGRF_WND_PROC_OFFSET_TOP_WIDGET) / NEWGRF_WND_PROC_ROWSIZE;
  1221 			int y = (e->click.pt.y - NEWGRF_WND_PROC_OFFSET_TOP_WIDGET) / NEWGRF_WND_PROC_ROWSIZE;
  1222 
  1222 
  1223 			if (y >= w->vscroll.cap) return; // click out of bounds
  1223 			if (y >= w->vscroll.cap) return; // click out of bounds
  1224 
  1224