diff options
author | terkhen <terkhen@openttd.org> | 2010-10-03 12:20:50 +0000 |
---|---|---|
committer | terkhen <terkhen@openttd.org> | 2010-10-03 12:20:50 +0000 |
commit | 92514c6b94bb1d3c8df2d766e412c763b2b44316 (patch) | |
tree | 892553ff838addd4022f778aa8911a95c5e20315 /src/viewport.cpp | |
parent | 7c312f602c26ed84498b4be594ab84ce2fcb1443 (diff) | |
download | openttd-92514c6b94bb1d3c8df2d766e412c763b2b44316.tar.xz |
(svn r20891) -Fix [FS#4145]: Measurement tooltips for docks and tunnels were closed after a hover event.
Diffstat (limited to 'src/viewport.cpp')
-rw-r--r-- | src/viewport.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/viewport.cpp b/src/viewport.cpp index abef0e9f9..6a3715a0e 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -2034,11 +2034,12 @@ void UpdateTileSelection() * @param str String to be displayed * @param paramcount number of params to deal with * @param params (optional) up to 5 pieces of additional information that may be added to a tooltip + * @param close_cond Condition for closing this tooltip. */ -static inline void ShowMeasurementTooltips(StringID str, uint paramcount, const uint64 params[]) +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(str, paramcount, params, TCC_LEFT_CLICK); + GuiShowTooltips(str, paramcount, params, close_cond); } /** highlighting tiles while only going over them with the mouse */ @@ -2095,7 +2096,7 @@ void VpSetPresizeRange(TileIndex from, TileIndex to) _thd.next_drawstyle = HT_RECT; /* show measurement only if there is any length to speak of */ - if (distance > 1) ShowMeasurementTooltips(STR_MEASURE_LENGTH, 1, &distance); + if (distance > 1) ShowMeasurementTooltips(STR_MEASURE_LENGTH, 1, &distance, TCC_HOVER); } static void VpStartPreSizing() |