Tolua throws error on equal op between userdatas

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

rockoz
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Tue Sep 22, 2009 02:26

Tolua throws error on equal op between userdatas

Postby rockoz » Fri Jun 18, 2010 06:15

Yesterday I was working on CEGUI lua script, I met this error when comparing two CEGUI windows:

Code: Select all

"Attempt to perform operation on an invalid operand"


And my script is like this:

Code: Select all

function OnClicked(args)
    local guiWnd = CEGUI.toWindowEventArgs(args).window
    if guiWnd == oButtonOK then
        --TODO: Start scene
    elseif guiWnd == oButtonCancel then
        --TODO: end scene
    end


When guiWnd is actual equal to oButtonOK, the script works perfect
This error occurs only when guiWnd is different from oButtonOK, e.g. click the oButtonCancel.

I find CEGUI is using Tolua++1.0.92 and has some mod on it. And Tolua++1.0.93 seems to have solved this problem.
But since I am a beginner in Lua :oops: , it is hard to update the Tolua version. So this conclusion is not tested.

Anyone can help?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Tolua throws error on equal op between userdatas

Postby CrazyEddie » Mon Jun 21, 2010 08:53

I don't have any info regarding this issue. If what you say is the case, it sounds like an issue with tolua++, so there's not much we can do about that except confirm the issue, confirm the fix, and apply it ;) I'll add a ticket so that this is not forgotten.

In the mean time, I think a workaround solution is perhaps to compare the window names rather than the window references directly.

HTH, and thanks for raising the issue.

CE.

rockoz
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Tue Sep 22, 2009 02:26

Re: Tolua throws error on equal op between userdatas

Postby rockoz » Mon Jun 21, 2010 10:13

Thank you for your reply CE

Code: Select all

In the mean time, I think a workaround solution is perhaps to compare the window names rather than the window references directly.


Actually I'm using this method as solution. :rofl:

And I will try to update the tolua++ version if I have spare time.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 7 guests