diff options
author | Wuzzy <almikes@aol.com> | 2016-10-30 20:27:13 +0100 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2016-10-30 20:27:13 +0100 |
commit | b1965e77ec796163b2332c751f524eb737010988 (patch) | |
tree | fd461d443d31b9516b48afba2a114d11bf2a7a5e | |
parent | aceeb5758ae8f289998e63802955092051d30e87 (diff) |
Show nameless entries in red
-rw-r--r-- | init.lua | 17 | ||||
-rw-r--r-- | locale/de.txt | 1 | ||||
-rw-r--r-- | locale/template.txt | 1 |
3 files changed, 16 insertions, 3 deletions
@@ -550,11 +550,19 @@ function doc.generate_entry_list(cid, playername) -- Colorize entries based on viewed status -- Not viewed: Cyan local viewedprefix = "#00FFFF" - if doc.entry_viewed(playername, cid, eid) then + local name = edata.name + if name == nil or name == "" then + name = S("(Nameless entry)") + if doc.entry_viewed(playername, cid, eid) then + viewedprefix = "#FF4444" + else + viewedprefix = "#FF0000" + end + elseif doc.entry_viewed(playername, cid, eid) then -- Viewed: White viewedprefix = "#FFFFFF" end - entry_textlist = entry_textlist .. viewedprefix .. minetest.formspec_escape(edata.name) .. "," + entry_textlist = entry_textlist .. viewedprefix .. minetest.formspec_escape(name) .. "," counter = counter + 1 end end @@ -706,7 +714,10 @@ function doc.formspec_entry(category_id, entry_id) local category = doc.data.categories[category_id] local entry = doc.get_entry(category_id, entry_id) - + local name = entry.name + if name == nil or name == "" then + name = S("(Nameless entry)") + end formstring = "label[0,0;"..minetest.formspec_escape(string.format(S("Help > %s > %s"), category.def.name, entry.name)).."]" formstring = formstring .. category.def.build_formspec(entry.data) formstring = formstring .. doc.formspec_entry_navigation(category_id, entry_id) diff --git a/locale/de.txt b/locale/de.txt index 519577f..73d9717 100644 --- a/locale/de.txt +++ b/locale/de.txt @@ -31,3 +31,4 @@ This category is empty. = Diese Kategorie ist leer. This is the Documentation System, Version %s. = Dies ist das Dokumentationssystem, Version %s. You haven't chosen a category yet. Please choose one in the category list first. = Sie haben noch keine Kategorie gewählt. Bitte wählen Sie zuerst eine Kategorie in der Kategorienliste aus. You haven't chosen an entry yet. Please choose one in the entry list first. = Sie haben noch keinen Eintrag gewählt. Bitte wählen Sie zuerst einen Eintrag in der Eintragsliste aus. +(Nameless entry) = (Namenloser Eintrag) diff --git a/locale/template.txt b/locale/template.txt index 38df2cb..15fed74 100644 --- a/locale/template.txt +++ b/locale/template.txt @@ -31,3 +31,4 @@ This category is empty. = This is the Documentation System, Version %s. = You haven't chosen a category yet. Please choose one in the category list first. = You haven't chosen an entry yet. Please choose one in the entry list first. = +(Nameless entry) = |