Open sprunk opened 1 month ago
btw, we need to rename these functions. The naming style looks completely alien compare to the rest of the Lua API.
The lua api mostly follows the official implementation, which has documentation here: https://mikke89.github.io/RmlUiDoc/pages/lua_manual/api_reference.html
We will need an article for things that deviate from this. I recall a few cases:
context:LoadDocument(filepath, widget)
takes a second argument that is the widget itself.onclick="widget:OnReloadClick()"
. document
is available too?And then general guidance for how RmlUi specifically integrates with Recoil widgets.
Yup, takes an extra parameter to bind to the "widget" parameter in the document's Lua context
That's so inline event handlers can happen.
The only custom component is the texture one. I've not found any reason to make any more than that.
Is the data model in the default RmlUi Lua implementation reactive on more than just the first level? I can look into changing that?
The way I've set up the data model all keys for reactivity are expected to exist at creation. I'm not quite sure what happens/should happen if the same data model is "opened" repeatedly.
The big RmlUi examples widget I've been working on is intended to act as a library of in-game examples with accompanying code
I think reactivity at any depth on the data model would be ideal.
Examples, API listings etc.
AFAICT Lua interface seems to be defined in these functions, dunno about the rest: https://github.com/beyond-all-reason/spring/blob/432f997594b38f4232cf5e7d9f79ba8acd97e57f/rts/Rml/SolLua/RmlSolLua.cpp#L71-L81