diff options
author | JP Guerrero <jeanpatrick.guerrero@gmail.com> | 2016-12-14 18:29:08 +0100 |
---|---|---|
committer | JP Guerrero <jeanpatrick.guerrero@gmail.com> | 2016-12-14 18:32:31 +0100 |
commit | 5469940c3ce2c9573164c0f15c5bc54f83ffdf86 (patch) | |
tree | 8c4829f0dabf69cee92670024d02f3586b32fd7d /init.lua | |
parent | ee4cfc119a923d50b9585dbfa48e722bb828b912 (diff) |
Set crafting grid limit to 5 for big recipes
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -92,9 +92,10 @@ function craftguide:get_recipe(player_name, tooltip_l, item, recipe_num, recipes -- Lua 5.3 removed `table.maxn`, use this alternative in case of breakage: -- https://github.com/kilbith/xdecor/blob/master/handlers/helpers.lua#L1 local rows = ceil(table.maxn(items) / width) - local btn_size = 1 + local btn_size, craftgrid_limit = 1, 5 - if recipe_type == "normal" and width > 6 or rows > 6 then + if recipe_type == "normal" and + width > craftgrid_limit or rows > craftgrid_limit then formspec = formspec.."label["..(offset_X)..","..(iY+2).. ";Recipe is too big to\nbe displayed (".. width.."x"..rows..")]" |