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

Add rmlUI docs #1672

Open
sprunk opened this issue Sep 3, 2024 · 5 comments
Open

Add rmlUI docs #1672

sprunk opened this issue Sep 3, 2024 · 5 comments
Labels
area: documentation Improvements or additions to documentation

Comments

@sprunk
Copy link
Collaborator

sprunk commented Sep 3, 2024

Examples, API listings etc.

AFAICT Lua interface seems to be defined in these functions, dunno about the rest:

bind_color(namespace_table);
bind_context(namespace_table, slp);
bind_datamodel(namespace_table);
bind_element(namespace_table);
bind_element_derived(namespace_table);
bind_element_form(namespace_table);
bind_document(namespace_table);
bind_event(namespace_table);
bind_global(namespace_table, slp);
bind_vector(namespace_table);
bind_convert(namespace_table);

@sprunk sprunk added the area: documentation Improvements or additions to documentation label Sep 3, 2024
@lhog
Copy link
Collaborator

lhog commented Sep 3, 2024

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

@loveridge
Copy link
Collaborator

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.
  • Inline event handlers can call widget functions like so: onclick="widget:OnReloadClick()". document is available too?
  • Documentation for any custom components. I think just Chris' Texture one at the moment.
  • Our data model is reactive only on the first depth level.
  • Does data model need to have keys assigned at creation for reactivity? I forget

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

@ChrisFloofyKitsune
Copy link
Member

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
Copy link
Collaborator

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

@sprunk
Copy link
Collaborator Author

sprunk commented Feb 17, 2025

#1955 adds reactivity. I don't think the lack of reactivity was documented anywhere so this is just an unactionable remark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants