From fcf928540f9db07ccea96d5aeb5dbbce5a2dbcb6 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 3 Jun 2017 00:33:15 +0200 Subject: [PATCH] Tweak slider height in Creative inventory --- mods/HUD/mcl_inventory/creative.lua | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/mods/HUD/mcl_inventory/creative.lua b/mods/HUD/mcl_inventory/creative.lua index 3b7cd0d381..e1f89e7df5 100644 --- a/mods/HUD/mcl_inventory/creative.lua +++ b/mods/HUD/mcl_inventory/creative.lua @@ -208,12 +208,9 @@ mcl_inventory.set_creative_formspec = function(player, start_i, pagenum, inv_siz end local pagemax = math.max(1, math.floor((inv_size-1) / (9*5) + 1)) local slider_height - if pagemax == 1 then - slider_height = 4.525 - else - slider_height = 4/pagemax - end - local slider_pos = slider_height*(pagenum-1)+2.23 + local arrow_height = 0.85 + slider_height = (6.2-arrow_height*2) / pagemax + local slider_pos = (slider_height*(pagenum-1)*0.8713125)+2.23 local name = "nix" local formspec = "" local main_list @@ -288,9 +285,9 @@ mcl_inventory.set_creative_formspec = function(player, start_i, pagenum, inv_siz -- Creative inventory slots main_list = "list[detached:creative_"..playername..";main;0,1.75;9,5;"..tostring(start_i).."]" .. -- ... and scroll bar - "image_button[9.02,1.76;0.85,0.6;crafting_creative_up.png;creative_prev;]".. + "image_button[9.02,1.76;"..tostring(arrow_height)..",0.6;crafting_creative_up.png;creative_prev;]".. "image[9.033," .. tostring(slider_pos) .. ";0.78,"..tostring(slider_height) .. ";crafting_slider.png]".. - "image_button[9.02,6.15;0.85,0.6;crafting_creative_down.png;creative_next;]" + "image_button[9.02,6.15;"..tostring(arrow_height)..",0.6;crafting_creative_down.png;creative_next;]" end local function tab(current, check) local img