Trouble with window not triggering events
Hello,
I'm having trouble with Lotro.UI.Window events. I understand that there's some sort of caveat here but I seem to miss it. Code:
MyWindow = class(Turbine.UI.Window()); TIA |
First, remove the "()" after Turbine.UI.Window in the first line. You're not deriving MyClass from an instance of Turbine.UI.Window, but from the class itself.
Second, if you've set "SetWantUpdates(true)", then you need to define an Update event handler, which will be called at each "tick". Third, your MouseDown event handler won't get its arguments correctly: Code:
function MyWindow:MouseDownHandler(s,a) Edit: In case it's not obvious, you also need to create an instance of MyWindow. Add "m = MyWindow();" at the end of your code. |
The '()' I found out on my own, must have been a typo. Removed that and now it works fine.
The SetWantUpdates(true) was good information, perhaps good to get whats going on in the controls. And good to know about the event arguments too. Still struggeling with other aspects but thank you for you reply :) |
You should probably work your way through the thread:
https://www.lotro.com/forums/showthr...gins-for-Noobs it covers all of the basics from HelloWorld to more sophisticated issues such as event handling and cross Apartment communication with a number of code samples. You can also learn a lot from taking apart other plugins and experimenting. While the thread is a bit old, it's still totally relevant, especially since the API hasn't changed in years (the last update was in November 2014) and according to SSG is not likely to ever get updated again. It was implemented as a volunteer "pet" project of a couple of Turbine devs, none of whom still work for SSG and SSG doesn't have the resources or the inclination to research the existing implementation in order to enhance it. |
I second Garan's suggestion. That's how I started, and it was very helpful.
That guide, along with the Lua 5.1 manual and the API reference, is all you really need. |
All times are GMT -5. The time now is 09:31 PM. |
vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI