Fix viewport town/industry tooltips shown on mouseover in right-click mode
This commit is contained in:
@@ -505,7 +505,7 @@ struct MainWindow : Window
|
|||||||
|
|
||||||
virtual void OnMouseOver(Point pt, int widget) override
|
virtual void OnMouseOver(Point pt, int widget) override
|
||||||
{
|
{
|
||||||
if (pt.x != -1 && _game_mode != GM_MENU && (_mouse_hovering || _settings_client.gui.hover_delay_ms == 0)) {
|
if (pt.x != -1 && _game_mode != GM_MENU && (_settings_client.gui.hover_delay_ms == 0 ? _right_button_down : _mouse_hovering)) {
|
||||||
/* 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);
|
||||||
|
@@ -810,7 +810,7 @@ struct TooltipsWindow : public Window
|
|||||||
|
|
||||||
case TCC_HOVER_VIEWPORT:
|
case TCC_HOVER_VIEWPORT:
|
||||||
if (_settings_client.gui.hover_delay_ms == 0) {
|
if (_settings_client.gui.hover_delay_ms == 0) {
|
||||||
this->delete_next_mouse_loop = true;
|
if (!_right_button_down) this->delete_next_mouse_loop = true;
|
||||||
} else if (!_mouse_hovering) {
|
} else if (!_mouse_hovering) {
|
||||||
delete this;
|
delete this;
|
||||||
break;
|
break;
|
||||||
|
@@ -153,7 +153,7 @@ public:
|
|||||||
|
|
||||||
virtual void OnMouseOver(Point pt, int widget) override
|
virtual void OnMouseOver(Point pt, int widget) override
|
||||||
{
|
{
|
||||||
if (pt.x != -1 && (_mouse_hovering || _settings_client.gui.hover_delay_ms == 0)) {
|
if (pt.x != -1 && (_settings_client.gui.hover_delay_ms == 0 ? _right_button_down : _mouse_hovering)) {
|
||||||
/* 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);
|
||||||
|
Reference in New Issue
Block a user