mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-22 16:09:33 +01:00
Tweak slider height in Creative inventory
This commit is contained in:
parent
8e58459337
commit
fcf928540f
1 changed files with 5 additions and 8 deletions
|
@ -208,12 +208,9 @@ mcl_inventory.set_creative_formspec = function(player, start_i, pagenum, inv_siz
|
||||||
end
|
end
|
||||||
local pagemax = math.max(1, math.floor((inv_size-1) / (9*5) + 1))
|
local pagemax = math.max(1, math.floor((inv_size-1) / (9*5) + 1))
|
||||||
local slider_height
|
local slider_height
|
||||||
if pagemax == 1 then
|
local arrow_height = 0.85
|
||||||
slider_height = 4.525
|
slider_height = (6.2-arrow_height*2) / pagemax
|
||||||
else
|
local slider_pos = (slider_height*(pagenum-1)*0.8713125)+2.23
|
||||||
slider_height = 4/pagemax
|
|
||||||
end
|
|
||||||
local slider_pos = slider_height*(pagenum-1)+2.23
|
|
||||||
local name = "nix"
|
local name = "nix"
|
||||||
local formspec = ""
|
local formspec = ""
|
||||||
local main_list
|
local main_list
|
||||||
|
@ -288,9 +285,9 @@ mcl_inventory.set_creative_formspec = function(player, start_i, pagenum, inv_siz
|
||||||
-- Creative inventory slots
|
-- Creative inventory slots
|
||||||
main_list = "list[detached:creative_"..playername..";main;0,1.75;9,5;"..tostring(start_i).."]" ..
|
main_list = "list[detached:creative_"..playername..";main;0,1.75;9,5;"..tostring(start_i).."]" ..
|
||||||
-- ... and scroll bar
|
-- ... 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[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
|
end
|
||||||
local function tab(current, check)
|
local function tab(current, check)
|
||||||
local img
|
local img
|
||||||
|
|
Loading…
Reference in a new issue