Import combined Enhanced viewport: zoom out, overlays & tooltips (r53_27127) patch

https://www.tt-forums.net/viewtopic.php?f=33&t=53394
This commit is contained in:
patch-import
2015-08-02 19:37:42 +01:00
committed by Jonathan G Rennison
parent fd3388467f
commit 536a95dfd0
105 changed files with 3509 additions and 325 deletions

View File

@@ -18,6 +18,7 @@
#include "station_type.h"
#include "engine_type.h"
#include "company_type.h"
#include "widgets/dropdown_func.h"
void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order, Window *parent, bool auto_refit = false);
@@ -101,4 +102,33 @@ Vehicle *CheckClickOnVehicle(const struct ViewPort *vp, int x, int y);
void DrawVehicleImage(const Vehicle *v, int left, int right, int y, VehicleID selection, EngineImageType image_type, int skip);
/**
* Tell if the focused window concerns the specified vehicle.
* @param vid Vehicle id to check.
* @param ref_window The window to check against.
* @return True if the focused window is about specified vehicle.
*/
static inline bool HasFocusedVehicleChanged(const VehicleID vid, Window *ref_window)
{
if (ref_window) {
WindowClass wc = ref_window->window_class;
WindowNumber wn = ref_window->window_number;
if (wc == WC_DROPDOWN_MENU) GetParentWindowInfo(ref_window, wc, wn);
switch (wc) {
default:
break;
case WC_VEHICLE_DETAILS:
case WC_VEHICLE_REFIT:
case WC_VEHICLE_ORDERS:
case WC_VEHICLE_TIMETABLE:
case WC_VEHICLE_VIEW:
return ((uint32) wn != vid);
}
}
return true;
}
#endif /* VEHICLE_GUI_H */