diff options
author | Wuzzy <almikes@aol.com> | 2015-03-11 17:28:09 +0100 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2015-03-11 17:28:09 +0100 |
commit | 944a357adfd53fd5a1bba19d64b7ef057b21ceeb (patch) | |
tree | 749c87a9e4d3fe83d5afc2dcf76dbe6688e08acf | |
parent | ccb771db0c018099b8f1691eb99ec326513e8d2a (diff) |
Fix empty entry lists
-rw-r--r-- | init.lua | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -82,10 +82,14 @@ function doc.formspec_category(id) formstring = "label[0,0;Current help topic: "..doc.data.categories[id].def.name.."]" formstring = formstring .. "label[0,0.5;Available entries:]" formstring = formstring .. "textlist[0,1;11,7;doc_catlist;" + local counter = 0 for eid,entry in pairs(doc.data.categories[id].entries) do formstring = formstring .. entry.name .. "," + counter = counter + 1 + end + if counter >= 1 then + formstring = string.sub(formstring, 1, #formstring-1) end - formstring = string.sub(formstring, 1, #formstring-1) formstring = formstring .. "]" formstring = formstring .. "button[0,8;3,1;doc_button_goto_entry;Show entry]" end |