Skin Editor
Moderators: jiri, drakinite, Addon Administrators
-
- Posts: 159
- Joined: Wed May 10, 2017 1:38 pm
Skin Editor
Hey, I was thinking it might be nice to have an in-app skin editor (for small edits, like colors and fonts and such), and am even willing to build it, but I couldn't find anything in the API that had anything to do with CSS, LESS, or skins at all. Even if there was just a way of finding out which skin the user currently has running, I could probably figure it out, but it would more likely require access to LESS processing, file I/O, skin reloading, etc. Would this be something you guys might be willing to consider putting in, so I could make it, or is this a pipe dream?
Re: Skin Editor
Hi, yes, looks like a useful tool. As for the api, you might need app.currentSkin() and app.currentLayout() to know what to edit and window.doReload() to apply the skin changes. This currently performs a complete window re-load, in order to properly apply any possible changes in JS (a skin can contain any custom JS code). We'll also try to add another api function to just reload CSS, in order to be able to perform quick hacks.
Jiri
Jiri
-
- Posts: 159
- Joined: Wed May 10, 2017 1:38 pm
Re: Skin Editor
I'm still not seeing currentSkin or currentLayout in App in the API reference (I'm using the one linked to in the announcement). Am I looking at an outdated reference? Also, are scripts/addons currently capable of loading and saving files on the filesystem?
Re: Skin Editor
Sorry about this, the docs missed some newer stuff, it's updated now (including new filesystem methods).
Jiri
Jiri
-
- Posts: 159
- Joined: Wed May 10, 2017 1:38 pm
Re: Skin Editor
Cool, I can see them now. May I request adding a Skin class to the system that will contain info like what's in the info.json, as well as the skin's system file path? Right now there's no way to guarantee you're getting the right skin path just based off of the string that App.currentSkin() returns. Access to the CSS and LESS engines would be helpful, too, but not necessary.
Re: Skin Editor
Skin's are located always in 'Skins' subfolder where MM is installed.
How to make a debuglog - step 4b: viewtopic.php?f=30&t=86643
-
- Posts: 159
- Joined: Wed May 10, 2017 1:38 pm
Re: Skin Editor
Yes, but the name registered through info.json can't be guaranteed to correspond to the name of the folder in which that skin resides in.
Re: Skin Editor
For a next build i've updated skin API. Using app.getSkins() (and app.getLayouts()) you will receive list of objects with these properties: title, id, description, version, author, path, isCurrent. For skin/layout load you can use methods uitools.activateSkin(skin) or uitools.activateLayout(layout).
How to make a debuglog - step 4b: viewtopic.php?f=30&t=86643
-
- Posts: 159
- Joined: Wed May 10, 2017 1:38 pm
Re: Skin Editor
Awesome, thanks PetrCBR. I look forward to trying them out.