diff options
| author | Wuzzy <almikes@aol.com> | 2016-08-04 02:32:32 +0200 | 
|---|---|---|
| committer | Wuzzy <almikes@aol.com> | 2016-08-04 02:32:32 +0200 | 
| commit | 0cf233dfd03ef47c153c7b12d91769ffe1a9c95d (patch) | |
| tree | bf43d92fd9f94b981f16ea14f42b380da04506a2 | |
| parent | 37ff2dd620d68e5392949da150b2641f5801efc6 (diff) | |
Improve layouting of “error” pages
| -rw-r--r-- | init.lua | 15 | 
1 files changed, 11 insertions, 4 deletions
| @@ -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] | 
