Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Frustrated with HotSpots

Frustrated with HotSpots

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Katie Love   (19 posts)  Bio
Date Sat 21 Mar 2009 06:17 PM (UTC)
Message
I must be doing something wrong. I'm trying to just get at least one hotspot working using my own code. I've downloaded one if Nick's scripts off the form and it works perfectly, so I know it's obviously something I'm doing wrong. I'm guessing I don't quite understand how they work.

What I'm trying to do is a simple window, blue background with a hotspot in it that has a mouseover event with an icon change to a hand. If I can put my mouse in the area and see the hotspot is working, then I will at least know how they work and can apply it to something more complex.

The problems is, I can't seem to get it to work. Below is the code. If someone could point out what I'm missing I would be very grateful!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient [
<!ENTITY test1 "testing 1 2 3" >
<!ENTITY test2 "testing 4 5 6" >
]>


<muclient>
<plugin
name="hotspot_plugin"
author="KL"
language="Lua"
purpose = "Hotspots plugin"
save_state = "y"
date_written = "2009-03-20"
date_modified = "2009-03-20"
requires="3.23"
version="1.00"

id = "f8a72c7f063b33b1ec58c178"
>
<description trim="y">
<![CDATA[
Put your description of what the plugin does here, and how to use it.

sample:help - shows this description in the output window
]]>
</description>
</plugin>

<script>
<![CDATA[

function mouseover (flags, hotspot_id)
Note("moused over!")
end

function OnPluginInstall ()
Note("plugin installed!")
win = GetPluginID()

WindowCreate(win, 0, 0, 150, 150, 6, 1, ColourNameToRGB("blue"))


Note(WindowAddHotspot(win, "hotspot",
2, 2, 50, 50,
"mouseover",
"",
"",
"",
"",
"Test Window",
1, 0))

WindowShow(win, true)

end -- function
]]>
</script>
</muclient>
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #1 on Sat 21 Mar 2009 07:37 PM (UTC)
Message
Your problem is that you created the miniwindow under the main window. It works if you change the create line to:


WindowCreate(win, 0, 0, 150, 150, 6, 0, ColourNameToRGB("blue"))


Hotspots are not detected in a window under the main window, as the "text plane" (which itself can generate mouse-over or mouse-down events, like clicking on text) has the higher priority.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Katie Love   (19 posts)  Bio
Date Reply #2 on Sat 21 Mar 2009 08:05 PM (UTC)
Message
Nick...

You are the best! Thank you!
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


10,354 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.