Some fixes
This commit is contained in:
parent
00042c77e1
commit
c3f050b737
|
@ -31,11 +31,31 @@ local to_compress = {
|
||||||
by = {"lava", "river_water", "water"}
|
by = {"lava", "river_water", "water"}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
["butterflies:butterfly_white"] = {
|
||||||
|
replace = "white",
|
||||||
|
by = {"red", "violet"}
|
||||||
|
},
|
||||||
|
|
||||||
["default:wood"] = {
|
["default:wood"] = {
|
||||||
replace = "wood",
|
replace = "wood",
|
||||||
by = wood_types,
|
by = wood_types,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
["default:tree"] = {
|
||||||
|
replace = "tree",
|
||||||
|
by = {"acacia_tree", "aspen_tree", "jungletree", "pine_tree"},
|
||||||
|
},
|
||||||
|
|
||||||
|
["default:grass_1"] = {
|
||||||
|
replace = "grass_1",
|
||||||
|
by = {"dry_grass_1", "junglegrass", "marram_grass_1", "fern_1"},
|
||||||
|
},
|
||||||
|
|
||||||
|
["carts:rail"] = {
|
||||||
|
replace = "rail",
|
||||||
|
by = {"brakerail", "powerrail"},
|
||||||
|
},
|
||||||
|
|
||||||
["default:sapling"] = {
|
["default:sapling"] = {
|
||||||
replace = "sapling",
|
replace = "sapling",
|
||||||
by = {
|
by = {
|
||||||
|
@ -56,6 +76,11 @@ local to_compress = {
|
||||||
by = {"clay", "coal", "copper", "iron", "tin"}
|
by = {"clay", "coal", "copper", "iron", "tin"}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
["default:gold_ingot"] = {
|
||||||
|
replace = "gold_ingot",
|
||||||
|
by = {"bronze_ingot", "copper_ingot", "steel_ingot", "tin_ingot", "clay_brick"}
|
||||||
|
},
|
||||||
|
|
||||||
["default:leaves"] = {
|
["default:leaves"] = {
|
||||||
replace = "leaves",
|
replace = "leaves",
|
||||||
by = {
|
by = {
|
||||||
|
@ -66,6 +91,8 @@ local to_compress = {
|
||||||
"blueberry_bush_leaves_with_berries",
|
"blueberry_bush_leaves_with_berries",
|
||||||
"bush_leaves",
|
"bush_leaves",
|
||||||
"jungleleaves",
|
"jungleleaves",
|
||||||
|
"pine_bush_needles",
|
||||||
|
"pine_needles",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -147,6 +174,11 @@ local to_compress = {
|
||||||
by = material_tools
|
by = material_tools
|
||||||
},
|
},
|
||||||
|
|
||||||
|
["farming:hoe_steel"] = {
|
||||||
|
replace = "steel",
|
||||||
|
by = {"wood", "stone"}
|
||||||
|
},
|
||||||
|
|
||||||
["stairs:slab_wood"] = {
|
["stairs:slab_wood"] = {
|
||||||
replace = "wood",
|
replace = "wood",
|
||||||
by = material_stairs
|
by = material_stairs
|
||||||
|
@ -166,6 +198,11 @@ local to_compress = {
|
||||||
replace = "wood",
|
replace = "wood",
|
||||||
by = material_stairs
|
by = material_stairs
|
||||||
},
|
},
|
||||||
|
|
||||||
|
["walls:cobble"] = {
|
||||||
|
replace = "cobble",
|
||||||
|
by = {"desertcobble", "mossycobble"}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
local compressed = {}
|
local compressed = {}
|
||||||
|
@ -174,8 +211,7 @@ for k, v in pairs(to_compress) do
|
||||||
compressed[k] = compressed[k] or {}
|
compressed[k] = compressed[k] or {}
|
||||||
|
|
||||||
for _, str in ipairs(v.by) do
|
for _, str in ipairs(v.by) do
|
||||||
local a, b = k:match("(.*):(.*)")
|
local it = k:gsub(v.replace, str)
|
||||||
local it = fmt("%s:%s", a, b:gsub(v.replace, str))
|
|
||||||
insert(compressed[k], it)
|
insert(compressed[k], it)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
14
init.lua
14
init.lua
|
@ -460,12 +460,12 @@ function i3.get_search_filters()
|
||||||
return search_filters
|
return search_filters
|
||||||
end
|
end
|
||||||
|
|
||||||
local function compression_active()
|
local function compression_active(data)
|
||||||
return item_compression and not next(recipe_filters)
|
return item_compression and not next(recipe_filters) and data.filter == ""
|
||||||
end
|
end
|
||||||
|
|
||||||
local function compressible(item)
|
local function compressible(item, data)
|
||||||
return compression_active() and compress_groups[item]
|
return compression_active(data) and compress_groups[item]
|
||||||
end
|
end
|
||||||
|
|
||||||
local function weird_desc(str)
|
local function weird_desc(str)
|
||||||
|
@ -1064,7 +1064,7 @@ local function select_item(player, name, data, _f)
|
||||||
|
|
||||||
if not item then return end
|
if not item then return end
|
||||||
|
|
||||||
if compressible(item) then
|
if compressible(item, data) then
|
||||||
local idx
|
local idx
|
||||||
|
|
||||||
for i = 1, #data.items do
|
for i = 1, #data.items do
|
||||||
|
@ -1662,7 +1662,7 @@ local function get_rcp_extra(player, fs, data, panel, is_recipe, is_usage)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_items_fs(fs, data, extend)
|
local function get_items_fs(fs, data, extend)
|
||||||
if compression_active() then
|
if compression_active(data) then
|
||||||
local new = {}
|
local new = {}
|
||||||
|
|
||||||
for i = 1, #data.items do
|
for i = 1, #data.items do
|
||||||
|
@ -1722,7 +1722,7 @@ local function get_items_fs(fs, data, extend)
|
||||||
|
|
||||||
fs[#fs + 1] = fmt("item_image_button", X, Y, size, size, name, item, "")
|
fs[#fs + 1] = fmt("item_image_button", X, Y, size, size, name, item, "")
|
||||||
|
|
||||||
if compressible(item) then
|
if compressible(item, data) then
|
||||||
local expand = data.expand == name
|
local expand = data.expand == name
|
||||||
|
|
||||||
fs(fmt("tooltip[%s;%s]", item, expand and ES"Click to hide" or ES"Click to expand"))
|
fs(fmt("tooltip[%s;%s]", item, expand and ES"Click to hide" or ES"Click to expand"))
|
||||||
|
|
Ŝarĝante…
Reference in New Issue