1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-12 09:09:09 +00:00

Codechange: Close dropdowns by class instead of id.

This commit is contained in:
2023-06-03 13:21:08 +01:00
committed by PeterN
parent 2511649938
commit 2e62682f73
2 changed files with 2 additions and 2 deletions

View File

@@ -339,7 +339,7 @@ struct DropdownWindow : Window {
*/
void ShowDropDownListAt(Window *w, DropDownList &&list, int selected, int button, Rect wi_rect, Colours wi_colour, bool instant_close)
{
CloseWindowById(WC_DROPDOWN_MENU, 0);
CloseWindowByClass(WC_DROPDOWN_MENU);
/* The preferred position is just below the dropdown calling widget */
int top = w->top + wi_rect.bottom + 1;

View File

@@ -3483,7 +3483,7 @@ void ChangeVehicleViewports(VehicleID from_index, VehicleID to_index)
*/
void RelocateAllWindows(int neww, int newh)
{
CloseWindowById(WC_DROPDOWN_MENU, 0);
CloseWindowByClass(WC_DROPDOWN_MENU);
for (Window *w : Window::Iterate()) {
int left, top;