summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-08-04 02:32:32 +0200
committerWuzzy <almikes@aol.com>2016-08-04 02:32:32 +0200
commit0cf233dfd03ef47c153c7b12d91769ffe1a9c95d (patch)
treebf43d92fd9f94b981f16ea14f42b380da04506a2 /init.lua
parent37ff2dd620d68e5392949da150b2641f5801efc6 (diff)
Improve layouting of “error” pages
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua15
1 files changed, 11 insertions, 4 deletions
diff --git a/init.lua b/init.lua
index aafad48..5bb91a3 100644
--- a/init.lua
+++ b/init.lua
@@ -278,8 +278,8 @@ end
function doc.formspec_category(id, playername)
local formstring
if id == nil then
- formstring = "label[0,0;You haven't chosen a category yet. Please choose one in the category list first.]"
- formstring = formstring .. "button[0,1;3,1;doc_button_goto_main;Go to category list]"
+ formstring = "label[0,0.5;You haven't chosen a category yet. Please choose one in the category list first.]"
+ formstring = formstring .. "button[0,1.5;3,1;doc_button_goto_main;Go to category list]"
else
formstring = "label[0,0;Help > "..doc.data.categories[id].def.name.."]"
if doc.get_entry_count(id) >= 1 then
@@ -290,6 +290,7 @@ function doc.formspec_category(id, playername)
formstring = formstring .. "New entries: "..(doc.get_entry_count(id)-doc.get_viewed_count(playername, id)).."]"
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]"
end
end
return formstring
@@ -301,8 +302,14 @@ function doc.formspec_entry(category_id, entry_id)
formstring = "label[0,0;You haven't chosen a category yet. Please choose one in the category list first.]"
formstring = formstring .. "button[0,1;3,1;doc_button_goto_main;Go to category list]"
elseif entry_id == nil then
- formstring = "label[0,0;You haven't chosen an entry yet. Please choose one in the entry list first.]"
- formstring = formstring .. "button[0,1;3,1;doc_button_goto_category;Go to entry list]"
+ formstring = "label[0,0;Help > "..doc.data.categories[category_id].def.name.." > (No Entry)]"
+ if doc.get_entry_count(category_id) >= 1 then
+ formstring = formstring .. "label[0,0.5;You haven't chosen an entry yet. Please choose one in the entry list first.]"
+ formstring = formstring .. "button[0,1.5;3,1;doc_button_goto_category;Go to entry list]"
+ else
+ formstring = formstring .. "label[0,0.5;This category does not have any entries.]"
+ formstring = formstring .. "button[0,1.5;3,1;doc_button_goto_main;Go to category list]"
+ end
else
local category = doc.data.categories[category_id]