(svn r27939) [1.7] -Backport from trunk:

- Fix: 'unban' console command was not handling IPv6 adresses properly (r27914, r27913)
- Fix: Keep the 'link' between industry chain and smallmap windows whenever possible [FS#6585] (r27905)
- Fix: When the last vehicle is removed from a shared orders group, hide the 'Stop sharing' button in the vehicle orders window [FS#6593] (r27904)
- Fix: Tooltip of 'increase service interval' said 'decrease' [FS#6606] (r27895)
- Fix: Console command parser passed invalid strings to the debug output, if command lines had many parameters [FS#6576] (r27884, r27883)
This commit is contained in:
frosch
2017-12-11 19:20:44 +00:00
committed by Sergii Pylypenko
parent f82a4bf45a
commit 9f078c357d
6 changed files with 54 additions and 22 deletions

View File

@@ -575,6 +575,12 @@ static const byte _vehicle_type_colours[6] = {
};
/** Notify the industry chain window to stop sending newly selected industries. */
/* static */ void SmallMapWindow::BreakIndustryChainLink()
{
InvalidateWindowClassesData(WC_INDUSTRY_CARGOES, NUM_INDUSTRYTYPES);
}
inline Point SmallMapWindow::SmallmapRemapCoords(int x, int y) const
{
Point pt;
@@ -1079,6 +1085,12 @@ SmallMapWindow::SmallMapWindow(WindowDesc *desc, int window_number) :
this->SetOverlayCargoMask();
}
SmallMapWindow::~SmallMapWindow()
{
delete this->overlay;
this->BreakIndustryChainLink();
}
/**
* Rebuilds the colour indices used for fast access to the smallmap contour colours based on the heightlevel.
*/
@@ -1284,6 +1296,7 @@ void SmallMapWindow::SwitchMapType(SmallMapType map_type)
this->SetupWidgetData();
if (map_type == SMT_LINKSTATS) this->overlay->RebuildCache();
if (map_type != SMT_INDUSTRY) this->BreakIndustryChainLink();
this->SetDirty();
}
@@ -1335,6 +1348,8 @@ void SmallMapWindow::SelectLegendItem(int click_pos, LegendAndColour *legend, in
} else {
legend[click_pos].show_on_map = !legend[click_pos].show_on_map;
}
if (this->map_type == SMT_INDUSTRY) this->BreakIndustryChainLink();
}
/**
@@ -1390,9 +1405,6 @@ int SmallMapWindow::GetPositionOnLegend(Point pt)
/* virtual */ void SmallMapWindow::OnClick(Point pt, int widget, int click_count)
{
/* User clicked something, notify the industry chain window to stop sending newly selected industries. */
InvalidateWindowClassesData(WC_INDUSTRY_CARGOES, NUM_INDUSTRYTYPES);
switch (widget) {
case WID_SM_MAP: { // Map window
/*
@@ -1490,6 +1502,7 @@ int SmallMapWindow::GetPositionOnLegend(Point pt)
switch (this->map_type) {
case SMT_INDUSTRY:
tbl = _legend_from_industries;
this->BreakIndustryChainLink();
break;
case SMT_OWNER:
tbl = &(_legend_land_owners[NUM_NO_COMPANY_ENTRIES]);