summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-12-13 12:31:26 +0100
committerWuzzy <almikes@aol.com>2016-12-13 12:31:26 +0100
commitdfe653e1789538f9b669db2dcb788c71447cc7c9 (patch)
treeb019d49cc6dd7db8e497356fa9bab6aee517f890
parent4ae274b9e282cbd3de4b6d8779a2245cb12a1f0e (diff)
*_durability and make it more flexible
-rw-r--r--API.md4
-rw-r--r--init.lua7
-rw-r--r--locale/de.txt3
-rw-r--r--locale/template.txt3
4 files changed, 12 insertions, 5 deletions
diff --git a/API.md b/API.md
index 3103992..b7cd14f 100644
--- a/API.md
+++ b/API.md
@@ -46,7 +46,9 @@ easy and quick manipulation of the item help entries. All fields are optional.
* `_doc_items_create_entry`: Whether to create an entry for this item (default: `true`)
* `_doc_items_entry_name`: The title of the entry. By default, this is the same as the `description` field
of the item. This field is required if the `description` is empty
-* `_doc_items_uses_fixed`: Exact number of uses for a tool before it breaks, use this is the use count is fixed. If it varies or is unlimited, please don't use this field
+* `_doc_items_durability`: Two meanings:
+ * It it is a `number`: Number of uses for a tool before it breaks, use this is the use count is fixed.
+ * If it is a `string`: Free-form text which explains how the durability works. Try to keep it short.
A full explanation of these fields is provided below.
diff --git a/init.lua b/init.lua
index d9fc140..4edab4d 100644
--- a/init.lua
+++ b/init.lua
@@ -832,8 +832,11 @@ doc.new_category("tools", {
end
datastring = datastring .. range_factoid(data.itemstring, data.def)
datastring = newline(datastring)
- if data.def._doc_items_uses ~= nil then
- datastring = datastring .. S("Uses: @1", data.def._doc_items_uses)
+ if type(data.def._doc_items_durability) == "number" then
+ datastring = datastring .. S("Durability: @1 uses", data.def._doc_items_durability)
+ datastring = newline(datastring)
+ elseif type(data.def._doc_items_durability) == "string" then
+ datastring = datastring .. S("Durability: @1", data.def._doc_items_durability)
datastring = newline(datastring)
end
diff --git a/locale/de.txt b/locale/de.txt
index ea95ad5..5289a29 100644
--- a/locale/de.txt
+++ b/locale/de.txt
@@ -131,4 +131,5 @@ Unknown item (@1) = Unbekannter Gegenstand (@1)
• Renewable = • Erneuerbar
• Viscosity: @1 = • Zähflüssigkeit: @1
Itemstring: "@1" = Itemstring: »@1«
-Uses: @1 = Benutzungen: @1
+Durability: @1 uses = Haltbarkeit: @1 Benutzungen
+Durability: @1 = Haltbarkeit: @1
diff --git a/locale/template.txt b/locale/template.txt
index 566af57..fbe5bde 100644
--- a/locale/template.txt
+++ b/locale/template.txt
@@ -132,4 +132,5 @@ Unknown item (@1) =
• Renewable =
• Viscosity: @1 =
Itemstring: "@1" =
-Uses: @1 =
+Durability: @1 uses =
+Durability: @1 =