OS: Windows 10
Version: 0.2.0
Commit/Build: 1322410
game_handle_input_mouse -> input_widget_over -> input_update_tooltip has a section of code that seems to try to make tooltips disappear after being hovered over for a few seconds:
gTooltipTimeout += gTicksSinceLastUpdate;
if (gTooltipTimeout >= 8000)
{
window_close_by_class(WC_TOOLTIP);
}
However, right after the method is called in input_widget_over, gTooltipTimeout gets set back to 0 for some reason:
else
{
input_update_tooltip(w, widgetIndex, x, y);
}
gTooltipTimeout = 0;
gTooltipCursorX = x;
gTooltipCursorY = y;
As a result, gTooltipTimeout never reaches 8000 and the tooltips stay there forever. If I comment out gTooltipTimeout = 0; then it works and the tooltips disappear after a few seconds. Is there a reason for this line to be there?
As a note, I am particularly talking about ingame tooltips here. Tooltips on the title screen also don't go away, but apparently due to a method in TitleMenu.cpp:
static void window_title_menu_cursor(rct_window *w, rct_widgetindex widgetIndex, int32_t x, int32_t y, int32_t *cursorId)
{
gTooltipTimeout = 2000;
}
I assume this is an intentional exception since there is a method specifically created for this purpose.
Steps to reproduce:
Still happens on v0.3.1
I believe @duncanspumpkin has recently been working on refactoring this.
I wasn't looking at the timeout code but i could certainly take a look.
In the assembly everything in this else branch skips the setting of the tooltiptimeout to zero. https://github.com/OpenRCT2/OpenRCT2/blob/develop/src/openrct2-ui/input/MouseInput.cpp#L1443
I think this can be fixed with a little change by moving the
gTooltipTimeout = 0;
gTooltipCursorX = x;
gTooltipCursorY = y;
into the input_update_tooltip function where it rightfully belongs.
Most helpful comment
I think this can be fixed with a little change by moving the
gTooltipTimeout = 0; gTooltipCursorX = x; gTooltipCursorY = y;into the input_update_tooltip function where it rightfully belongs.