Page 1 of 1

An API for the GUI

Posted: Sat Jan 30, 2016 3:54 pm
by Ghoulish
Forum member MrDrummer has a tool belt mod https://forums.factorio.com/forum/vie ... 92&t=17033 I asked if it were possible to alter the dimensions of the tool belt so that rather than have 2 blocks of 5 (and additional tool belts added vertically) To have a tool belt of 2 blocks of 10. This would spread out the UI across the bottom of the screen and at least in my humble opinion is a more natural or standard UI design that we have all become accustomed too over the years.
MrDrummer wrote:Pretty sure this is not something I can alter easily... I am pretty sure the tool-belt as we know it is hard-coded in terms of width/functionality other than how many rows we have. Even if I did a GUI there are still some things that i am not sure about/will not work for sure, i.e. toolbelt swapping and actually getting the GUI to save the values as you would expect.
I am certainly not the one who is able to do the above (novice Lua programmer here), though I would either make a suggestion for a mod to do this or suggest it for 0.13.
I tend to have main slots set to specific items, then leave at least 15 slots free for blueprints and any other item depending on what you are doing.
Thanks for the suggestion :)
So I would firstly like to check that the UI is hard coded? And if so firstly propose that a wider spread out tool belt (2 blocks of ten, or more buttons) Would be a better design.

And secondly evolve this idea further to have an Application Programming Interface for the UI, so the community could then design their own layouts. And from judging the quality of mods this community already produces.. Well hell I can hardly wait to see what they come up with! :) I do understand a change like this is not a simple task, but feel it would be a positive step forward in Factorio development. And this is why. Look at the early days of World of Warcraft. The UI was up to Blizzard usual high standards, and fully functional, but because the community could tinker with the code through lua, over time some pretty epic addons/mods were released, and the point here is that Blizzard then integrated those ideas in to vanilla, for example scrolling combat text, or much later quest logging. The best the many minds of the community could come up with was given to all. And more than this led to mods which added awesome levels of customisation, should you wish - complexity that would be over the top for vanilla.

Think of all of the cool layouts you could have, simple access to features directly off the tool belt. Options, blue prints, settings. Whatever you may happen to want, or neglect. An API for the UI would be a positive step for Factorio.

(edit: Steampunk themed Factorio layout anyone?)

Re: An API for the GUI

Posted: Sat Jan 30, 2016 3:59 pm
by Zeblote
All the guis you see in factorio are hard coded using their internal gui library, in c++. None of them can be modified by mods.
Oh, and you can't even use the gui library in your mods. Only very few elements are exposed, like you can't even make a scroll bar.

Quite honestly, the current gui api for mods is a joke.

Re: An API for the GUI

Posted: Sat Jan 30, 2016 7:34 pm
by keyboardhack
Zeblote wrote:All the guis you see in factorio are hard coded using their internal gui library, in c++. None of them can be modified by mods.
That's not really true. Go to data\core\prototypes\styles.lua
In there you can change the menus styles, positions, colors, etc.

Re: An API for the GUI

Posted: Sat Jan 30, 2016 7:46 pm
by Zeblote
keyboardhack wrote:
Zeblote wrote:All the guis you see in factorio are hard coded using their internal gui library, in c++. None of them can be modified by mods.
That's not really true. Go to data\core\prototypes\styles.lua
In there you can change the menus styles, positions, colors, etc.
Yeah, I guess you can change the style. But not while the game is running and you can't change anything else, like add new elements.

Re: An API for the GUI

Posted: Sun Jan 31, 2016 1:40 am
by ssilk
Because that is not done like so. :) See current HTML5 etc: The interfaces works with layers/divs. If you want to show another content you swap the layers/divs (whatever), instead of changing the current.

Re: An API for the GUI

Posted: Wed Feb 03, 2016 7:08 pm
by Ghoulish
Point taken ssilk.

It is a shame though, I do want to ask if there are plans to update the GUI, or is it more a polish thing to come down the line? It would be great to be able to change the layout of toolbelts/bars for example (are there plans for this?). Or even to be able to choose where various windows open and then lock them in place, the main UI window always opening slap bang center of screen.. It's not like it's annoying, but shouldn't I be able to move the window if I prefer? Couldn't we be given options when it comes to UI layout?

The research screen is less than intuitive too, trying to figure out the research you need to do before you can get X or Y is a bit of a minefield, and comes through experience rather than the UI clearly showing various paths.

Re: An API for the GUI

Posted: Thu Feb 04, 2016 8:08 am
by Smarty