This is a
major request, but I've already run into a situation where I'd like this.
Basically, right now, a mod (and for that matter, the core game) may only display data to the end-user through some really, really crude means; a fixed UI only allows for text to be shown via system messages. Everything else is rigidly defined.
I recently developed a basic diplomatic relationships system, and it works (i.e., players can dynamically alter their relations with the Factions, and the Factions can alter their relationships with one another), but displaying the data to the end-user is already a major hassle; for just four Factions and data that changes daily, I have to spam 4 system messages.
I've been trying to think about these issues and how they could get dealt with. What I came up with is a two-part system:
1.
Boxes would be definable, moveable areas X,Y that could be layered, closed and minimized. They would consist of definitions of their dimensions, their initial position, booleans for whether they're moveable, can have another Box over them, can be closed or minimized, and could contain the following objects:
A. Textline; a string defined by code with values for left / right alignment (to be friendly with Picture) and a RGB color.
B. Picture; this would be a graphics reference, centered by default X,Y or left/right aligned. Limit 1 per Textline, max.
So you'd set up a Box roughly like:
Box boxxy = new Box(90,100, 1000, 700, false, false, false, true);
boxxy.Textline[1].Picture("mods/mymod/graphics/ui/blah","left");
boxxy.Textline[1](myString,"left");
Which would give you a box, 90/100 pixels in size, 1000/700 initial position, not mobile nor cover-able nor closeable but can be minimized, with a picture on the left and text starting 3 pixels or so from that picture.
End-users would be responsible for keeping text within the bounds; text that exceeded the width of a Box would get cut off.
2.
Pages would be accessible only via the Travel screen via (some UI element). Pages would be like Boxes, but they would be whole new screens and would have the additional scriptable elements:
A. Button: performs a script or transitions to another Page.
B. SubBox: creates a Box on top of the Page that can be referred to by this Page.
With these two elements, most simple UI tasks could be accomplished; for example, we could build dialogue systems and realtime update stuff using Boxes and various ways to manage or view complex data via Pages.
For a really good example of how implementing such a system led to vast flexibility for the developers and made a lot of serious modding practical, I'd suggest looking at the
Mount and Blade Presentation / Game Menu system, which the team used to build most of the content UI for their entire game.
It will probably save a lot of dev time in the long run to build it this way, simply because once it's working, prototyping the stuff needed to do all the storytelling / interactive-outside-the-main-game becomes very fluid and it's not about fighting with UI, it's merely about presentation and providing the data players will want (which will be a lot, if the larger stuff that you've hinted at happens).
If the system was kept pretty non-moddable outside these basic parameters, it might not be too evil to get it done. I can see a lot of good things that could come from this.