Fix viewport hovering when hover mode is set to right-click

pull/78/head
Jonathan G Rennison 5 years ago
parent c6fa43d767
commit 2bd33c1869

@ -471,7 +471,7 @@ struct MainWindow : Window
virtual void OnMouseOver(Point pt, int widget)
{
if (pt.x != -1 && _game_mode != GM_MENU && _mouse_hovering) {
if (pt.x != -1 && _game_mode != GM_MENU && (_mouse_hovering || _settings_client.gui.hover_delay_ms == 0)) {
/* Show tooltip with last month production or town name */
const Point p = GetTileBelowCursor();
const TileIndex tile = TileVirtXY(p.x, p.y);

@ -776,7 +776,9 @@ struct TooltipsWindow : public Window
case TCC_HOVER: if (!_mouse_hovering) delete this; break;
case TCC_HOVER_VIEWPORT:
if (!_mouse_hovering) {
if (_settings_client.gui.hover_delay_ms == 0) {
this->delete_next_mouse_loop = true;
} else if (!_mouse_hovering) {
delete this;
break;
}

@ -155,7 +155,7 @@ public:
virtual void OnMouseOver(Point pt, int widget)
{
if (pt.x != -1 && _mouse_hovering) {
if (pt.x != -1 && (_mouse_hovering || _settings_client.gui.hover_delay_ms == 0)) {
/* Show tooltip with last month production or town name */
const Point p = GetTileBelowCursor();
const TileIndex tile = TileVirtXY(p.x, p.y);

@ -3040,6 +3040,8 @@ void HandleMouseEvents()
_mouse_hovering = true;
}
}
} else {
_mouse_hovering = false;
}
/* Handle sprite picker before any GUI interaction */

Loading…
Cancel
Save