Jump to content

Digest Jan-Feb

We talk about what was done and updated in the past month. We help keep abreast of events.

January February

Servers monitoring and the Addons Editor

We present you two legends. All dreams come true.

Servers monitoring The Addons Editor

Game tooltips

Tooltips provide a way for 3rd party fansites and extensions to display detailed information on mouseover.

Read more

The Addons Updater

Let us to introduce the addons updating software and to share the details

Read more Download

Addons using Class(...)?


Recommended Posts

Has anyone tried (and succeeded in) using the new facilities that came with (around) 3.0?

I'm talking about the stuff in LuaCompiledSystem.pak, specifically Class (Interface\Common\Script\ScriptClassesImplementation.luac) and useful base classes such as widgetObjectMonitor (Interface\Common\Script\ScriptWidgetObjectMonitor.luac) or widgetDynamicList (Interface\Common\Script\ScriptWidgetDynamicList.luac)?

I tried to use them like other scripts do (for example AstralMap), which starts the whole thing by doing something like that:

Class("main", UIBasicElement())

function main:Init()


    -- [...] 

    return UIBasicElement.Init(self)


-- [...] 


...when I try that, main(mainForm) throws a bad argument #1 to `setmetatable' (table expected, got userdata); if I remove mainForm it runs Init - but then self.wtSomeOtherWidget is never set (and I couldnt find any code inside the classes that initializes them based on widgetForm:GetNamedChildren or something).

So, any luck there, or am I the first one to try that?

My main goals in trying to use those things is the magic widgetDynamicList and widgetObjectMonitor work behind the scenes (like widgetDynamicList.Add creating other classes for objectIds or widgetObjectMonitor.Toggle keeping track of busy reaction handlers).

Link to comment
Share on other sites

Well, obviously you can't set metatable to userdata from script, so your mainForm should be a table. Since it's not, and all the widgets we have from client side are userdata, there should be some script (probably within \Interface\Common\Script\) which makes them tables. So link all other scripts from \Interface\Common\Script\ to your add-on and try again. If it does the trick, remove those scripts one by one and restart client until add-on becomes all broken over again. This will leave you with one or several scripts essential for classes to work. My money's in particular on ScriptWidgetCore.luac, since it has funny name. All other possible candidates are far too old, you can get them among ancient scripts from version I've seen 'em somewhere on this forum. Good luck.

Here's some similar thread.

Link to comment
Share on other sites

Oh, neat, I didn't know they were around for that long. I just noticed them after looking around AstralMap and things after the 3.0 update.

I'll take a look at WidgetCore, and its gonna be a lot to reverse.

Link to comment
Share on other sites

Great, it looks like WidgetCore does the trick (you can clearly see how it overrides __index).

For others that are interrested:

<?xml version="1.0" encoding="UTF-8" ?>


  <!-- other stuff -->


   <Item href="/Interface/Common/Script/ScriptWidgetCore.luac" />

   <Item href="/Interface/Common/Script/ScriptClassesImplementation.luac" />

        <!-- your scripts using Class(...) here -->


  <!-- other stuff -->


I've yet to run further tests and see whether my actual code works, but so far it doesnt throw any errors anymore.

Link to comment
Share on other sites

So I was right. Damn, I'm good! © Duke Nukem =)

Well, I got question too. Which tool do you use to decompile scripts? I can't find one that actually works. It seems they all need some kind of debug data included in scripts.

Link to comment
Share on other sites

I use ChunkSpy and reverse the code by hand, as most other tools fail on certain stuff thats in there (luadec tends to coredump and stuff).

Link to comment
Share on other sites

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using our site you agree to the Terms of Use