Merge branch 'master' into jgrpp
# Conflicts: # CMakeLists.txt # src/saveload/town_sl.cpp # src/screenshot.h # src/script/api/ai/ai_date.hpp.sq # src/script/api/ai/ai_marine.hpp.sq # src/script/api/ai/ai_station.hpp.sq # src/script/api/game/game_date.hpp.sq # src/script/api/game/game_marine.hpp.sq # src/script/api/game/game_station.hpp.sq # src/script/api/game/game_window.hpp.sq # src/script/api/script_window.hpp # src/script/api/template/template_window.hpp.sq # src/signal.cpp # src/statusbar_gui.cpp # src/toolbar_gui.cpp # src/viewport.cpp # src/viewport_func.h
This commit is contained in:
@@ -27,11 +27,11 @@
|
||||
|
||||
#include "safeguards.h"
|
||||
|
||||
/* Extra ViewPort Window Stuff */
|
||||
static const NWidgetPart _nested_extra_view_port_widgets[] = {
|
||||
/* Extra Viewport Window Stuff */
|
||||
static const NWidgetPart _nested_extra_viewport_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
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_CAPTION, COLOUR_GREY, WID_EV_CAPTION), SetDataTip(STR_EXTRA_VIEWPORT_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
NWidget(WWT_SHADEBOX, COLOUR_GREY),
|
||||
NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
|
||||
NWidget(WWT_STICKYBOX, COLOUR_GREY),
|
||||
@@ -174,25 +174,25 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
static WindowDesc _extra_view_port_desc(
|
||||
static WindowDesc _extra_viewport_desc(
|
||||
WDP_AUTO, "extra_viewport", 300, 268,
|
||||
WC_EXTRA_VIEW_PORT, WC_NONE,
|
||||
WC_EXTRA_VIEWPORT, WC_NONE,
|
||||
0,
|
||||
_nested_extra_view_port_widgets, lengthof(_nested_extra_view_port_widgets)
|
||||
_nested_extra_viewport_widgets, lengthof(_nested_extra_viewport_widgets)
|
||||
);
|
||||
|
||||
/**
|
||||
* Show a new Extra Viewport window.
|
||||
* @param tile Tile to center the view on. INVALID_TILE means to use the center of main viewport.
|
||||
*/
|
||||
void ShowExtraViewPortWindow(TileIndex tile)
|
||||
void ShowExtraViewportWindow(TileIndex tile)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
/* find next free window number for extra viewport */
|
||||
while (FindWindowById(WC_EXTRA_VIEW_PORT, i) != nullptr) i++;
|
||||
while (FindWindowById(WC_EXTRA_VIEWPORT, i) != nullptr) i++;
|
||||
|
||||
new ExtraViewportWindow(&_extra_view_port_desc, i, tile);
|
||||
new ExtraViewportWindow(&_extra_viewport_desc, i, tile);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -201,17 +201,17 @@ void ShowExtraViewPortWindow(TileIndex tile)
|
||||
* Otherwise center it on the tile under the cursor, if the cursor is inside a viewport.
|
||||
* If that fails, center it on main viewport center.
|
||||
*/
|
||||
void ShowExtraViewPortWindowForTileUnderCursor()
|
||||
void ShowExtraViewportWindowForTileUnderCursor()
|
||||
{
|
||||
if (_build_tunnel_endtile != 0 && _thd.place_mode & HT_TUNNEL) {
|
||||
ShowExtraViewPortWindow(_build_tunnel_endtile);
|
||||
ShowExtraViewportWindow(_build_tunnel_endtile);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Use tile under mouse as center for new viewport.
|
||||
* Do this before creating the window, it might appear just below the mouse. */
|
||||
Point pt = GetTileBelowCursor();
|
||||
ShowExtraViewPortWindow(pt.x != -1 ? TileVirtXY(pt.x, pt.y) : INVALID_TILE);
|
||||
ShowExtraViewportWindow(pt.x != -1 ? TileVirtXY(pt.x, pt.y) : INVALID_TILE);
|
||||
}
|
||||
|
||||
void ShowTooltipForTile(Window *w, const TileIndex tile)
|
||||
|
Reference in New Issue
Block a user