The HTML interface module needs work.
Created by: PJB3005
It's simple, the fucking thing needs work, a lot of it.
Here's a couple issues:
- Code is a fucking mess,
getClient()
AND_getClient()
, really? - While it's (much) better than NanoUI, the more advanced the UI gets, the more hacky it gets, take for example the power monitor chart, first we'll get a ton of copy pasted code for every UI that needs a chart further down the line, not to mention issues like the chart updating while you're not able to use the computer.
- It's still not at the NanoUI level in terms of how good it looks, certain UI elements / their styling requires hacks.
- It's not very easy to work with.
- Even with all the above a fucking toggle switch is hacky.
So here's my proposal!
So, we keep the base functions, however, we add a new "widget" system.
Take the following code:
var/const/dat = {"
<div class="item">
<div class="itemLabel">Input: </div>
<div class="itemContent">
<span id="inputtoggles">
<a href="?src=\ref[interface];power=1">Enable</a> <a href="?src=\ref[interface];power=0" class="linkDanger">Disable</a>
</span>
</div>
</div>
"}
As you can see, there's a span containing both of the buttons, for the sake of making the button not a fucking pain to update.
With widgetstm:
var/const/dat = {"
<div class="item">
<div class="itemLabel">Input: </div>
<div class="itemContent">
[interface.new_widget(/datum/html_widget/toggle, "powerToggle" list("Enable", "Disable", "powerOn", "powerOff"))]
</div>
</div>
"}
This treats it much more like [every modern interface system like GTK, Qt, WPF, Winforms], to be MUCH more consistent, and easier to do.
These widgets would, of course, very easily be controllable, style depending on the UI they're in, ...
And then shit like walking away will make them change style like NanoUI...