diff options
| author | Wuzzy <almikes@aol.com> | 2016-12-13 02:13:36 +0100 | 
|---|---|---|
| committer | Wuzzy <almikes@aol.com> | 2016-12-13 02:13:36 +0100 | 
| commit | 4ae274b9e282cbd3de4b6d8779a2245cb12a1f0e (patch) | |
| tree | 7e99125637621e0ec55eed8ca3392e2ef15c1789 | |
| parent | 6c61a0c9675787d98e59c70a4235c72ea23341bb (diff) | |
Add support to specify tool uses
| -rw-r--r-- | API.md | 1 | ||||
| -rw-r--r-- | init.lua | 12 | ||||
| -rw-r--r-- | locale/de.txt | 1 | ||||
| -rw-r--r-- | locale/template.txt | 1 | 
4 files changed, 12 insertions, 3 deletions
| @@ -46,6 +46,7 @@ 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  A full explanation of these fields is provided below. @@ -822,14 +822,20 @@ doc.new_category("tools", {  				datastring = datastring .. S("Usage help: @1", usagehelp)  				datastring = newline2(datastring)  			end +  			datastring = datastring .. get_custom_factoids("tools", "use", data)  			datastring = newline2(datastring)  			if data.itemstring ~= "" then -				datastring = datastring .. S("Maximum stack size: @1", data.def.stack_max).. "\n" +				datastring = datastring .. S("Maximum stack size: @1", data.def.stack_max) +				datastring = newline(datastring) +			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) +				datastring = newline(datastring)  			end - -			datastring = datastring .. range_factoid(data.itemstring, data.def) .. "\n"  			datastring = newline2(datastring) diff --git a/locale/de.txt b/locale/de.txt index bbf29f8..ea95ad5 100644 --- a/locale/de.txt +++ b/locale/de.txt @@ -131,3 +131,4 @@ Unknown item (@1) = Unbekannter Gegenstand (@1)  • Renewable = • Erneuerbar  • Viscosity: @1 = • Zähflüssigkeit: @1  Itemstring: "@1" = Itemstring: »@1« +Uses: @1 = Benutzungen: @1 diff --git a/locale/template.txt b/locale/template.txt index a44e6d7..566af57 100644 --- a/locale/template.txt +++ b/locale/template.txt @@ -132,3 +132,4 @@ Unknown item (@1) =  • Renewable =  • Viscosity: @1 =  Itemstring: "@1" = +Uses: @1 = | 
