mirror of
https://github.com/mt-mods/pipeworks.git
synced 2025-05-10 20:50:22 +02:00
mineclone get inv func
This commit is contained in:
parent
0df824f480
commit
6c92b8df8a
25
common.lua
25
common.lua
@ -168,6 +168,31 @@ function fs_helpers.get_inv(y)
|
||||
end
|
||||
end
|
||||
|
||||
table.insert(fs, "style_type[list;size="..size..";spacing="..spacing.."]")
|
||||
table.insert(fs, "list[current_player;main;"..inv_x..","..(inv_y + 1.15)..";"..hotbar_len..","..(inv_size / hotbar_len)..";"..hotbar_len.."]")
|
||||
elseif minetest.get_modpath("mcl_formspec") then
|
||||
local inv_x = 0.22
|
||||
local inv_y = (y + 0.4) or 6.9
|
||||
local size, spacing = 1, 0.1
|
||||
local hotbar_len = 9
|
||||
local inv_size = hotbar_len * 4
|
||||
|
||||
table.insert(fs, "style_type[box;colors=#77777710,#77777710,#777,#777]")
|
||||
|
||||
for i = 0, hotbar_len - 1 do
|
||||
table.insert(fs, "box["..(i * size + inv_x + (i * spacing))..","..inv_y..";"..size..","..size..";]")
|
||||
end
|
||||
|
||||
table.insert(fs, "style_type[list;size="..size..";spacing="..spacing.."]")
|
||||
table.insert(fs, "list[current_player;main;"..inv_x..","..inv_y..";"..hotbar_len..",1;]")
|
||||
|
||||
table.insert(fs, "style_type[box;colors=#666]")
|
||||
for i=0, 2 do
|
||||
for j=0, hotbar_len - 1 do
|
||||
table.insert(fs, "box["..0.2+(j*0.1)+(j*size)..","..(inv_y+size+spacing+0.05)+(i*0.1)+(i*size)..";"..size..","..size..";]")
|
||||
end
|
||||
end
|
||||
|
||||
table.insert(fs, "style_type[list;size="..size..";spacing="..spacing.."]")
|
||||
table.insert(fs, "list[current_player;main;"..inv_x..","..(inv_y + 1.15)..";"..hotbar_len..","..(inv_size / hotbar_len)..";"..hotbar_len.."]")
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user