From a45d72499f2fda5fbdff08053353a275155f94d3 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 12 Dec 2016 22:26:07 +0100 Subject: Add misc factoid type --- API.md | 1 + init.lua | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/API.md b/API.md index 142e695..659011c 100644 --- a/API.md +++ b/API.md @@ -189,6 +189,7 @@ Add a custom factoid (see above) for the specified category. * `factoid_type`: Rough categorization of the factoid's content. Controls where in the text the factoid appears. Possible values: * `"groups"`: Factoid appears near groups + * `"misc"`: Factoid of other type, appears near the end * **(more to come)** * `factoid_generator`: A function which turns item definition into a string (see blow) diff --git a/init.lua b/init.lua index 03a8144..27c7b46 100644 --- a/init.lua +++ b/init.lua @@ -758,6 +758,10 @@ doc.new_category("nodes", { datastring = newline2(datastring) datastring = datastring .. fuel_factoid(data.itemstring, "nodes") + -- Other custom factoids + datastring = newline2(datastring) + datastring = datastring .. get_custom_factoids("nodes", "misc", data) + datastring = newline2(datastring) datastring = datastring .. itemstring_factoid(data.itemstring, playername) @@ -835,6 +839,10 @@ doc.new_category("tools", { datastring = newline2(datastring) datastring = datastring .. fuel_factoid(data.itemstring, "tools") + -- Other custom factoids + datastring = newline2(datastring) + datastring = datastring .. get_custom_factoids("tools", "misc", data) + datastring = newline2(datastring) datastring = datastring .. itemstring_factoid(data.itemstring, playername) @@ -903,6 +911,10 @@ doc.new_category("craftitems", { datastring = newline2(datastring) datastring = datastring .. fuel_factoid(data.itemstring, "craftitems") + -- Other custom factoids + datastring = newline2(datastring) + datastring = datastring .. get_custom_factoids("craftitems", "misc", data) + datastring = newline2(datastring) datastring = datastring .. itemstring_factoid(data.itemstring, playername) -- cgit v1.2.3