Highlight waypoint tiles when adjacent or distant joining

This commit is contained in:
Jonathan G Rennison
2023-05-25 22:34:54 +01:00
parent 65159f4b22
commit df5ca1d7fb
6 changed files with 136 additions and 27 deletions

View File

@@ -519,6 +519,7 @@ struct BuildRailToolbarWindow : Window {
~BuildRailToolbarWindow()
{
if (this->IsWidgetLowered(WID_RAT_BUILD_STATION)) SetViewportCatchmentStation(nullptr, true);
if (this->IsWidgetLowered(WID_RAT_BUILD_WAYPOINT)) SetViewportCatchmentWaypoint(nullptr, true);
if (_settings_client.gui.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0, false);
}
@@ -903,6 +904,7 @@ struct BuildRailToolbarWindow : Window {
void OnPlaceObjectAbort() override
{
if (this->IsWidgetLowered(WID_RAT_BUILD_STATION)) SetViewportCatchmentStation(nullptr, true);
if (this->IsWidgetLowered(WID_RAT_BUILD_WAYPOINT)) SetViewportCatchmentWaypoint(nullptr, true);
this->RaiseButtons();
this->DisableWidget(WID_RAT_REMOVE);
@@ -2467,6 +2469,11 @@ struct BuildRailWaypointWindow : PickerWindowBase {
}
}
}
void OnRealtimeTick(uint delta_ms) override
{
CheckRedrawWaypointCoverage(this, false);
}
};
/** Nested widget definition for the build NewGRF rail waypoint window */