hankinsoft / MudClient

MudClient
3 stars 0 forks source link

[Feature] Custom Components #13

Open dak opened 1 year ago

dak commented 1 year ago

Concept: As a user, I'd like to be able to create and style visual components that I can interact with and can display state information.

Possible Implementation: Allow the creation of one or more resizable WebView components that can be repositioned around the client itself that can be edited with HTML/CSS/JavaScript and has access to the special variables and commands of the client. Preferably provide some sort of two-way binding with client variables as well, or barring that, methods to update client variables from the component and to force the component to redraw from a trigger or alias.

hankinsoft commented 1 year ago

How are you envisioning you would create the html, css, etc? I'm thinking of something like the triggers, aliases, notes window, where the left side has the 'component' and the right side contains the default html/css. Then you can update via scripts in triggers/aliases?

dak commented 1 year ago

Yeah, I don't think it would be unreasonable to expect the JavaScript/HTML/CSS all be inlined with a similar UI to the triggers and aliases. The JavaScript should have access to the same scope/variables as the triggers and aliases, and then just render it in a WebView. I suppose the WebView should preferably also have a way to set/save positioning and sizing as well.

For the positioning, it would be amazing if you could also position and size WebViews either absolutely on the screen or relative to the client view (with relative positioning being "sticky" if the client view is dragged/resized).