forked from VoxeLibre/VoxeLibre
WIP: Survival inventory and mcl_chest formspec overhaul. #1
|
@ -1299,27 +1299,58 @@ local function formspec_shulker_box(name)
|
||||||
name = S("Shulker Box")
|
name = S("Shulker Box")
|
||||||
end
|
end
|
||||||
|
|
||||||
return table.concat({
|
local margin = mcl_formspec.margin
|
||||||
|
local padding = mcl_formspec.padding
|
||||||
|
local padding_slim = mcl_formspec.padding_slim
|
||||||
|
local bu = mcl_formspec.itemslot_bu
|
||||||
|
local iu = mcl_formspec.itemslot_iu
|
||||||
|
|
||||||
|
local label_color = mcl_formspec.label_color
|
||||||
|
local label_height = mcl_formspec.label_height
|
||||||
|
local label_y_offset = mcl_formspec.label_y_offset
|
||||||
|
|
||||||
|
local shulker_box_formspec = table.concat{
|
||||||
|
"label[",
|
||||||
|
padding - bu, ",", padding_slim + label_y_offset, ";",
|
||||||
|
F(C(mcl_formspec.label_color, name)),
|
||||||
|
"]",
|
||||||
|
mcl_formspec.create_itemslot_bg(padding, padding_slim + label_height, 9, 3),
|
||||||
|
"list[context;main;",
|
||||||
|
padding, ",", padding_slim + label_height, ";",
|
||||||
|
"9,3;",
|
||||||
|
"]",
|
||||||
|
}
|
||||||
|
|
||||||
|
local inventory_label_y = 2 * padding_slim + label_height + 3 * iu
|
||||||
|
local inventory_formspec = table.concat{
|
||||||
|
"label[",
|
||||||
|
padding - bu, ",", inventory_label_y + label_y_offset, ";",
|
||||||
|
F(C(mcl_formspec.label_color, S("Crafting"))),
|
||||||
|
"]",
|
||||||
|
mcl_formspec.create_itemslot_bg(padding, inventory_label_y + label_height, 9, 3),
|
||||||
|
mcl_formspec.create_itemslot_bg(padding, inventory_label_y + 3 * iu + padding + label_height, 9, 1),
|
||||||
|
"list[current_player;main;",
|
||||||
|
padding, ",", inventory_label_y + label_height, ";",
|
||||||
|
"9,3;9",
|
||||||
|
"]",
|
||||||
|
"list[current_player;main;",
|
||||||
|
padding, ",", inventory_label_y + 3 * iu + padding + label_height, ";",
|
||||||
|
"9,1;",
|
||||||
|
"]",
|
||||||
|
}
|
||||||
|
|
||||||
|
return table.concat{
|
||||||
"formspec_version[4]",
|
"formspec_version[4]",
|
||||||
"size[11.75,10.425]",
|
"size[", 2 * padding + 9 * iu - 2 * bu, ",", 2 * padding + 7 * iu + 2 * (padding_slim + label_height) - 2 * bu, "]",
|
||||||
mcl_formspec.label_style,
|
mcl_formspec.label_style,
|
||||||
|
mcl_formspec.itemslot_style,
|
||||||
|
|
||||||
"label[0.375,0.375;"..F(C(mcl_formspec.label_color, name)).."]",
|
shulker_box_formspec,
|
||||||
|
inventory_formspec,
|
||||||
mcl_formspec.create_itemslot_bg(0.375, 0.75, 9, 3),
|
|
||||||
"list[context;main;0.375,0.75;9,3;]",
|
|
||||||
|
|
||||||
"label[0.375,4.7;"..F(C(mcl_formspec.label_color, S("Inventory"))).."]",
|
|
||||||
|
|
||||||
mcl_formspec.create_itemslot_bg(0.375, 5.1, 9, 3),
|
|
||||||
"list[current_player;main;0.375,5.1;9,3;9]",
|
|
||||||
|
|
||||||
mcl_formspec.create_itemslot_bg(0.375, 9.05, 9, 1),
|
|
||||||
"list[current_player;main;0.375,9.05;9,1;]",
|
|
||||||
|
|
||||||
"listring[context;main]",
|
"listring[context;main]",
|
||||||
"listring[current_player;main]",
|
"listring[current_player;main]",
|
||||||
})
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
local function set_shulkerbox_meta(nmeta, imeta)
|
local function set_shulkerbox_meta(nmeta, imeta)
|
||||||
|
|
Loading…
Reference in New Issue