Page 1 of 1

new feature request

Posted: Mon Jun 20, 2011 12:08 am
by may
hello. i was looking around at the script engine docs, and was wondering if a onMouseOver event could be coded and added to the list of options available?

basically what i was wanting was the ability when you scroll your mouse over a gump button it would display text that was pre-set but not visible until the user does a mouse-over action on the various buttons on a gump.

i do understand that onClick exists, but clicking is not what I'm wanting for the text to be displayed. anyways, this is a request. i am new to javascript, heading to a local book store later in the week to pick up a book on javascripting.. but if a dev could implement this i would be grateful.

Posted: Mon Jun 20, 2011 12:10 am
by may
by the way, i figured out why it wouldnt let originally post in this forum. it seems that if you include the following in subject line it will give you a 403 forbidden access error lol.

The subject line was: [REQUEST] - onMouseOver Event

Posted: Mon Jun 20, 2011 12:28 am
by Xuri
I think that may be a security measure of some form - though a bit confusing when it takes you to a 403 page :P Oh well.

As for an onMouseOver event - I'm not sure if that is possible. Have you seen a similar feature elsewhere, on other shards/servers, official UO, etc? To add such a feature requires that the UO client actually sends a "User just moused-over a gump-element"-event to the server, and I'm not sure that it actually does. :/

Posted: Mon Jun 20, 2011 12:54 am
by may
i guess closest example i could give you would be when using the blacksmithing menu either on uo live or runuo. when the blacksmithing menu pops up it shows an anvil, forge, shield, armor and sword but no text underneath until you put your mouse cursor over the picture of the anvil, forge, shield, armor or sword. when you move your mouse cursor away from the anvil button picture the text goes away.

concerning javascript onMouseOver on the web.. i do know that webpages with javascript embedded have an onMouseOver event. a quick google search brought up the following. This may explain what I'm referring to better than i can. my english not so good ;)

web reference:
--------------------
http://www.w3schools.com/jsref/event_onmouseover.asp

Posted: Mon Jun 20, 2011 1:22 am
by Xuri
Ah, okay - sounds like it should be possible somehow then. If it's something that is supported by the UO client, it is theoretically possible to implement support for it in UOX3.

Keep in mind that the JavaScript-engine in UOX3, while based on the SpiderMonkey C JavaScript source, does not support events and triggers that are specific to the browser-implementation of JavaScript :) So if there should happen to be a onSomething-event in UOX3 that matches the name for a generic event in JavaScripting for the Web - that's purely coincidental.

A rule for learning JavaScript through general tutorials on the Web, for the specific purpose of creating scripts for UOX3, would be to keep an eye open for anything that seems brower-related and ignore it ;D How you setup your functions, how you treat variables, how you do math-stuff, etc should all be the same though.

https://www.uox3.org/jsdocs/ is a the definite resource for UOX3-specific JavaScript-stuff, in particular which events, triggers, functions and methods that are available in UOX3. It's mostly up to date ;P

Re: new feature request

Posted: Tue Aug 11, 2020 10:30 am
by Xuri
Update:
Support for this was added in 0.99.2 in the form of a JS Gump method (AddToolTip( clilocID )) and updated in 0.99.2l (on GitHub) to support up to 10 optional arguments to go with the clilocID.