summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-08-31 21:24:53 +0200
committerWuzzy <almikes@aol.com>2016-08-31 21:24:53 +0200
commit7466d3bfe29751ce20e4e19093941a188c43e7dc (patch)
tree1e2b7c1199636811500536073fcbe75172dca4a2 /init.lua
parenta82051b91bcac56c5a4eaf8df5e1fd0d30cbf280 (diff)
Hide uninteresting numbers
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua13
1 files changed, 11 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index d342efe..ca3c412 100644
--- a/init.lua
+++ b/init.lua
@@ -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]"