From 0cf233dfd03ef47c153c7b12d91769ffe1a9c95d Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 4 Aug 2016 02:32:32 +0200 Subject: =?UTF-8?q?Improve=20layouting=20of=20=E2=80=9Cerror=E2=80=9D=20pa?= =?UTF-8?q?ges?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init.lua | 15 +++++++++++---- 1 file 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] -- cgit v1.2.3