Feature: Highlight waypoint tiles when adjacent or distant joining

This commit is contained in:
Jonathan G Rennison
2023-05-26 12:45:18 +01:00
committed by PeterN
parent 84b53213af
commit d7bf6b2c07
5 changed files with 95 additions and 13 deletions

View File

@@ -422,6 +422,7 @@ struct BuildRailToolbarWindow : Window {
void Close() override
{
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) CloseWindowById(WC_SCEN_LAND_GEN, 0, false);
CloseWindowById(WC_SELECT_STATION, 0);
this->Window::Close();
@@ -731,6 +732,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);
@@ -757,6 +759,11 @@ struct BuildRailToolbarWindow : Window {
return ES_NOT_HANDLED;
}
void OnRealtimeTick(uint delta_ms) override
{
if (this->IsWidgetLowered(WID_RAT_BUILD_WAYPOINT)) CheckRedrawWaypointCoverage(this);
}
static HotkeyList hotkeys;
};
@@ -2176,6 +2183,11 @@ struct BuildRailWaypointWindow : PickerWindowBase {
this->InvalidateData();
}
}
void OnRealtimeTick(uint delta_ms) override
{
CheckRedrawWaypointCoverage(this);
}
};
/* static */ QueryString BuildRailWaypointWindow::editbox(BuildRailWaypointWindow::FILTER_LENGTH * MAX_CHAR_LENGTH, BuildRailWaypointWindow::FILTER_LENGTH);