Better, table-based, factions listing

master
Solebull 2019-06-09 23:23:39 +02:00
parent e814c99e08
commit 5daea1b9c4
1 changed files with 5 additions and 4 deletions

View File

@ -9,14 +9,16 @@ sfinv.register_page("sfinv:factions_ui", {
minetest.log("error", "Listing faction :")
local list = factions.get_faction_list()
local t = { }
for k,f in pairs(list) do
minetest.log("error", "Faction "..k.." list : "..f)
t[#t+1] = f
end
local facnames = table.concat(t, ",")
-- list[inventory_location;list;0,0;8,4;]
return sfinv.make_formspec(player, context, [[
label[0,0;Nom]
textlist[0,1;8,3;faclist;f1,f2,...,f3]
textlist[0,1;7,3;faclist;]]..facnames..[[]
image[3,4.75;1,1;gui_hb_bg.png]
image[4,4.75;1,1;gui_hb_bg.png]
image[5,4.75;1,1;gui_hb_bg.png]
@ -26,7 +28,6 @@ textlist[0,1;8,3;faclist;f1,f2,...,f3]
end,
on_player_receive_fields = function(self, player, context, fields)
minetest.log("error", "Changing selected fac ")
end
})