Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with lua bindings overriding global table functions #95

Closed
JFT90 opened this issue Apr 6, 2020 · 2 comments · Fixed by #137
Closed

Problem with lua bindings overriding global table functions #95

JFT90 opened this issue Apr 6, 2020 · 2 comments · Fixed by #137
Labels
help wanted Extra attention is needed Lua Lua binding issues

Comments

@JFT90
Copy link

JFT90 commented Apr 6, 2020

Hi,
first of all thank you for all the great work on rmlui!

I am currently replacing cegui with rmlui in a project of mine.
I am trying to use as much lua code for UI event handling etc. as possible and noticed that
the global table overrides in

void OverrideLuaGlobalFunctions(lua_State* L)

break some of my other lua code using the iterators pairs , ipairs ( I simply iterate over elements
in a lua table and the iterators return nil where the standard iterator returns a valid entry. )

At the moment I temporarily fixed this problem by deleting the overrides, which breaks the iteration over ElementAttributes for example.

A correct fix would be to only override the iterators for the tables that need the special iterators instead of overriding iteration behavior globally.

Edit: I am using lua 5.3

@mikke89
Copy link
Owner

mikke89 commented May 23, 2020

Hi, and thank you for the encouragement. Glad to see more people involved.

Unfortunately, the Lua implementation is not my strong suite, and I don't really know it well enough to be able to help in this case. Any help fixing this would be appreciated.

@mikke89 mikke89 added the help wanted Extra attention is needed label May 23, 2020
@JFT90
Copy link
Author

JFT90 commented May 24, 2020

Ok, I will try to dive into the Lua implementation when I have some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed Lua Lua binding issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants