So I've created a hotspot with a mouseover option, yet for some reason if I am not receiving text from the MUD, just connected idly it does not update the Miniwindow, what am I doing wrong?
Here is my hotspot:
WindowAddHotspot(win, "close", window_width - WindowTextWidth(win, "f", "X") - 5 - 2, 1, window_width - 3 + 2, font_height + 1, --rectangle
"mouseover", -- MouseOver
"cancelmouseover", -- CancelMouseOver
"mousedown",
"cancelmousedown",
"mouseup",
"", -- tooltip text
miniwin.cursor_arrow, 0)
It changes the colour of the hotspot with this:
if mouse_over == true then
WindowRectOp(win, miniwin.rect_fill, window_width - WindowTextWidth(win, "f", "X") - 5 - 2, 1, window_width - 3 + 2, font_height + 1, ColourNameToRGB("red"), ColourNameToRGB("black"))
WindowText (win, "f", "X", window_width - WindowTextWidth(win, "f", "X") - 4, 1, 0, 0, ColourNameToRGB("white"), false) -- not Unicode
else
WindowText (win, "f", "X", window_width - WindowTextWidth(win, "f", "X") - 4, 1, 0, 0, ColourNameToRGB("black"), false) -- not Unicode
WindowRectOp(win, miniwin.rect_frame, window_width - WindowTextWidth(win, "f", "X") - 5 - 2, 1, window_width - 3 + 2, font_height + 1, ColourNameToRGB("gray"), ColourNameToRGB("black"))
end
And here is the mouseover and cancelmouseover functions:
mouse_over = false
function mouseover(flags, hotspot_id)
if hotspot_id == "close" then
mouse_over = true
update_window()
end
end
function cancelmouseover(flags, hotspot_id)
if hotspot_id ~= "close" then
mouse_over = false
update_window()
end
end
I feel I am missing something simple, it works fine if I add some note to the MUD or the MUD sends text, but otherwise it does not update.
Thanks! |