File diff r1018:9c1834908677 → r1019:90da3857ff29
main_gui.c
Show inline comments
 
@@ -1089,25 +1089,25 @@ static void AskResetLandscapeWndProc(Win
 
	case WE_PAINT:
 
		DrawWindowWidgets(w);
 
		DrawStringMultiCenter(90, 38, mode?STR_022D_ARE_YOU_SURE_YOU_WANT_TO:STR_GENERATE_RANDOM_LANDSCAPE , 168);
 
	case WE_CLICK:
 
		switch(e->click.widget) {
 
		case 3:
 
			DeleteWindow(w);
 
			break;
 
		case 4:
 
			DeleteWindow(w);
 
			DeleteWindowByClass(WC_INDUSTRY_VIEW);
 
			DeleteWindowByClass(WC_TOWN_VIEW);
 
			DeleteWindowByClass(WC_LAND_INFO);			
 
			DeleteWindowByClass(WC_LAND_INFO);
 

	
 
			if (mode) { // reset landscape
 
				ResetLandscape();
 
			} else { // make random landscape
 
				SndPlayFx(SND_15_BEEP);
 
				_switch_mode = SM_GENRANDLAND;
 
			}
 

	
 
			break;
 
		}
 
	}
 
}
 
@@ -1255,25 +1255,25 @@ static const int8 _multi_terraform_coord
 
	{-12,  0},{ -8, -2},{ -4, -4},{  0, -6},{  4, -4},{  8, -2},{ 12,  0},
 
	{-16,  2},{-12,  4},{ -8,  6},{ -4,  8},{  0, 10},{  4,  8},{  8,  6},{ 12,  4},{ 16,  2},
 
	{-20,  0},{-16, -2},{-12, -4},{ -8, -6},{ -4, -8},{  0,-10},{  4, -8},{  8, -6},{ 12, -4},{ 16, -2},{ 20,  0},
 
	{-24,  2},{-20,  4},{-16,  6},{-12,  8},{ -8, 10},{ -4, 12},{  0, 14},{  4, 12},{  8, 10},{ 12,  8},{ 16,  6},{ 20,  4},{ 24,  2},
 
	{-28,  0},{-24, -2},{-20, -4},{-16, -6},{-12, -8},{ -8,-10},{ -4,-12},{  0,-14},{  4,-12},{  8,-10},{ 12, -8},{ 16, -6},{ 20, -4},{ 24, -2},{ 28,  0},
 
};
 

	
 
static void ScenEditLandGenWndProc(Window *w, WindowEvent *e)
 
{
 
	switch(e->event) {
 
	case WE_PAINT:
 
		// XXX - lighthouse button is widget 11!! Don't forget when changing
 
		w->widget[11].tooltips = (_opt.landscape == LT_DESERT) ? STR_028F_DEFINE_DESERT_AREA : STR_028D_PLACE_LIGHTHOUSE; 
 
		w->widget[11].tooltips = (_opt.landscape == LT_DESERT) ? STR_028F_DEFINE_DESERT_AREA : STR_028D_PLACE_LIGHTHOUSE;
 
		DrawWindowWidgets(w);
 

	
 
		{
 
			int n = _terraform_size * _terraform_size;
 
			const int8 *coords = &_multi_terraform_coords[0][0];
 

	
 
			assert(n != 0);
 
			do {
 
				DrawSprite(0xFEF, 77 + coords[0], 55 + coords[1]);
 
				coords += 2;
 
			} while (--n);
 
		}
 
@@ -2418,25 +2418,25 @@ void ShowVitalWindows(void)
 
{
 
	Window *w;
 

	
 
	w = AllocateWindowDesc(&_toolb_normal_desc);
 
	w->disabled_state = 1 << 17; // disable zoom-in button (by default game is zoomed in)
 
	CLRBITS(w->flags4, WF_WHITE_BORDER_MASK);
 

	
 
	if (_networking) { // if networking, disable fast-forward button
 
		SETBIT(w->disabled_state, 1);
 
		if (!_network_server) // if not server, disable pause button
 
			SETBIT(w->disabled_state, 0);
 
	}
 
	
 

	
 
	PositionMainToolbar(w); // already WC_MAIN_TOOLBAR passed (&_toolb_normal_desc)
 

	
 
	_main_status_desc.top = _screen.height - 12;
 
	w = AllocateWindowDesc(&_main_status_desc);
 
	CLRBITS(w->flags4, WF_WHITE_BORDER_MASK);
 

	
 
	WP(w,def_d).data_1 = -1280;
 
}
 

	
 
void GameSizeChanged()
 
{
 
	RelocateAllWindows(_screen.width, _screen.height);