OpenTTD
Data Structures | Functions | Variables
viewport_gui.cpp File Reference

Extra viewport window. More...

#include "stdafx.h"
#include "landscape.h"
#include "window_gui.h"
#include "viewport_func.h"
#include "strings_func.h"
#include "zoom_func.h"
#include "window_func.h"
#include "widgets/viewport_widget.h"
#include "table/strings.h"
#include "table/sprites.h"
#include "safeguards.h"

Go to the source code of this file.

Data Structures

class  ExtraViewportWindow

Functions

void ShowExtraViewPortWindow (TileIndex tile)
 Show a new Extra Viewport window.
void ShowExtraViewPortWindowForTileUnderCursor ()
 Show a new Extra Viewport window.

Variables

static const NWidgetPart _nested_extra_view_port_widgets []
static WindowDesc _extra_view_port_desc (WDP_AUTO,"extra_viewport", 300, 268, WC_EXTRA_VIEW_PORT, WC_NONE, 0, _nested_extra_view_port_widgets, lengthof(_nested_extra_view_port_widgets))

Detailed Description

Extra viewport window.

Definition in file viewport_gui.cpp.

Function Documentation

void ShowExtraViewPortWindow ( TileIndex  tile)
void ShowExtraViewPortWindowForTileUnderCursor ( )

Show a new Extra Viewport window.

Center it on the tile under the cursor, if the cursor is inside a viewport. If that fails, center it on main viewport center.

Definition at line 185 of file viewport_gui.cpp.

References INVALID_TILE, ShowExtraViewPortWindow(), and TileVirtXY().

Referenced by MainToolbarWindow::OnHotkey(), and ScenarioEditorToolbarWindow::OnHotkey().

Variable Documentation

const NWidgetPart _nested_extra_view_port_widgets[]
static
Initial value:
{
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_EV_CAPTION), SetDataTip(STR_EXTRA_VIEW_PORT_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
NWidget(WWT_PANEL, COLOUR_GREY),
NWidget(NWID_VIEWPORT, INVALID_COLOUR, WID_EV_VIEWPORT), SetPadding(2, 2, 2, 2), SetResize(1, 1), SetFill(1, 1),
NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_EV_ZOOM_IN), SetDataTip(SPR_IMG_ZOOMIN, STR_TOOLBAR_TOOLTIP_ZOOM_THE_VIEW_IN),
NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_EV_ZOOM_OUT), SetDataTip(SPR_IMG_ZOOMOUT, STR_TOOLBAR_TOOLTIP_ZOOM_THE_VIEW_OUT),
SetDataTip(STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW, STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW_TT),
SetDataTip(STR_EXTRA_VIEW_MOVE_VIEW_TO_MAIN, STR_EXTRA_VIEW_MOVE_VIEW_TO_MAIN_TT),
NWidget(WWT_PANEL, COLOUR_GREY), SetFill(1, 1), SetResize(1, 0), EndContainer(),
NWidget(WWT_RESIZEBOX, COLOUR_GREY),
}

Definition at line 28 of file viewport_gui.cpp.