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