Code: Select all
data:extend{{
type = "custom-input",
name = "FolterCopyExpansion_Copy",
key_sequence = "mouse-button-2 + SHIFT",
linked_game_control = "copy-entity-settings",
action = "lua",
include_selected_prototype=true,
}}
Code: Select all
local CopyFrom = player.selected
if CopyFrom then
if CopyFrom.name:lower() == "storage-chest" then
local Filter = CopyFrom.get_filter(1) -- gets prototype filter
elseif CopyFrom.type:lower():match("inserter") then
local Filter = CopyFrom.get_filter(1) -- gets a normal filter
end
end
I would expect both cases to give the normal filter, not a prototype. If I see something wrong here please let me know as well as this is my first mod in the making.
Edit: it is specifically the name of the filter that is a prototype, I realized this was not clear in my original post.