Compare commits

..

3 Commits
1.6.1 ... 1.6.2

Author SHA1 Message Date
e1c0f106cc Fix Luacheck warnings on Ubuntu 22.04 2022-04-26 01:50:25 +02:00
46f1136bb7 Empty slots don't make click sound 2022-04-25 19:24:24 +02:00
e88921fe72 Fix crash 2022-04-25 16:00:49 +02:00
5 changed files with 7 additions and 6 deletions

View File

@ -242,7 +242,7 @@ local function resolve_aliases(hash)
end
end
if newname ~= "" and i3.recipes_cache[oldname] and not hash[newname] then
if newname ~= "" and i3.recipes_cache[oldname] and reg_items[newname] and not hash[newname] then
insert(i3.init_items, newname)
end
end

View File

@ -101,7 +101,7 @@ local function search(data)
for i = 1, #data.items_raw do
local item = data.items_raw[i]
local def = reg_items[item]
local desc = lower(translate(data.lang_code, def and def.description)) or ""
local desc = lower(translate(data.lang_code, def.description)) or ""
local search_in = fmt("%s %s", item, desc)
local temp, j, to_add = {}, 1

View File

@ -215,10 +215,10 @@ local function inv_fields(player, data, fields)
return set_fs(player)
end
local function select_item(player, data, _f)
local function select_item(player, data, fields)
local item
for field in pairs(_f) do
for field in pairs(fields) do
if find(field, ":") then
item = field
break

View File

@ -829,7 +829,7 @@ local function get_tooltip(item, info, pos)
return fmt("tooltip[%s;%s]", item, ESC(tooltip))
end
local function get_output_fs(fs, data, rcp, is_recipe, shapeless, right, btn_size, _btn_size)
local function get_output_fs(fs, data, rcp, is_recipe, shapeless, right, btn_size, btn_size2)
local custom_recipe = i3.craft_types[rcp.type]
local cooking = rcp.type == "cooking"
local fuel = rcp.type == "fuel"
@ -866,7 +866,7 @@ local function get_output_fs(fs, data, rcp, is_recipe, shapeless, right, btn_siz
end
local BTN_SIZE = i3.settings.item_btn_size
local arrow_X = right + 0.2 + (_btn_size or BTN_SIZE)
local arrow_X = right + 0.2 + (btn_size2 or BTN_SIZE)
local X = arrow_X + 1.2
local Y = data.yoffset + 1.4

View File

@ -74,6 +74,7 @@ local styles = string.format([[
style_type[image_button,item_image_button,checkbox,dropdown;border=false;sound=i3_click]
style_type[item_image_button;bgimg_hovered=%s]
style[;sound=]
style[nofav;sound=i3_cannot]
style[pagenum,no_item,no_rcp;font=bold;font_size=18]
style[exit;fgimg=%s;fgimg_hovered=%s;content_offset=0]