1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-20 19:02:41 +01:00

Codechange: add and use GetToolTip instead of direct access

This commit is contained in:
Rubidium
2025-01-03 10:09:36 +01:00
committed by rubidium42
parent f0a74fcabb
commit 56d4d3cc7a
3 changed files with 14 additions and 4 deletions

View File

@@ -756,8 +756,8 @@ static void DispatchRightClickEvent(Window *w, int x, int y)
} else if (_settings_client.gui.right_click_wnd_close == RCC_YES_EXCEPT_STICKY && (w->flags & WF_STICKY) == 0 && (w->window_desc.flags & WDF_NO_CLOSE) == 0) {
/* Right-click close is enabled, but excluding sticky windows. */
w->Close();
} else if (_settings_client.gui.hover_delay_ms == 0 && !w->OnTooltip(pt, wid->index, TCC_RIGHT_CLICK) && wid->tool_tip != 0) {
GuiShowTooltips(w, wid->tool_tip, TCC_RIGHT_CLICK);
} else if (_settings_client.gui.hover_delay_ms == 0 && !w->OnTooltip(pt, wid->index, TCC_RIGHT_CLICK) && wid->GetToolTip() != STR_NULL) {
GuiShowTooltips(w, wid->GetToolTip(), TCC_RIGHT_CLICK);
}
}
@@ -777,8 +777,8 @@ static void DispatchHoverEvent(Window *w, int x, int y)
Point pt = { x, y };
/* Show the tooltip if there is any */
if (!w->OnTooltip(pt, wid->index, TCC_HOVER) && wid->tool_tip != 0) {
GuiShowTooltips(w, wid->tool_tip, TCC_HOVER);
if (!w->OnTooltip(pt, wid->index, TCC_HOVER) && wid->GetToolTip() != STR_NULL) {
GuiShowTooltips(w, wid->GetToolTip(), TCC_HOVER);
return;
}