From 5ffa16917eb846dca92d9ed243f3fa73c105d1b5 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 27 Dec 2016 19:14:32 +0100 Subject: Add msg when all entries are already revealed --- init.lua | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'init.lua') 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 -- cgit v1.2.3