Page 1 of 1

How do I add an item to the shortcut list?

Posted: Mon Mar 04, 2019 6:52 pm
by Omnifarious
I can see various bits in the Lua interfaces mentioning shortcuts, the 'toggle roboport' and 'toggle alt-mode' thing. And it's clear from the way that part of the interface works that the list should be configurable so mods can add shortcuts that the player can choose to have appear in the bar.

How does this work? It looks like a prototype is needed or something. But it's not really clear. Has anybody made this work?

I want to add a shortcut for turning LD AutoCircuit on and off easily, which will make it more useful and less 'scary' for people to use, because the biggest objection,(one that I feel is greatly overblown) is that even under the restrictive conditions under which LD AutoCircuit will string up circuit wires between long distance power poles, that they're worried about accidentally connecting things.

Re: How do I add an item to the shortcut list?

Posted: Mon Mar 04, 2019 6:54 pm
by Bilka
See https://wiki.factorio.com/Prototype/Shortcut. This bug report mod adds one, if you need a real code example: viewtopic.php?f=11&t=66556

Re: How do I add an item to the shortcut list?

Posted: Mon Mar 04, 2019 9:09 pm
by Omnifarious
Bilka wrote: Mon Mar 04, 2019 6:54 pm See https://wiki.factorio.com/Prototype/Shortcut. This bug report mod adds one, if you need a real code example: viewtopic.php?f=11&t=66556
Thanks, that should be really helpful. Now to apply my awesome programmer art skills to making a decent icon for this. ;-)