summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-07-24 11:29:57 +0200
committerWuzzy <almikes@aol.com>2016-07-24 11:29:57 +0200
commit6f2518a5e35cd8e8bdc501275a316cf5f9265d56 (patch)
tree649ed2130c2433e1dfa75cc1f62e5e5c60e5343e /init.lua
parent67dc69cba4e3b4779bf821e1e389bcc1bb0fd483 (diff)
Make help entry appear on double click
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index 6e2fb58..e1d30c8 100644
--- a/init.lua
+++ b/init.lua
@@ -187,6 +187,15 @@ function doc.process_form(player,formname,fields)
if event.type == "CHG" then
doc.data.players[playername].catsel = event.index
doc.data.players[playername].entry = doc.data.players[playername].entry_ids[event.index]
+ elseif event.type == "DCL" then
+ local cid = doc.data.players[playername].category
+ local eid = nil
+ local eids, catsel = doc.data.players[playername].entry_ids, event.index
+ if eids ~= nil and catsel ~= nil then
+ eid = eids[catsel]
+ end
+ local formspec = doc.formspec_core(3)..doc.formspec_entry(cid, eid)
+ minetest.show_formspec(playername, "doc:entry", formspec)
end
end
elseif(formname == "doc:entry") then