settings_gui.c
changeset 1938 70baf462aff1
parent 1891 862800791170
child 2008 cdb444f6d43c
equal deleted inserted replaced
1937:8497de87e4a2 1938:70baf462aff1
   840 			// We do not allow changes of some items when we are a client in a networkgame
   840 			// We do not allow changes of some items when we are a client in a networkgame
   841 			if (!(pe->flags & PF_PLAYERBASED) && _networking && !_network_server)
   841 			if (!(pe->flags & PF_PLAYERBASED) && _networking && !_network_server)
   842 				editable = false;
   842 				editable = false;
   843 			if (pe->type == PE_BOOL) {
   843 			if (pe->type == PE_BOOL) {
   844 				if (editable)
   844 				if (editable)
   845 					DrawFrameRect(x+5, y+1, x+15+9, y+9, (*(bool*)pe->variable)?6:4, (*(bool*)pe->variable)?0x20:0);
   845 					DrawFrameRect(x+5, y+1, x+15+9, y+9, (*(bool*)pe->variable) ? 6 : 4, (*(bool*)pe->variable) ? FR_LOWERED : 0);
   846 				else
   846 				else
   847 					DrawFrameRect(x+5, y+1, x+15+9, y+9, (*(bool*)pe->variable)?7:9, (*(bool*)pe->variable)?0x20:0);
   847 					DrawFrameRect(x+5, y+1, x+15+9, y+9, (*(bool*)pe->variable) ? 7 : 9, (*(bool*)pe->variable) ? FR_LOWERED : 0);
   848 				SetDParam(0, *(bool*)pe->variable ? STR_CONFIG_PATCHES_ON : STR_CONFIG_PATCHES_OFF);
   848 				SetDParam(0, *(bool*)pe->variable ? STR_CONFIG_PATCHES_ON : STR_CONFIG_PATCHES_OFF);
   849 			} else {
   849 			} else {
   850 				DrawFrameRect(x+5, y+1, x+5+9, y+9, 3, clk == i*2+1 ? 0x20 : 0);
   850 				DrawFrameRect(x+5, y+1, x+5+9, y+9, 3, clk == i*2+1 ? FR_LOWERED : 0);
   851 				DrawFrameRect(x+15, y+1, x+15+9, y+9, 3, clk == i*2+2 ? 0x20 : 0);
   851 				DrawFrameRect(x+15, y+1, x+15+9, y+9, 3, clk == i*2+2 ? FR_LOWERED : 0);
   852 				if (!editable) {
   852 				if (!editable) {
   853 					int color = 0x8000 | _color_list[3].unk2;
   853 					int color = 0x8000 | _color_list[3].unk2;
   854 					GfxFillRect(x+6, y+2, x+6+8, y+9, color);
   854 					GfxFillRect(x+6, y+2, x+6+8, y+9, color);
   855 					GfxFillRect(x+16, y+2, x+16+8, y+9, color);
   855 					GfxFillRect(x+16, y+2, x+16+8, y+9, color);
   856 				}
   856 				}
  1292 }
  1292 }
  1293 
  1293 
  1294 /* state: 0 = none clicked, 0x01 = first clicked, 0x02 = second clicked */
  1294 /* state: 0 = none clicked, 0x01 = first clicked, 0x02 = second clicked */
  1295 void DrawArrowButtons(int x, int y, int state)
  1295 void DrawArrowButtons(int x, int y, int state)
  1296 {
  1296 {
  1297 	DrawFrameRect(x, y+1, x+9, y+9, 3, (state&0x01) ? 0x20 : 0);
  1297 	DrawFrameRect(x, y+1, x+9, y+9, 3, (state & 0x01) ? FR_LOWERED : 0);
  1298 	DrawFrameRect(x+10, y+1, x+19, y+9, 3, (state&0x02) ? 0x20 : 0);
  1298 	DrawFrameRect(x+10, y+1, x+19, y+9, 3, (state & 0x02) ? FR_LOWERED : 0);
  1299 	DrawStringCentered(x+5, y+1, STR_6819, 0);
  1299 	DrawStringCentered(x+5, y+1, STR_6819, 0);
  1300 	DrawStringCentered(x+15, y+1, STR_681A, 0);
  1300 	DrawStringCentered(x+15, y+1, STR_681A, 0);
  1301 }
  1301 }
  1302 
  1302 
  1303 char _str_separator[2];
  1303 char _str_separator[2];
  1318 		x = 35;
  1318 		x = 35;
  1319 		y+=12;
  1319 		y+=12;
  1320 		i++;
  1320 		i++;
  1321 
  1321 
  1322 		// separator
  1322 		// separator
  1323 		DrawFrameRect(10, y+1, 29, y+9, 0, ((clk >> (i*2)) & 0x03)?0x20:0x00);
  1323 		DrawFrameRect(10, y+1, 29, y+9, 0, ((clk >> (i*2)) & 0x03) ? FR_LOWERED : 0);
  1324 		x = DrawString(x, y + 1, STR_CURRENCY_SEPARATOR, 0);
  1324 		x = DrawString(x, y + 1, STR_CURRENCY_SEPARATOR, 0);
  1325 		DoDrawString(_str_separator, x + 4, y + 1, 6);
  1325 		DoDrawString(_str_separator, x + 4, y + 1, 6);
  1326 		x = 35;
  1326 		x = 35;
  1327 		y+=12;
  1327 		y+=12;
  1328 		i++;
  1328 		i++;
  1329 
  1329 
  1330 		// prefix
  1330 		// prefix
  1331 		DrawFrameRect(10, y+1, 29, y+9, 0, ((clk >> (i*2)) & 0x03)?0x20:0x00);
  1331 		DrawFrameRect(10, y+1, 29, y+9, 0, ((clk >> (i*2)) & 0x03) ? FR_LOWERED : 0);
  1332 		x = DrawString(x, y + 1, STR_CURRENCY_PREFIX, 0);
  1332 		x = DrawString(x, y + 1, STR_CURRENCY_PREFIX, 0);
  1333 		DoDrawString(_currency_specs[23].prefix, x + 4, y + 1, 6);
  1333 		DoDrawString(_currency_specs[23].prefix, x + 4, y + 1, 6);
  1334 		x = 35;
  1334 		x = 35;
  1335 		y+=12;
  1335 		y+=12;
  1336 		i++;
  1336 		i++;
  1337 
  1337 
  1338 		// suffix
  1338 		// suffix
  1339 		DrawFrameRect(10, y+1, 29, y+9, 0, ((clk >> (i*2)) & 0x03)?0x20:0x00);
  1339 		DrawFrameRect(10, y+1, 29, y+9, 0, ((clk >> (i*2)) & 0x03) ? FR_LOWERED : 0);
  1340 		x = DrawString(x, y + 1, STR_CURRENCY_SUFFIX, 0);
  1340 		x = DrawString(x, y + 1, STR_CURRENCY_SUFFIX, 0);
  1341 		DoDrawString(_currency_specs[23].suffix, x + 4, y + 1, 6);
  1341 		DoDrawString(_currency_specs[23].suffix, x + 4, y + 1, 6);
  1342 		x = 35;
  1342 		x = 35;
  1343 		y+=12;
  1343 		y+=12;
  1344 		i++;
  1344 		i++;