Auto-reveal hidden entries

master
Wuzzy 2016-08-30 23:25:49 +02:00
parent a658892f6c
commit 4baef3d85f
1 changed files with 7 additions and 7 deletions

View File

@ -64,7 +64,7 @@ doc_identifier.identify = function(itemstack, user, pointed_thing)
if(node.name == "ignore") then
show_message(username, "error_ignore")
elseif doc.entry_exists("nodes", node.name) then
doc.show_entry(username, "nodes", node.name)
doc.show_entry(username, "nodes", node.name, true)
else
show_message(username, "error_node")
end
@ -76,7 +76,7 @@ doc_identifier.identify = function(itemstack, user, pointed_thing)
local le = object:get_luaentity()
if object:is_player() then
if minetest.get_modpath("doc_basics") ~= nil and doc.entry_exists("basics", "players") then
doc.show_entry(username, "basics", "players")
doc.show_entry(username, "basics", "players", true)
else
-- Fallback message
show_message(username, "player")
@ -88,11 +88,11 @@ doc_identifier.identify = function(itemstack, user, pointed_thing)
if le.name == "__builtin:item" then
local itemstring = ItemStack(minetest.deserialize(le:get_staticdata()).itemstring):get_name()
if doc.entry_exists("nodes", itemstring) then
doc.show_entry(username, "nodes", itemstring)
doc.show_entry(username, "nodes", itemstring, true)
elseif doc.entry_exists("tools", itemstring) then
doc.show_entry(username, "tools", itemstring)
doc.show_entry(username, "tools", itemstring, true)
elseif doc.entry_exists("craftitems", itemstring) then
doc.show_entry(username, "craftitems", itemstring)
doc.show_entry(username, "craftitems", itemstring, true)
elseif minetest.registered_items[itemstring] == nil or itemstring == "unknown" then
show_message(username, "error_unknown", itemstring)
else
@ -102,11 +102,11 @@ doc_identifier.identify = function(itemstack, user, pointed_thing)
elseif le.name == "__builtin:falling_node" then
local itemstring = minetest.deserialize(le:get_staticdata()).name
if doc.entry_exists("nodes", itemstring) then
doc.show_entry(username, "nodes", itemstring)
doc.show_entry(username, "nodes", itemstring, true)
end
-- A known registered object
elseif ro ~= nil then
doc.show_entry(username, ro.category, ro.entry)
doc.show_entry(username, ro.category, ro.entry, true)
-- Undefined object (error)
elseif minetest.registered_entities[le.name] == nil then
show_message(username, "error_unknown", le.name)