Shortcuts


Adds a host of useful shortcuts to improve QOL. Shortcuts for the artillery remote, discharge defense remote, tree deconstructor, and toggles for equipment, rail blocks and the player lamp. Also adds in a customizable grid overlay, far zoom and an artillery wagon toggle shortcut. See mod portal FAQ page for a full list of shortcuts and supported mods.

Utilities
4 years ago
0.17
24

b Crash while attempting to enable a disabled shortcut

5 years ago
(updated 5 years ago)

I have the night vision equipment disable shortcut turned off so that I don't have an overly full shotcuts menu, but it crashes when I go to insert night vision equipment.

Error while running event Shortcuts::on_player_placed_equipment (ID 38)
Unknown custom shortcut prototype: night-vision-equipment
stack traceback:
    __Shortcuts__/control.lua:145: in function 'enable_it'
    __Shortcuts__/control.lua:167: in function 'reset_state'
    __Shortcuts__/control.lua:370: in function <__Shortcuts__/control.lua:368>
stack traceback:
    [C]: in function 'set_shortcut_available'
    __Shortcuts__/control.lua:145: in function 'enable_it'
    __Shortcuts__/control.lua:167: in function 'reset_state'
    __Shortcuts__/control.lua:370: in function <__Shortcuts__/control.lua:368

Perhaps the following might work:

        local enabled_setting = settings.startup[type]
        local enabled = true
        if enabled_setting then
            enabled = enabled_setting.value
        end
        if enabled then
            player.set_shortcut_available(type, true)
            player.set_shortcut_toggled(type, true)
        end
4 years ago

Sorry for the delay, fixed for the next release

New response