Implement a Lua package with templates for standard Morrowind-style UI
After !1637 (merged) is merged, it will be possible to make Morrowind-styled UI from Lua. However, the template code for that is fairly bulky, so shipping it with every mod is not optimal. An example: https://gitlab.com/uramer/openmw-lua-examples/-/blob/master/Clock/scripts/Clock/templates.lua
We will need to implement these templates for the UI dehardcoding eventually in any case.
The package should be as modular as possible, so that it can be overridden by UI mods like https://www.nexusmods.com/morrowind/mods/48893 piece by piece. There are two ways to achieve this:
- Return mutable tables from the packages. have mods assign different templates and resources into the table
- Split it into multiple files, expect mods to override them entirely using VFS
Advantages of the mutable table approach:
- Can be done at runtime, e. g. after user configuration in the settings
- Doesn't prevent us from changing the file/directory structure
- In multiplayer, will allow players to have different Ui styles
- Style changes can happen during gameplay. E. g. entering some area (an Oblivion gate, a cave, ...) could change your UI styles temporarily
- If we add more templates, they will likely work at least somewhat even with non-supporting mods
Advantages of the VFs approach:
- Simpler and more performant
- No need to have a script attached to every player
- Doesn't require a way to update all UI at once, as the changes happen before runtime
Technically, we could allow both, if we do this carefully.