Fix picker tool item selection in rail/road station and waypoint windows

This commit is contained in:
Jonathan G Rennison
2024-02-03 12:02:58 +00:00
parent 48c97d6cde
commit 7d92f185d3
3 changed files with 10 additions and 4 deletions

View File

@@ -1730,7 +1730,8 @@ public:
{
this->SelectClass(class_id);
this->EnsureSelectedStationClassIsVisible();
this->OnClick({}, WID_BRAS_IMAGE | (spec_id << 16), 1);
this->GetWidget<NWidgetBase>(WID_BRAS_IMAGE)->GetParentWidget<NWidgetMatrix>()->SetCurrentElement(spec_id);
this->OnClick({}, WID_BRAS_IMAGE, 1);
}
static HotkeyList hotkeys;
@@ -2620,7 +2621,8 @@ struct BuildRailWaypointWindow : PickerWindowBase {
{
for (uint i = 0; i < (uint)this->list.size(); i++) {
if (this->list[i] == spec_id) {
this->OnClick({}, WID_BRW_WAYPOINT | (i << 16), 1);
this->GetWidget<NWidgetBase>(WID_BRW_WAYPOINT)->GetParentWidget<NWidgetMatrix>()->SetCurrentElement(i);
this->OnClick({}, WID_BRW_WAYPOINT, 1);
break;
}
}