Fix tunnel build viewport length tooltip when hover mode is right click

This commit is contained in:
Jonathan G Rennison 2019-03-11 20:01:29 +00:00
parent 2bd33c1869
commit 828a4399f9
3 changed files with 3 additions and 1 deletions

View File

@ -774,6 +774,7 @@ struct TooltipsWindow : public Window
case TCC_RIGHT_CLICK: if (!_right_button_down) delete this; break;
case TCC_LEFT_CLICK: if (!_left_button_down) delete this; break;
case TCC_HOVER: if (!_mouse_hovering) delete this; break;
case TCC_NEXT_LOOP: this->delete_next_mouse_loop = true; break;
case TCC_HOVER_VIEWPORT:
if (_settings_client.gui.hover_delay_ms == 0) {

View File

@ -3783,7 +3783,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, TCC_HOVER);
if (distance > 1) ShowMeasurementTooltips(STR_MEASURE_LENGTH, 1, &distance, _settings_client.gui.hover_delay_ms == 0 ? TCC_NEXT_LOOP : TCC_HOVER);
}
static void VpStartPreSizing()

View File

@ -924,6 +924,7 @@ enum TooltipCloseCondition {
TCC_LEFT_CLICK,
TCC_HOVER,
TCC_HOVER_VIEWPORT,
TCC_NEXT_LOOP,
};
void GuiShowTooltips(Window *parent, StringID str, uint paramcount = 0, const uint64 params[] = NULL, TooltipCloseCondition close_tooltip = TCC_HOVER);