smart_sfinv_creative_bymod: introduce mods mapping

(hardcoded) merge some default groups from modpacks (mesecons, my_doors, maidroid, shields into 3d_armor)
to clearup the "others" group
This commit is contained in:
Alexander Weber 2019-01-11 10:57:46 +01:00
parent dd298406ea
commit c2f0086916
2 changed files with 64 additions and 4 deletions

View File

@ -1,6 +1,8 @@
local min_group_items = 8 --Todo: setting
local mapping = dofile(minetest.get_modpath(minetest.get_current_modname())..'/mapping.lua')
------------------------------------------------------------------------
-- Item groups collection
------------------------------------------------------------------------
@ -22,13 +24,14 @@ end
-- Get group assignment for item
------------------------------------------------------------------------
local function get_group_assingment(def)
-- Order all stairs and slabs to the stairs group
if def.groups.stair or def.groups.slab then
return "stairs"
for group, _ in pairs(def.groups) do
if mapping.by_group[group] then
return mapping.by_group[group]
end
end
-- Group by mod origin by default
return def.mod_origin
return mapping.by_mod[def.mod_origin] or def.mod_origin
end
------------------------------------------------------------------------

View File

@ -0,0 +1,57 @@
return {
by_mod = {
my_castle_doors = 'my_doors',
my_cottage_doors = 'my_doors',
my_default_doors = 'my_doors',
my_fancy_doors = 'my_doors',
my_future_doors = 'my_doors',
my_garage_door = 'my_doors',
my_hidden_doors = 'my_doors',
my_misc_doors = 'my_doors',
my_old_doors = 'my_doors',
my_saloon_doors = 'my_doors',
my_sliding_doors = 'my_doors',
mesecons_alias = 'mesecons',
mesecons_blinkyplant = 'mesecons',
mesecons_button = 'mesecons',
mesecons_commandblock = 'mesecons',
mesecons_delayer = 'mesecons',
mesecons_detector = 'mesecons',
mesecons_doors = 'mesecons',
mesecons_extrawires = 'mesecons',
mesecons_fpga = 'mesecons',
mesecons_gates = 'mesecons',
mesecons_hydroturbine = 'mesecons',
mesecons_insulated = 'mesecons',
mesecons_lamp = 'mesecons',
mesecons_lightstone = 'mesecons',
mesecons_luacontroller = 'mesecons',
mesecons_materials = 'mesecons',
mesecons_microcontroller = 'mesecons',
mesecons_movestones = 'mesecons',
mesecons_mvps = 'mesecons',
mesecons_noteblock = 'mesecons',
mesecons_pistons = 'mesecons',
mesecons_powerplant = 'mesecons',
mesecons_pressureplates = 'mesecons',
mesecons_random = 'mesecons',
mesecons_receiver = 'mesecons',
mesecons_solarpanel = 'mesecons',
mesecons_stickyblocks = 'mesecons',
mesecons_switch = 'mesecons',
mesecons_torch = 'mesecons',
mesecons_walllever = 'mesecons',
mesecons_wires = 'mesecons',
maidroid_core = 'maidroid',
maidroid_tool = 'maidroid',
shields = '3d_armor',
},
by_group = {
-- Order all stairs and slabs to the stairs group
stair = 'stairs',
slab = 'stairs',
}
}