Where did that click come from?

related to programming for xlobby, code samples, examples etc.

Where did that click come from?

Postby fletch on Fri Jul 13, 2007 5:42 pm

I've been working on a plugin in which I'm trying to implement a slider type control. Currently what I'm doing is using the plugin to replace a variable with an image. Then the plugin has an event that the user would assign to the click event of the image. The event causes the plugin looks at the properties of the button to determine the relative location of the mouse on the button. So if I click the button 3/4's of the way across it will return 75%, or 25% if I click a quarter of the way across. Simple right? And it works IF the event occurs on the xlobby server. If it is done from a thin client or the web client it doesn't. Why, because the plugin is using a windows function to determine where the mouse is currently located. So if called from a client, it looks to see where the mouse is on the server. Since the mouse on the server is more then likely not in the exact same location as that of the thin client, the relative location is incorrect.

How can I determine that the event was called by a client? If it was called by a client how can I determine the relative location on the client?

Of course if anyone has other thoughts on how something like this could be implemented I'm up for those ideas as well.

Thanks,
Aaron
fletch
 
Posts: 64
Joined: Sun Feb 05, 2006 1:11 am
Location: Castle Rock, CO

Re: Where did that click come from?

Postby tswhite70 on Fri Jul 13, 2007 10:45 pm

I can't think of any way you can collect the information you need on the thin client/web client side and pass it back to your plugin, Steven would have to implement some new code to make that work.

To get around the problem you can create a number of buttons (10, 20, 50, 100 whatever granularity you want) instead of a single button to act as your slider. Or just up/down arrows to act as the slider control - look at the EQ function in some skins (Baddabing's XLobby Media Player Skin has one I know) as an example.

Wish I could be of more help - good luck,
tsw
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Re: Where did that click come from?

Postby fletch on Sat Jul 14, 2007 6:52 pm

I was afraid of that as well. But thought I'd ask in case anyone had any other ideas. Anyway thanks for the reply. I guess at this point I'll use my current method, and not worry about the thin clients. Until some pricing and feature breakdowns occur I won't bother with asking to have this feature added. It may very well be a moot point.
fletch
 
Posts: 64
Joined: Sun Feb 05, 2006 1:11 am
Location: Castle Rock, CO