From c6b8869fed373f206920b404da9f03f7ffce69ff Mon Sep 17 00:00:00 2001 From: James Turner Date: Fri, 8 Jan 2021 19:35:00 +0000 Subject: [PATCH] Tooltips: set a flag when registering the commands This allows the C++ side to avoid invoking the commands prematurely. --- Nasal/canvas/tooltip.nas | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Nasal/canvas/tooltip.nas b/Nasal/canvas/tooltip.nas index dc3735481..b63de2ab4 100644 --- a/Nasal/canvas/tooltip.nas +++ b/Nasal/canvas/tooltip.nas @@ -422,3 +422,8 @@ addcommand("set-tooltip", setTooltip); addcommand("tooltip-timeout", showTooltip); addcommand("show-message", showMessage); addcommand("clear-message", clearMessage); + +# confirm the commands are registered: we use this to +# avoid sending commands before Nasal is inited, and hence +# producing errors +setprop("/sim/mouse/tooltip-commands-registered", 1);