shortcut not working but associated custom-input is working

Place to get help with not working mods / modding interface.
Post Reply
SirRichie
Fast Inserter
Fast Inserter
Posts: 244
Joined: Wed Feb 25, 2015 4:50 pm
Contact:

shortcut not working but associated custom-input is working

Post by SirRichie »

Hi,

I am puzzled how to get a shortcut to work. I created a custom selection tool and that is working fine and is perfectly selectable/spawnable with a custom-input. The button also appears on the quickbar but when clicked does nothing.
Can anyone tell me why this is happening?

Here are the relevant parts of my data.lua:

Code: Select all

data:extend({
    {
        type = 'custom-input',
        name = 'toggle-my-tool',
        key_sequence = "CONTROL + ALT + P",
        action = 'spawn-item',
	item_to_spawn="my-tool",
        consuming = 'none',
    },
    {
        type = 'shortcut',
        name = 'my-tool-shortcut',
        action = 'spawn-item',
	item_to_spawn="my-tool",
        style = 'red',
        icon = {
            ...
        },
        associated_control_input="toggle-my-tool",
        technology_to_unlock="",
    },
    {
        type = "selection-tool",
        name = "my-tool",
        ...
    },
})

Post Reply

Return to “Modding help”