mirror of
https://github.com/minetest/minetest_game.git
synced 2025-06-28 04:40:22 +02:00
Unify hotbar formspec for sfinv and creative
sfinv: Add lists above the content to support listrings in content. Reuse sfinv inventory lists for creative.
This commit is contained in:
@ -37,6 +37,14 @@ function sfinv.get_nav_fs(player, context, nav, current_idx)
|
||||
end
|
||||
|
||||
local theme_inv = [[
|
||||
image[0,4.7;1,1;gui_hb_bg.png]
|
||||
image[1,4.7;1,1;gui_hb_bg.png]
|
||||
image[2,4.7;1,1;gui_hb_bg.png]
|
||||
image[3,4.7;1,1;gui_hb_bg.png]
|
||||
image[4,4.7;1,1;gui_hb_bg.png]
|
||||
image[5,4.7;1,1;gui_hb_bg.png]
|
||||
image[6,4.7;1,1;gui_hb_bg.png]
|
||||
image[7,4.7;1,1;gui_hb_bg.png]
|
||||
list[current_player;main;0,4.7;8,1;]
|
||||
list[current_player;main;0,5.85;8,3;8]
|
||||
]]
|
||||
@ -45,11 +53,9 @@ function sfinv.make_formspec(player, context, content, show_inv, size)
|
||||
local tmp = {
|
||||
size or "size[8,8.6]",
|
||||
sfinv.get_nav_fs(player, context, context.nav_titles, context.nav_idx),
|
||||
show_inv and theme_inv or "",
|
||||
content
|
||||
}
|
||||
if show_inv then
|
||||
tmp[#tmp + 1] = theme_inv
|
||||
end
|
||||
return table.concat(tmp, "")
|
||||
end
|
||||
|
||||
|
@ -9,14 +9,6 @@ sfinv.register_page("sfinv:crafting", {
|
||||
image[4.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]
|
||||
listring[current_player;main]
|
||||
listring[current_player;craft]
|
||||
image[0,4.7;1,1;gui_hb_bg.png]
|
||||
image[1,4.7;1,1;gui_hb_bg.png]
|
||||
image[2,4.7;1,1;gui_hb_bg.png]
|
||||
image[3,4.7;1,1;gui_hb_bg.png]
|
||||
image[4,4.7;1,1;gui_hb_bg.png]
|
||||
image[5,4.7;1,1;gui_hb_bg.png]
|
||||
image[6,4.7;1,1;gui_hb_bg.png]
|
||||
image[7,4.7;1,1;gui_hb_bg.png]
|
||||
]], true)
|
||||
end
|
||||
})
|
||||
|
Reference in New Issue
Block a user