1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-19 02:12:37 +01:00

Fix #15067: Mark NewGRF settings as modified after moving by drag & drop. (#15068)

This commit is contained in:
Peter Nelson
2026-01-09 23:02:54 +00:00
committed by GitHub
parent bd9ced2ec2
commit 0794287b30

View File

@@ -1340,16 +1340,18 @@ struct NewGRFWindow : public Window, NewGRFScanCallback {
this->vscroll->ScrollTowards(to_pos);
this->preset = -1;
this->InvalidateData();
this->InvalidateData(GOID_NEWGRF_LIST_EDITED);
}
} else if (this->avail_sel != nullptr) {
int to_pos = std::min(this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_NS_FILE_LIST, WidgetDimensions::scaled.framerect.top), this->vscroll->GetCount() - 1);
this->AddGRFToActive(to_pos);
this->InvalidateData(GOID_NEWGRF_LIST_EDITED);
}
} else if (widget == WID_NS_AVAIL_LIST && this->active_sel != nullptr) {
/* Remove active NewGRF file by dragging it over available list. */
Point dummy = {-1, -1};
this->OnClick(dummy, WID_NS_REMOVE, 1);
this->InvalidateData(GOID_NEWGRF_LIST_EDITED);
}
ResetObjectToPlace();