File diff r11367:a13b3a453e57 → r11368:058349c3a02c
src/smallmap_gui.cpp
Show inline comments
 
@@ -1046,30 +1046,30 @@ public:
 
		this->SetDirty();
 
	}
 

	
 
	virtual void OnResize(Point new_size, Point delta)
 
	{
 
		if (delta.x != 0 && this->map_type == SMT_INDUSTRY) this->ResizeLegend();
 
	}
 
};
 

	
 
SmallMapWindow::SmallMapType SmallMapWindow::map_type = SMT_CONTOUR;
 
bool SmallMapWindow::show_towns = true;
 

	
 
static const WindowDesc _smallmap_desc = {
 
static const WindowDesc _smallmap_desc(
 
	WDP_AUTO, WDP_AUTO, 350, 214, 446, 314,
 
	WC_SMALLMAP, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_smallmap_widgets,
 
};
 
	_smallmap_widgets
 
);
 

	
 
void ShowSmallMap()
 
{
 
	AllocateWindowDescFront<SmallMapWindow>(&_smallmap_desc, 0);
 
}
 

	
 
/* Extra ViewPort Window Stuff */
 
static const Widget _extra_view_port_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_GREY,     0,    10,    0,   13, STR_00C5,                         STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,  RESIZE_RIGHT,  COLOUR_GREY,    11,   287,    0,   13, STR_EXTRA_VIEW_PORT_TITLE,        STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{  WWT_STICKYBOX,     RESIZE_LR,  COLOUR_GREY,   288,   299,    0,   13, 0x0,                              STR_STICKY_BUTTON},
 
{      WWT_PANEL,     RESIZE_RB,  COLOUR_GREY,     0,   299,   14,   33, 0x0,                              STR_NULL},
 
@@ -1188,30 +1188,30 @@ public:
 
	virtual void OnMouseWheel(int wheel)
 
	{
 
		ZoomInOrOutToCursorWindow(wheel < 0, this);
 
	}
 

	
 
	virtual void OnInvalidateData(int data = 0)
 
	{
 
		/* Only handle zoom message if intended for us (msg ZOOM_IN/ZOOM_OUT) */
 
		HandleZoomMessage(this, this->viewport, EVW_ZOOMIN, EVW_ZOOMOUT);
 
	}
 
};
 

	
 
static const WindowDesc _extra_view_port_desc = {
 
static const WindowDesc _extra_view_port_desc(
 
	WDP_AUTO, WDP_AUTO, 300, 68, 300, 268,
 
	WC_EXTRA_VIEW_PORT, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
 
	_extra_view_port_widgets,
 
};
 
	_extra_view_port_widgets
 
);
 

	
 
void ShowExtraViewPortWindow(TileIndex tile)
 
{
 
	int i = 0;
 

	
 
	/* find next free window number for extra viewport */
 
	while (FindWindowById(WC_EXTRA_VIEW_PORT, i) != NULL) i++;
 

	
 
	new ExtraViewportWindow(&_extra_view_port_desc, i, tile);
 
}
 

	
 
bool ScrollMainWindowTo(int x, int y, bool instant)