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

This commit is contained in:
Jonathan G Rennison
2019-03-11 19:19:54 +00:00
parent c6fa43d767
commit 2bd33c1869
4 changed files with 7 additions and 3 deletions

View File

@@ -471,7 +471,7 @@ struct MainWindow : Window
virtual void OnMouseOver(Point pt, int widget) 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 */ /* Show tooltip with last month production or town name */
const Point p = GetTileBelowCursor(); const Point p = GetTileBelowCursor();
const TileIndex tile = TileVirtXY(p.x, p.y); const TileIndex tile = TileVirtXY(p.x, p.y);

View File

@@ -776,7 +776,9 @@ struct TooltipsWindow : public Window
case TCC_HOVER: if (!_mouse_hovering) delete this; break; case TCC_HOVER: if (!_mouse_hovering) delete this; break;
case TCC_HOVER_VIEWPORT: 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; delete this;
break; break;
} }

View File

@@ -155,7 +155,7 @@ public:
virtual void OnMouseOver(Point pt, int widget) 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 */ /* Show tooltip with last month production or town name */
const Point p = GetTileBelowCursor(); const Point p = GetTileBelowCursor();
const TileIndex tile = TileVirtXY(p.x, p.y); const TileIndex tile = TileVirtXY(p.x, p.y);

View File

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