Merge 1.9.0-beta3

This commit is contained in:
Pavel Stupnikov
2019-02-25 18:47:08 +03:00
145 changed files with 2701 additions and 1536 deletions

View File

@@ -713,7 +713,7 @@ void SmallMapWindow::SetZoomLevel(ZoomLevelChange change, const Point *zoom_pt)
this->SetNewScroll(this->scroll_x + (tile.x - new_tile.x) * TILE_SIZE,
this->scroll_y + (tile.y - new_tile.y) * TILE_SIZE, sub);
} else if (this->map_type == SMT_LINKSTATS) {
this->overlay->RebuildCache();
this->overlay->SetDirty();
}
this->SetWidgetDisabledState(WID_SM_ZOOM_IN, this->zoom == zoomlevels[MIN_ZOOM_INDEX]);
this->SetWidgetDisabledState(WID_SM_ZOOM_OUT, this->zoom == zoomlevels[MAX_ZOOM_INDEX]);
@@ -1290,7 +1290,7 @@ void SmallMapWindow::SwitchMapType(SmallMapType map_type)
this->SetupWidgetData();
if (map_type == SMT_LINKSTATS) this->overlay->RebuildCache();
if (map_type == SMT_LINKSTATS) this->overlay->SetDirty();
if (map_type != SMT_INDUSTRY) this->BreakIndustryChainLink();
this->SetDirty();
}
@@ -1401,15 +1401,7 @@ int SmallMapWindow::GetPositionOnLegend(Point pt)
{
switch (widget) {
case WID_SM_MAP: { // Map window
/*
* XXX: scrolling with the left mouse button is done by subsequently
* clicking with the left mouse button; clicking once centers the
* large map at the selected point. So by unclicking the left mouse
* button here, it gets reclicked during the next inputloop, which
* would make it look like the mouse is being dragged, while it is
* actually being (virtually) clicked every inputloop.
*/
_left_button_clicked = false;
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);
@@ -1581,7 +1573,7 @@ int SmallMapWindow::GetPositionOnLegend(Point pt)
if (this->overlay->GetCompanyMask() != company_mask) {
this->overlay->SetCompanyMask(company_mask);
} else {
this->overlay->RebuildCache();
this->overlay->SetDirty();
}
}
_smallmap_industry_highlight_state = !_smallmap_industry_highlight_state;
@@ -1624,7 +1616,7 @@ void SmallMapWindow::SetNewScroll(int sx, int sy, int sub)
this->scroll_x = sx;
this->scroll_y = sy;
this->subscroll = sub;
if (this->map_type == SMT_LINKSTATS) this->overlay->RebuildCache();
if (this->map_type == SMT_LINKSTATS) this->overlay->SetDirty();
}
/* virtual */ void SmallMapWindow::OnScroll(Point delta)