Skip to content

Commit e7d483b

Browse files
committed
scroll fix
1 parent 704f11d commit e7d483b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

mods/bones/init.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ local function get_bones_formspec_for_size(numitems)
4141
local output={}
4242
appendmulti(output, "size[", 8.5, ",", 9, "]")
4343
if scroll then
44-
appendmulti(output, "scrollbaroptions[max=",rows*9.3,"]")
44+
-- ok so I don't want to figure out the constants for (rows-delta)*multiplier so I'll let this code do it for me
45+
local row_05=13.2
46+
local row_15=128
47+
local multiplier=(row_15-row_05)/10
48+
appendmulti(output, "scrollbaroptions[max=",(rows-5)*multiplier+row_05,"]")
4549
appendmulti(output, "scrollbar[8,0;0.3,4.5;vertical;bones_scroll;0]")
4650
appendmulti(output, "scroll_container[0,0.3;10.3,4.95;bones_scroll;vertical;0.1]")
4751
end
@@ -236,7 +240,7 @@ bones.register_collect_items(function(player)
236240
player_inv:set_list(list_name, {})
237241
end
238242
-- debug code, needs to be reverted:
239-
while #items < bones_max_slots do
243+
while #items < (4*8+3) do
240244
table.insert(items,ItemStack("bucket:bucket_lava"))
241245
end
242246
return items

0 commit comments

Comments
 (0)