mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-08 01:10:28 +00:00
(svn r21666) -Codechange: Use GetCallbackWnd at more places.
This commit is contained in:
parent
fdf0be0da8
commit
5955e98b79
@ -2585,7 +2585,7 @@ bool VehicleClicked(const Vehicle *v)
|
|||||||
v = v->First();
|
v = v->First();
|
||||||
if (!v->IsPrimaryVehicle()) return false;
|
if (!v->IsPrimaryVehicle()) return false;
|
||||||
|
|
||||||
FindWindowById(_thd.window_class, _thd.window_number)->OnVehicleSelect(v);
|
_thd.GetCallbackWnd()->OnVehicleSelect(v);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2146,7 +2146,7 @@ void UpdateTileSelection()
|
|||||||
static inline void ShowMeasurementTooltips(StringID str, uint paramcount, const uint64 params[], TooltipCloseCondition close_cond = TCC_LEFT_CLICK)
|
static inline void ShowMeasurementTooltips(StringID str, uint paramcount, const uint64 params[], TooltipCloseCondition close_cond = TCC_LEFT_CLICK)
|
||||||
{
|
{
|
||||||
if (!_settings_client.gui.measure_tooltip) return;
|
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 */
|
/** 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;
|
if (_special_mouse_mode != WSM_SIZING) return ES_NOT_HANDLED;
|
||||||
|
|
||||||
/* stop drag mode if the window has been closed */
|
/* 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) {
|
if (w == NULL) {
|
||||||
ResetObjectToPlace();
|
ResetObjectToPlace();
|
||||||
return ES_HANDLED;
|
return ES_HANDLED;
|
||||||
@ -2834,7 +2834,7 @@ void SetObjectToPlace(CursorID icon, PaletteID pal, HighLightStyle mode, WindowC
|
|||||||
{
|
{
|
||||||
if (_thd.window_class != WC_INVALID) {
|
if (_thd.window_class != WC_INVALID) {
|
||||||
/* Undo clicking on button and drag & drop */
|
/* 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
|
/* Call the abort function, but set the window class to something
|
||||||
* that will never be used to avoid infinite loops. Setting it to
|
* that will never be used to avoid infinite loops. Setting it to
|
||||||
* the 'next' window class must not be done because recursion into
|
* the 'next' window class must not be done because recursion into
|
||||||
|
Loading…
Reference in New Issue
Block a user