misc_gui.c
changeset 4000 4009d092b306
parent 3890 e04bc34bc50c
child 4077 d4d440dd8925
equal deleted inserted replaced
3999:69dfaadb5c3c 4000:4009d092b306
   157 	lid.td.build_date = 0;
   157 	lid.td.build_date = 0;
   158 
   158 
   159 	GetAcceptedCargo(tile, lid.ac);
   159 	GetAcceptedCargo(tile, lid.ac);
   160 	GetTileDesc(tile, &lid.td);
   160 	GetTileDesc(tile, &lid.td);
   161 
   161 
   162 		#if defined(_DEBUG)
   162 #if defined(_DEBUG)
   163 		# define LANDINFOD_LEVEL 0
   163 #	define LANDINFOD_LEVEL 0
   164 		#else
   164 #else
   165 		# define LANDINFOD_LEVEL 1
   165 #	define LANDINFOD_LEVEL 1
   166 		#endif
   166 #endif
   167 		DEBUG(misc, LANDINFOD_LEVEL) ("TILE: %#x (%i,%i)", tile, TileX(tile), TileY(tile));
   167 	DEBUG(misc, LANDINFOD_LEVEL) ("TILE: %#x (%i,%i)", tile, TileX(tile), TileY(tile));
   168 		DEBUG(misc, LANDINFOD_LEVEL) ("type_height  = %#x", _m[tile].type_height);
   168 	DEBUG(misc, LANDINFOD_LEVEL) ("type_height  = %#x", _m[tile].type_height);
   169 		DEBUG(misc, LANDINFOD_LEVEL) ("m1           = %#x", _m[tile].m1);
   169 	DEBUG(misc, LANDINFOD_LEVEL) ("m1           = %#x", _m[tile].m1);
   170 		DEBUG(misc, LANDINFOD_LEVEL) ("m2           = %#x", _m[tile].m2);
   170 	DEBUG(misc, LANDINFOD_LEVEL) ("m2           = %#x", _m[tile].m2);
   171 		DEBUG(misc, LANDINFOD_LEVEL) ("m3           = %#x", _m[tile].m3);
   171 	DEBUG(misc, LANDINFOD_LEVEL) ("m3           = %#x", _m[tile].m3);
   172 		DEBUG(misc, LANDINFOD_LEVEL) ("m4           = %#x", _m[tile].m4);
   172 	DEBUG(misc, LANDINFOD_LEVEL) ("m4           = %#x", _m[tile].m4);
   173 		DEBUG(misc, LANDINFOD_LEVEL) ("m5           = %#x", _m[tile].m5);
   173 	DEBUG(misc, LANDINFOD_LEVEL) ("m5           = %#x", _m[tile].m5);
   174 		DEBUG(misc, LANDINFOD_LEVEL) ("extra        = %#x", _m[tile].extra);
   174 	DEBUG(misc, LANDINFOD_LEVEL) ("extra        = %#x", _m[tile].extra);
   175 		#undef LANDINFOD_LEVEL
   175 #undef LANDINFOD_LEVEL
   176 }
   176 }
   177 
   177 
   178 void PlaceLandBlockInfo(void)
   178 void PlaceLandBlockInfo(void)
   179 {
   179 {
   180 	if (_cursor.sprite == SPR_CURSOR_QUERY) {
   180 	if (_cursor.sprite == SPR_CURSOR_QUERY) {
   728 
   728 
   729 
   729 
   730 void UnclickSomeWindowButtons(Window *w, uint32 mask)
   730 void UnclickSomeWindowButtons(Window *w, uint32 mask)
   731 {
   731 {
   732 	uint32 x = w->click_state & mask;
   732 	uint32 x = w->click_state & mask;
   733 	int i = 0;
   733 	uint i = 0;
       
   734 
   734 	w->click_state ^= x;
   735 	w->click_state ^= x;
   735 	do {
   736 	do {
   736 		if (x & 1) InvalidateWidget(w, i);
   737 		if (x & 1) InvalidateWidget(w, i);
   737 	} while (i++, x >>= 1);
   738 	} while (i++, x >>= 1);
   738 }
   739 }
  1249 		}
  1250 		}
  1250 		break;
  1251 		break;
  1251 		}
  1252 		}
  1252 
  1253 
  1253 	case WE_PAINT: {
  1254 	case WE_PAINT: {
  1254 		int y,pos;
  1255 		int pos;
  1255 		const FiosItem *item;
  1256 		int y;
  1256 
  1257 
  1257 		SetVScrollCount(w, _fios_num);
  1258 		SetVScrollCount(w, _fios_num);
  1258 		DrawWindowWidgets(w);
  1259 		DrawWindowWidgets(w);
  1259 		DrawFiosTexts(w->width);
  1260 		DrawFiosTexts(w->width);
  1260 
  1261 
  1269 			_savegame_sort_order & SORT_BY_NAME ? w->widget[2].right - 9 : w->widget[3].right - 9,
  1270 			_savegame_sort_order & SORT_BY_NAME ? w->widget[2].right - 9 : w->widget[3].right - 9,
  1270 			15, 16
  1271 			15, 16
  1271 		);
  1272 		);
  1272 
  1273 
  1273 		y = w->widget[7].top + 1;
  1274 		y = w->widget[7].top + 1;
  1274 		pos = w->vscroll.pos;
  1275 		for (pos = w->vscroll.pos; pos < _fios_num; pos++) {
  1275 		while (pos < _fios_num) {
  1276 			const FiosItem* item = _fios_list + pos;
  1276 			item = _fios_list + pos;
  1277 
  1277 			DoDrawStringTruncated(item->title, 4, y, _fios_colors[item->type], w->width - 18);
  1278 			DoDrawStringTruncated(item->title, 4, y, _fios_colors[item->type], w->width - 18);
  1278 			pos++;
       
  1279 			y += 10;
  1279 			y += 10;
  1280 			if (y >= w->vscroll.cap * 10 + w->widget[7].top + 1) break;
  1280 			if (y >= w->vscroll.cap * 10 + w->widget[7].top + 1) break;
  1281 		}
  1281 		}
  1282 
  1282 
  1283 		if (_saveload_mode == SLD_SAVE_GAME || _saveload_mode == SLD_SAVE_SCENARIO) {
  1283 		if (_saveload_mode == SLD_SAVE_GAME || _saveload_mode == SLD_SAVE_SCENARIO) {
  1284 			DrawEditBox(w, &WP(w,querystr_d), 10);
  1284 			DrawEditBox(w, &WP(w,querystr_d), 10);
  1285 		}
  1285 		}
  1286 		break;
  1286 		break;
  1287 	}
  1287 	}
       
  1288 
  1288 	case WE_CLICK:
  1289 	case WE_CLICK:
  1289 		switch (e->click.widget) {
  1290 		switch (e->click.widget) {
  1290 		case 2: /* Sort save names by name */
  1291 		case 2: /* Sort save names by name */
  1291 			_savegame_sort_order = (_savegame_sort_order == SORT_BY_NAME) ?
  1292 			_savegame_sort_order = (_savegame_sort_order == SORT_BY_NAME) ?
  1292 				SORT_BY_NAME | SORT_DESCENDING : SORT_BY_NAME;
  1293 				SORT_BY_NAME | SORT_DESCENDING : SORT_BY_NAME;