summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorJP Guerrero <jeanpatrick.guerrero@gmail.com>2016-12-14 15:59:29 +0100
committerJP Guerrero <jeanpatrick.guerrero@gmail.com>2016-12-14 15:59:29 +0100
commitee4cfc119a923d50b9585dbfa48e722bb828b912 (patch)
treead2c992f9a322fc35158fdb5e9fdb71d89c578da /init.lua
parent1884c92775b41ba74d8a1276dac296ab001ea904 (diff)
Polish displaying of big recipes
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua11
1 files changed, 3 insertions, 8 deletions
diff --git a/init.lua b/init.lua
index ab0ed27..28c3afe 100644
--- a/init.lua
+++ b/init.lua
@@ -103,14 +103,9 @@ function craftguide:get_recipe(player_name, tooltip_l, item, recipe_num, recipes
local Y = ceil(i / width + ((iY + 2) - min(2, rows)))
if recipe_type == "normal" and width > 3 or rows > 3 then
- btn_size = 3 / width
- if width > 3 then
- X = (btn_size * (i % width)) + offset_X
- end
- if rows > 3 then
- Y = (btn_size * floor((i-1) / rows)) + (iY + 3) -
- min(2, rows)
- end
+ btn_size = width > 3 and 3 / width or 3 / rows
+ X = (btn_size * (i % width)) + offset_X
+ Y = (btn_size * floor((i-1) / width)) + (iY + 3) - min(2, rows)
end
local groups = extract_groups(v)