diff options
author | Wuzzy <almikes@aol.com> | 2016-08-31 21:24:53 +0200 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2016-08-31 21:24:53 +0200 |
commit | 7466d3bfe29751ce20e4e19093941a188c43e7dc (patch) | |
tree | 1e2b7c1199636811500536073fcbe75172dca4a2 /init.lua | |
parent | a82051b91bcac56c5a4eaf8df5e1fd0d30cbf280 (diff) |
Hide uninteresting numbers
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -497,8 +497,17 @@ function doc.formspec_category(id, playername) local viewed = doc.get_viewed_count(playername, id) local hidden = total - revealed local new = total - viewed - hidden - formstring = formstring .. "New entries: "..new.."\n" - formstring = formstring .. "Hidden entries: "..hidden.."]" + if viewed < total then + formstring = formstring .. "New entries: "..new + if hidden > 0 then + formstring = formstring .. "\n" + formstring = formstring .. "Hidden entries: "..hidden.."]" + else + formstring = formstring .. "]" + end + else + formstring = formstring .. "All entries read.]" + end else formstring = formstring .. "label[0,0.5;This category is empty.]" formstring = formstring .. "button[0,1.5;3,1;doc_button_goto_main;Go to category list]" |