Tweak slider height in Creative inventory

This commit is contained in:
Wuzzy 2017-06-03 00:33:15 +02:00
parent 8e58459337
commit fcf928540f
1 changed files with 5 additions and 8 deletions

View File

@ -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