How do I add an item to the shortcut list?

Place to get help with not working mods / modding interface.
User avatar
Omnifarious
Filter Inserter
Filter Inserter
Posts: 286
Joined: Wed Jul 26, 2017 3:24 pm
Contact:

How do I add an item to the shortcut list?

Post 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.
Bilka
Factorio Staff
Factorio Staff
Posts: 3470
Joined: Sat Aug 13, 2016 9:20 am
Contact:

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

Post 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
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
User avatar
Omnifarious
Filter Inserter
Filter Inserter
Posts: 286
Joined: Wed Jul 26, 2017 3:24 pm
Contact:

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

Post 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. ;-)
Post Reply

Return to “Modding help”