🐛 Additional items will not be saved into quickbar sync

This commit is contained in:
oof2win2
2021-02-13 13:50:16 +00:00
parent 16524a92c9
commit b6056544ae

View File

@@ -37,11 +37,28 @@ Commands.new_command('save-quickbar', 'Saves your Quickbar preset items to file'
:add_alias('save-toolbar')
:register(function(player)
local filters = {}
local ignoredItems = {
"blueprint",
"blueprint-book",
"deconstruction-planner",
"spidertron-remote",
"upgrade-planner"
}
local function contains(list, x)
for _, v in pairs(list) do
if v == x then return true end
end
return false
end
for i = 1, 100 do
local slot = player.get_quick_bar_slot(i)
-- Need to filter out blueprint and blueprint books because the slot is a LuaItemPrototype and does not contain a way to export blueprint data
if slot ~= nil and slot.name ~= "blueprint" and slot.name ~= "blueprint-book" then
filters[i] = slot.name
if slot ~= nil then
local ignored = contains(ignoredItems, slot.name)
if ignored == false then
filters[i] = slot.name
end
end
end