22 #include "table/strings.h" 28 static const NWidgetPart _nested_extra_view_port_widgets[] = {
37 NWidget(
NWID_VIEWPORT, INVALID_COLOUR,
WID_EV_VIEWPORT),
SetPadding(2, 2, 2, 2),
SetResize(1, 1),
SetFill(1, 1),
44 SetDataTip(STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW, STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW_TT),
46 SetDataTip(STR_EXTRA_VIEW_MOVE_VIEW_TO_MAIN, STR_EXTRA_VIEW_MOVE_VIEW_TO_MAIN_TT),
142 ZoomInOrOutToCursorWindow(wheel < 0,
this);
153 if (!gui_scope)
return;
160 WDP_AUTO,
"extra_viewport", 300, 268,
163 _nested_extra_view_port_widgets,
lengthof(_nested_extra_view_port_widgets)
189 Point pt = GetTileBelowCursor();
bool DoZoomInOutWindow(ZoomStateChange how, Window *w)
Zooms a viewport in a window in or out.
Functions related to OTTD's strings.
Window(WindowDesc *desc)
Empty constructor, initialization has been moved to InitNested() called from the constructor of the d...
High level window description.
Zoom out (get helicopter view).
void HandleZoomMessage(Window *w, const ViewPort *vp, byte widget_zoom_in, byte widget_zoom_out)
Update the status of the zoom-buttons according to the zoom-level of the viewport.
static Point RemapCoords(int x, int y, int z)
Map 3D world or tile coordinate to equivalent 2D coordinate as used in the viewports and smallmap...
Window * FindWindowById(WindowClass cls, WindowNumber number)
Find a window by its class and window number.
int virtual_height
height << zoom
static uint TileX(TileIndex tile)
Get the X component of a tile.
static int ScaleByZoom(int value, ZoomLevel zoom)
Scale by zoom level, usually shift left (when zoom > ZOOM_LVL_NORMAL) When shifting right...
Zoom in (get more detailed view).
void DisableWidget(byte widget_index)
Sets a widget to disabled.
static const VehicleID INVALID_VEHICLE
Constant representing a non-existing vehicle.
static const uint TILE_SIZE
Tile size in world coordinates.
Functions, definitions and such used only by the GUI.
Functions related to (drawing on) viewports.
void ShowExtraViewPortWindow(TileIndex tile)
Show a new Extra Viewport window.
Data structure for an opened window.
void InitNested(WindowNumber number=0)
Perform complete initialization of the Window with nested widgets, to allow use.
Main window; Window numbers:
ClientSettings _settings_client
The current settings for this game.
uint8 scrollwheel_scrolling
scrolling using the scroll wheel?
Definition of base types and functions in a cross-platform compatible way.
A number of safeguards to prevent using unsafe methods.
int32 scrollpos_x
Currently shown x coordinate (virtual screen coordinate of topleft corner of the viewport).
int virtual_width
width << zoom
#define lengthof(x)
Return the length of an fixed size array.
VehicleID follow_vehicle
VehicleID to follow if following a vehicle, INVALID_VEHICLE otherwise.
Default zoom level for viewports.
int32 dest_scrollpos_y
Current destination y coordinate to display (virtual screen coordinate of topleft corner of the viewp...
No window, redirects to WC_MAIN_WINDOW.
ZoomLevelByte zoom_min
minimum zoom out level
static TileIndex TileVirtXY(uint x, uint y)
Get a tile from the virtual XY-coordinate.
int32 dest_scrollpos_x
Current destination x coordinate to display (virtual screen coordinate of topleft corner of the viewp...
GUISettings gui
settings related to the GUI
uint32 TileIndex
The index/ID of a Tile.
static uint TileY(TileIndex tile)
Get the Y component of a tile.
Functions related to zooming.
Functions related to OTTD's landscape.
Coordinates of a point in 2D.
static const TileIndex INVALID_TILE
The very nice invalid tile marker.
Extra viewport; Window numbers:
void ShowExtraViewPortWindowForTileUnderCursor()
Show a new Extra Viewport window.
WindowNumber window_number
Window number within the window class.
Window functions not directly related to making/drawing windows.
Find a place automatically.
ViewportData * viewport
Pointer to viewport data, if present.
int32 scrollpos_y
Currently shown y coordinate (virtual screen coordinate of topleft corner of the viewport).
This file contains all sprite-related enums and defines.
static uint TilePixelHeight(TileIndex tile)
Returns the height of a tile in pixels.
static void SetDParam(uint n, uint64 v)
Set a string parameter v at index n in the global string parameter array.