diff options
author | Wuzzy <almikes@aol.com> | 2016-08-15 18:47:58 +0200 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2016-08-15 18:47:58 +0200 |
commit | a2cbdbf525088e396efc11db0057b81cc4381214 (patch) | |
tree | 02bd190476e25c21a7d2ae586cbd57cef85c4d97 /init.lua | |
parent | 5e813bffa17450680636d1ce63a8fb668a454a3c (diff) |
Very simple hidden entries
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -224,17 +224,19 @@ function doc.generate_entry_list(cid, playername) doc.data.players[playername].entry_ids = {} local entries = doc.get_sorted_entry_names(cid) for i=1, #entries do - local eid = entries[i].eid - table.insert(doc.data.players[playername].entry_ids, eid) - -- Colorize entries based on viewed status - -- Not viewed: Cyan - local viewedprefix = "#00FFFF" - if doc.entry_viewed(playername, cid, eid) then - -- Viewed: White - viewedprefix = "#FFFFFF" + if not entries[i].hidden then + local eid = entries[i].eid + table.insert(doc.data.players[playername].entry_ids, eid) + -- Colorize entries based on viewed status + -- Not viewed: Cyan + local viewedprefix = "#00FFFF" + if doc.entry_viewed(playername, cid, eid) then + -- Viewed: White + viewedprefix = "#FFFFFF" + end + entry_textlist = entry_textlist .. viewedprefix .. minetest.formspec_escape(entries[i].name) .. "," + counter = counter + 1 end - entry_textlist = entry_textlist .. viewedprefix .. minetest.formspec_escape(entries[i].name) .. "," - counter = counter + 1 end if counter >= 1 then entry_textlist = string.sub(entry_textlist, 1, #entry_textlist-1) |