beyond-all-reason / spring

A powerful free cross-platform RTS game engine
https://beyond-all-reason.github.io/spring/
Other
214 stars 100 forks source link

Add rmlUI docs #1672

Open sprunk opened 1 month ago

sprunk commented 1 month ago

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

lhog commented 1 month ago

btw, we need to rename these functions. The naming style looks completely alien compare to the rest of the Lua API.

loveridge commented 1 month ago

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:

And then general guidance for how RmlUi specifically integrates with Recoil widgets.

ChrisFloofyKitsune commented 1 month ago

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

loveridge commented 1 month ago

I think reactivity at any depth on the data model would be ideal.