And what are the limitations? Currently I don't see any reasonable alternatives to this solution.urm wrote: In this case, we have more or less the same limitations as tes3mp server-driven UI. That means that the parts of my tes3mp PR one could call hacky for OpenMW are not hacky at all
Just "designing a completely new API" is a too general idea to have a meaningful discussion. We need specific proposals and examples.The choice between my PR (or something similar) - extending MyGUI and keeping XML layouts - and designing a completely new API is the same choice I've highlighted in the original post.
About the points from the original post:
In my proposal the layout is represented as a tree of Lua tables that is directly editable from code.1. Should we provide a layout declaration, or construct UI entirely in code?
I would allow registering events - just by putting a function into layout. See an example in the post above.If we do have a layout, which features should it have? (e.g. only widget relations and style, like in MyGUI, or maybe registering events and property binds, like in my PR)
Property binding seem less important.
These are important questions, but I think that they all should be handled on Lua side. I assume we will have a built-in Lua script that deals with raw UI models and provides a more high level interface to other scripts. And of course it will be possible to override such built-in script by a mod.2. Most mods would prefer to edit as little of the UI as possible (e.g. add new info to item popups), how can we offer that option?
3. Multiple mods editing the same UI should be as compatible as possible. An entirely different inventory UI (e. g. Skyrim-like lists with 3d item previews) should not necessarily appear any differently to other scripts interacting with it (e.g. ones that handle right click interactions on items).
4. We should probably provide simple functins similar to the MWScript ones, as many modders would probably still have a use for them.
5. Currently styling MyGUI layouts in vanilla style requires a decent amount of work and boilerplate. No matter which approach we pick, we should provide tools which make it easy.
The C++ part of implementation can be relatively simple and just transfer data from Lua tables to MyGUI.