src/misc_gui.cpp
changeset 5919 2b58160d667d
parent 5890 45bd89352147
child 5977 8a8c35b46e8d
equal deleted inserted replaced
5918:602e158900a2 5919:2b58160d667d
   191 {
   191 {
   192 	if (_cursor.sprite == SPR_CURSOR_QUERY) {
   192 	if (_cursor.sprite == SPR_CURSOR_QUERY) {
   193 		ResetObjectToPlace();
   193 		ResetObjectToPlace();
   194 	} else {
   194 	} else {
   195 		_place_proc = Place_LandInfo;
   195 		_place_proc = Place_LandInfo;
   196 		SetObjectToPlace(SPR_CURSOR_QUERY, 1, 1, 0);
   196 		SetObjectToPlace(SPR_CURSOR_QUERY, PAL_NONE, 1, 1, 0);
   197 	}
   197 	}
   198 }
   198 }
   199 
   199 
   200 static const char *credits[] = {
   200 static const char *credits[] = {
   201 	/*************************************************************************
   201 	/*************************************************************************
   306 	AllocateWindowDesc(&_about_desc);
   306 	AllocateWindowDesc(&_about_desc);
   307 }
   307 }
   308 
   308 
   309 static int _tree_to_plant;
   309 static int _tree_to_plant;
   310 
   310 
   311 static const uint32 _tree_sprites[] = {
   311 static const PalSpriteID _tree_sprites[] = {
   312 	0x655, 0x663, 0x678, 0x62B, 0x647, 0x639, 0x64E, 0x632, 0x67F, 0x68D, 0x69B, 0x6A9,
   312 	{ 0x655, PAL_NONE }, { 0x663, PAL_NONE }, { 0x678, PAL_NONE }, { 0x62B, PAL_NONE },
   313 	0x6AF, 0x6D2, 0x6D9, 0x6C4, 0x6CB, 0x6B6, 0x6BD, 0x6E0,
   313 	{ 0x647, PAL_NONE }, { 0x639, PAL_NONE }, { 0x64E, PAL_NONE }, { 0x632, PAL_NONE },
   314 	0x72E, 0x734, 0x74A, 0x74F, 0x76B, 0x78F, 0x788, 0x77B, 0x75F, 0x774, 0x720, 0x797,
   314 	{ 0x67F, PAL_NONE }, { 0x68D, PAL_NONE }, { 0x69B, PAL_NONE }, { 0x6A9, PAL_NONE },
   315 	0x79E, 0x7A5 | PALETTE_TO_GREEN, 0x7AC | PALETTE_TO_RED, 0x7B3, 0x7BA, 0x7C1 | PALETTE_TO_RED, 0x7C8 | PALETTE_TO_PALE_GREEN, 0x7CF | PALETTE_TO_YELLOW, 0x7D6 | PALETTE_TO_RED
   315 	{ 0x6AF, PAL_NONE }, { 0x6D2, PAL_NONE }, { 0x6D9, PAL_NONE }, { 0x6C4, PAL_NONE },
       
   316 	{ 0x6CB, PAL_NONE }, { 0x6B6, PAL_NONE }, { 0x6BD, PAL_NONE }, { 0x6E0, PAL_NONE },
       
   317 	{ 0x72E, PAL_NONE }, { 0x734, PAL_NONE }, { 0x74A, PAL_NONE }, { 0x74F, PAL_NONE },
       
   318 	{ 0x76B, PAL_NONE }, { 0x78F, PAL_NONE }, { 0x788, PAL_NONE }, { 0x77B, PAL_NONE },
       
   319 	{ 0x75F, PAL_NONE }, { 0x774, PAL_NONE }, { 0x720, PAL_NONE }, { 0x797, PAL_NONE },
       
   320 	{ 0x79E, PAL_NONE }, { 0x7A5, PALETTE_TO_GREEN }, { 0x7AC, PALETTE_TO_RED }, { 0x7B3, PAL_NONE },
       
   321 	{ 0x7BA, PAL_NONE }, { 0x7C1, PALETTE_TO_RED, }, { 0x7C8, PALETTE_TO_PALE_GREEN }, { 0x7CF, PALETTE_TO_YELLOW }, { 0x7D6, PALETTE_TO_RED }
   316 };
   322 };
   317 
   323 
   318 static void BuildTreesWndProc(Window *w, WindowEvent *e)
   324 static void BuildTreesWndProc(Window *w, WindowEvent *e)
   319 {
   325 {
   320 	switch (e->event) {
   326 	switch (e->event) {
   328 		WP(w,tree_d).count = count = _tree_count_by_landscape[_opt.landscape];
   334 		WP(w,tree_d).count = count = _tree_count_by_landscape[_opt.landscape];
   329 
   335 
   330 		x = 18;
   336 		x = 18;
   331 		y = 54;
   337 		y = 54;
   332 		do {
   338 		do {
   333 			DrawSprite(_tree_sprites[i], x, y);
   339 			DrawSprite(_tree_sprites[i].sprite, _tree_sprites[i].pal, x, y);
   334 			x += 35;
   340 			x += 35;
   335 			if (!(++i & 3)) {
   341 			if (!(++i & 3)) {
   336 				x -= 35 * 4;
   342 				x -= 35 * 4;
   337 				y += 47;
   343 				y += 47;
   338 			}
   344 			}
  1617 
  1623 
  1618 	Window *w;
  1624 	Window *w;
  1619 	const WindowDesc *sld = &_save_dialog_desc;
  1625 	const WindowDesc *sld = &_save_dialog_desc;
  1620 
  1626 
  1621 
  1627 
  1622 	SetObjectToPlace(SPR_CURSOR_ZZZ, 0, 0, 0);
  1628 	SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, 0, 0, 0);
  1623 	DeleteWindowById(WC_QUERY_STRING, 0);
  1629 	DeleteWindowById(WC_QUERY_STRING, 0);
  1624 	DeleteWindowById(WC_SAVELOAD, 0);
  1630 	DeleteWindowById(WC_SAVELOAD, 0);
  1625 
  1631 
  1626 	_saveload_mode = mode;
  1632 	_saveload_mode = mode;
  1627 	SETBIT(_no_scroll, SCROLL_SAVE);
  1633 	SETBIT(_no_scroll, SCROLL_SAVE);
  1800 		y = 45;
  1806 		y = 45;
  1801 
  1807 
  1802 		for (i = 0; i != lengthof(_cheats_ui); i++) {
  1808 		for (i = 0; i != lengthof(_cheats_ui); i++) {
  1803 			const CheatEntry *ce = &_cheats_ui[i];
  1809 			const CheatEntry *ce = &_cheats_ui[i];
  1804 
  1810 
  1805 			DrawSprite((*ce->been_used) ? SPR_BOX_CHECKED : SPR_BOX_EMPTY, x + 5, y + 2);
  1811 			DrawSprite((*ce->been_used) ? SPR_BOX_CHECKED : SPR_BOX_EMPTY, PAL_NONE, x + 5, y + 2);
  1806 
  1812 
  1807 			switch (ce->type) {
  1813 			switch (ce->type) {
  1808 			case SLE_BOOL: {
  1814 			case SLE_BOOL: {
  1809 				bool on = (*(bool*)ce->variable);
  1815 				bool on = (*(bool*)ce->variable);
  1810 
  1816