More cloaking integration
Show the client-side "you are cloaked" message when the user tries to send a message to #main while cloaked.
This commit is contained in:
parent
6c6333b1c9
commit
53fbd7e6d9
8
init.lua
8
init.lua
|
@ -90,10 +90,6 @@ chat_channels.send_message = function(msg, c)
|
||||||
prefix = c:sub(1, 1)
|
prefix = c:sub(1, 1)
|
||||||
if prefix ~= '#' and prefix ~= '@' then
|
if prefix ~= '#' and prefix ~= '@' then
|
||||||
return false, 'Channels must start in either # or @.'
|
return false, 'Channels must start in either # or @.'
|
||||||
elseif c == main_channel then
|
|
||||||
show_main_channel = true
|
|
||||||
minetest.send_chat_message(msg)
|
|
||||||
return true, 'Message sent!'
|
|
||||||
elseif c == '@' then
|
elseif c == '@' then
|
||||||
minetest.display_chat_message('-!- <' .. localplayer .. '> ' .. msg)
|
minetest.display_chat_message('-!- <' .. localplayer .. '> ' .. msg)
|
||||||
return true, 'Message sent!'
|
return true, 'Message sent!'
|
||||||
|
@ -102,6 +98,10 @@ chat_channels.send_message = function(msg, c)
|
||||||
status_sent = status_sent + 1
|
status_sent = status_sent + 1
|
||||||
return false, 'You cannot use chat while cloaked. '
|
return false, 'You cannot use chat while cloaked. '
|
||||||
.. 'Please use /uncloak if you want to use chat.'
|
.. 'Please use /uncloak if you want to use chat.'
|
||||||
|
elseif c == main_channel then
|
||||||
|
show_main_channel = true
|
||||||
|
minetest.send_chat_message(msg)
|
||||||
|
return true, 'Message sent!'
|
||||||
elseif c == '@[off]' then
|
elseif c == '@[off]' then
|
||||||
show_main_channel = true
|
show_main_channel = true
|
||||||
minetest.send_chat_message('[off] ' .. msg)
|
minetest.send_chat_message('[off] ' .. msg)
|
||||||
|
|
Loading…
Reference in New Issue