Forums » Suggestions
RmlUi - Support for iterating over Proxies with ipairs() and pairs()
According to the official RmlUi docs, it should be possible to iterate over Proxy objects using `ipairs()` or `pairs()`. At present it is not possible to do this.
Being able to use this functionality would make it easier to debug or investigate objects in the RmlUi DOM. While it is true that some information about Elements can be gleaned from the integrated RmlUi Debugger, sometimes it is nice to be able to just print it out to console. At the very least, it would be helpful to be able to use this on Event objects and the EventParametersProxy.
Could you add support for the use of `ipairs()` and `pairs()` on Proxy objects in RmlUi?
-------------------------------------------------------------------
I've included a plugin that should be useful for testing this.
For a basic test on RmlUiContextsProxy, ContextDocumentsProxy, ElementChildNodesProxy, and 'ElementAttributesProxy, follow these steps. These steps are necessary for a couple different reasons.
1) Login
2) ReloadInterface()
3) Open Options
4) rmlpairs.init()
5) rmlpairs.printall()
To print the pairs of any Proxy, you can use `rmlpairs.print(<proxy>)`
[Pastebin] rmlpairs - main.lua
[Pastebin] rmlpairs - output
Being able to use this functionality would make it easier to debug or investigate objects in the RmlUi DOM. While it is true that some information about Elements can be gleaned from the integrated RmlUi Debugger, sometimes it is nice to be able to just print it out to console. At the very least, it would be helpful to be able to use this on Event objects and the EventParametersProxy.
Could you add support for the use of `ipairs()` and `pairs()` on Proxy objects in RmlUi?
-------------------------------------------------------------------
I've included a plugin that should be useful for testing this.
For a basic test on RmlUiContextsProxy, ContextDocumentsProxy, ElementChildNodesProxy, and 'ElementAttributesProxy, follow these steps. These steps are necessary for a couple different reasons.
1) Login
2) ReloadInterface()
3) Open Options
4) rmlpairs.init()
5) rmlpairs.printall()
To print the pairs of any Proxy, you can use `rmlpairs.print(<proxy>)`
[Pastebin] rmlpairs - main.lua
[Pastebin] rmlpairs - output