Merge branch 'master' into jgrpp
# Conflicts: # src/3rdparty/fmt/core.h # src/command_type.h # src/console_cmds.cpp # src/core/overflowsafe_type.hpp # src/landscape.cpp # src/network/network.cpp # src/newgrf_object.h # src/object_cmd.cpp # src/order_gui.cpp # src/saveload/vehicle_sl.cpp # src/script/api/script_industrytype.cpp # src/script/api/script_object.hpp # src/script/api/script_town.cpp # src/table/object_land.h # src/timetable_cmd.cpp # src/tree_cmd.cpp # src/vehicle_gui.cpp # src/window.cpp
This commit is contained in:
@@ -969,7 +969,7 @@ void SmallMapWindow::DrawTowns(const DrawPixelInfo *dpi) const
|
||||
void SmallMapWindow::DrawMapIndicators() const
|
||||
{
|
||||
/* Find main viewport. */
|
||||
const Viewport *vp = FindWindowById(WC_MAIN_WINDOW, 0)->viewport;
|
||||
const Viewport *vp = GetMainWindow()->viewport;
|
||||
|
||||
Point upper_left_smallmap_coord = InverseRemapCoords2(vp->virtual_left, vp->virtual_top);
|
||||
Point lower_right_smallmap_coord = InverseRemapCoords2(vp->virtual_left + vp->virtual_width - 1, vp->virtual_top + vp->virtual_height - 1);
|
||||
@@ -1461,7 +1461,7 @@ int SmallMapWindow::GetPositionOnLegend(Point pt)
|
||||
if (click_count > 0) this->mouse_capture_widget = widget;
|
||||
|
||||
const NWidgetBase *wid = this->GetWidget<NWidgetBase>(WID_SM_MAP);
|
||||
Window *w = FindWindowById(WC_MAIN_WINDOW, 0);
|
||||
Window *w = GetMainWindow();
|
||||
int sub;
|
||||
pt = this->PixelToTile(pt.x - wid->pos_x, pt.y - wid->pos_y, &sub);
|
||||
ScrollWindowTo(this->scroll_x + pt.x * TILE_SIZE, this->scroll_y + pt.y * TILE_SIZE, -1, w);
|
||||
@@ -1732,7 +1732,7 @@ void SmallMapWindow::SetNewScroll(int sx, int sy, int sub)
|
||||
*/
|
||||
void SmallMapWindow::SmallMapCenterOnCurrentPos()
|
||||
{
|
||||
const Viewport *vp = FindWindowById(WC_MAIN_WINDOW, 0)->viewport;
|
||||
const Viewport *vp = GetMainWindow()->viewport;
|
||||
Point viewport_center = InverseRemapCoords2(vp->virtual_left + vp->virtual_width / 2, vp->virtual_top + vp->virtual_height / 2);
|
||||
|
||||
int sub;
|
||||
@@ -2024,7 +2024,7 @@ void ShowSmallMap()
|
||||
*/
|
||||
bool ScrollMainWindowTo(int x, int y, int z, bool instant)
|
||||
{
|
||||
bool res = ScrollWindowTo(x, y, z, FindWindowById(WC_MAIN_WINDOW, 0), instant);
|
||||
bool res = ScrollWindowTo(x, y, z, GetMainWindow(), instant);
|
||||
|
||||
/* If a user scrolls to a tile (via what way what so ever) and already is on
|
||||
* that tile (e.g.: pressed twice), move the smallmap to that location,
|
||||
|
Reference in New Issue
Block a user