Tutorial on changing the MoI 3D interface

 From:  Michael Gibson
7231.3 In reply to 7231.2 
Hi Chipp - moi.css is implicitly injected into every HTML document that MoI loads, so it's not needed to specifically declare it anywhere like you normally would with a web browser. This has been the case since MoI v3 - in MoI v2.0 and earlier it was needed to declare it.

If you do declare it, the moi:// protocol handler returns nothing for a request of moi://ui/moi.css to avoid double instances of it since it's always automatically injected.

If you put a query string in the url like ?v=1.1 then I think it that will get loaded and then you will have a double set of style rules from both the automatic injected moi.css as well as the loaded one. But that probably won't do much harm.

If you are doing something like editing moi.css and reloading, make sure to set: DisableFileCaching=y inside moi.ini, that will turn off the file caching that normally happens and should make moi.css loaded fresh on every UI panel being created. By default (with DisableFileCaching=n) moi.css and any other text file that is loaded is cached in memory and future requests just grab it from memory rather than loading from disk again.

The automatic inclusion of moi.css was added in v3 to simplify writing the UI a little bit, so that you don't need to add it in manually which it otherwise would need to be on pretty much every .htm file (you should see that it's not declared on any of the standard UI files in v3), and it also simplifies the HTML parsing process since having it as an external style sheet triggers a somewhat more complex process of pausing the HTML parser while it asynchronously loads the style sheet and has a concept of a "pending but not loaded style sheet". The automatic injected version avoids some of this extra CSS loading processing from happening.

> Or is it in some code somewhere?

It's built in to the UI framework, the moi.css style sheet injection happens to every HTML document that MoI loads.

- Michael