summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-12-27 19:14:32 +0100
committerWuzzy <almikes@aol.com>2016-12-27 19:14:32 +0100
commit5ffa16917eb846dca92d9ed243f3fa73c105d1b5 (patch)
treeebd47516f59d5294cb393da9d49bf1e3183cfb46 /init.lua
parenta2c4961f28fbd1a4df01d5074f5346eb8ca850c4 (diff)
Add msg when all entries are already revealed
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua17
1 files changed, 10 insertions, 7 deletions
diff --git a/init.lua b/init.lua
index 3fe0526..b960a25 100644
--- a/init.lua
+++ b/init.lua
@@ -186,21 +186,24 @@ function doc.mark_all_entries_as_revealed(playername)
end
end
+ local msg
if reveal1 then
-- Needed because new entries are added to player's view on entry list
doc.data.players[playername].entry_textlist_needs_updating = true
- -- Notify
- local msg = S("All help entries unlocked!")
- if minetest.get_modpath("central_message") ~= nil then
- cmsg.push_message_player(minetest.get_player_by_name(playername), msg)
- else
- minetest.chat_send_player(playername, msg)
- end
+ msg = S("All help entries revealed!")
-- Play notification sound (ignore sound limit intentionally)
minetest.sound_play({ name = "doc_reveal", gain = 0.2 }, { to_player = playername })
doc.data.players[playername].last_reveal_sound = os.time()
+ else
+ msg = S("All help entries are already revealed.")
+ end
+ -- Notify
+ if minetest.get_modpath("central_message") ~= nil then
+ cmsg.push_message_player(minetest.get_player_by_name(playername), msg)
+ else
+ minetest.chat_send_player(playername, msg)
end
end