From 6f2518a5e35cd8e8bdc501275a316cf5f9265d56 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 24 Jul 2016 11:29:57 +0200 Subject: Make help entry appear on double click --- init.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'init.lua') 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 -- cgit v1.2.3