diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/vehicle_gui.cpp | 2 | ||||
-rw-r--r-- | src/viewport.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 35143e8fc..98d5ad95d 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -2585,7 +2585,7 @@ bool VehicleClicked(const Vehicle *v) v = v->First(); if (!v->IsPrimaryVehicle()) return false; - FindWindowById(_thd.window_class, _thd.window_number)->OnVehicleSelect(v); + _thd.GetCallbackWnd()->OnVehicleSelect(v); return true; } diff --git a/src/viewport.cpp b/src/viewport.cpp index 1b8e5965b..e5e398eb8 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -2146,7 +2146,7 @@ void UpdateTileSelection() static inline void ShowMeasurementTooltips(StringID str, uint paramcount, const uint64 params[], TooltipCloseCondition close_cond = TCC_LEFT_CLICK) { if (!_settings_client.gui.measure_tooltip) return; - GuiShowTooltips(FindWindowById(_thd.window_class, _thd.window_number), str, paramcount, params, close_cond); + GuiShowTooltips(_thd.GetCallbackWnd(), str, paramcount, params, close_cond); } /** highlighting tiles while only going over them with the mouse */ @@ -2791,7 +2791,7 @@ EventState VpHandlePlaceSizingDrag() if (_special_mouse_mode != WSM_SIZING) return ES_NOT_HANDLED; /* stop drag mode if the window has been closed */ - Window *w = FindWindowById(_thd.window_class, _thd.window_number); + Window *w = _thd.GetCallbackWnd(); if (w == NULL) { ResetObjectToPlace(); return ES_HANDLED; @@ -2834,7 +2834,7 @@ void SetObjectToPlace(CursorID icon, PaletteID pal, HighLightStyle mode, WindowC { if (_thd.window_class != WC_INVALID) { /* Undo clicking on button and drag & drop */ - Window *w = FindWindowById(_thd.window_class, _thd.window_number); + Window *w = _thd.GetCallbackWnd(); /* Call the abort function, but set the window class to something * that will never be used to avoid infinite loops. Setting it to * the 'next' window class must not be done because recursion into |