diff options
author | Wuzzy <almikes@aol.com> | 2016-11-08 02:10:28 +0100 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2016-11-08 02:10:28 +0100 |
commit | 41697dd683221085a9894723225942239db37d84 (patch) | |
tree | a3af28ce134d656094715bf7eaa693545f25c9da /init.lua | |
parent | a16d634ffdf7029eea80583966359d38aa4c2d7c (diff) |
Explicitly support receiving entry page events
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -354,6 +354,26 @@ function doc.get_hidden_count(playername, category_id) end end +-- Returns the currently viewed entry and/or category of the player +function doc.get_selection(playername) + local playerdata = doc.data.players[playername] + if playerdata ~= nil then + local cat = playerdata.category + if cat then + local entry = playerdata.entry + if entry then + return cat, entry + else + return cat + end + else + return nil + end + else + return nil + end +end + -- Template function templates, to be used for build_formspec in doc.new_category doc.entry_builders = {} |