diff --git a/config.lua b/config.lua index 56cdc00..6fe949d 100644 --- a/config.lua +++ b/config.lua @@ -60,3 +60,10 @@ yl_speak_up.blacklist_effect_on_block_right_click = {} -- If some items are for some reasons not at all acceptable as quest items, -- blacklist them here. The data structure is the same as for the tables above. yl_speak_up.blacklist_action_quest_item = {} + +-- NPC can send a message to all players as an effect; +-- this text will be put in front of this message so that you and your players +-- know that it originated from an NPC (just make sure this returns a string) +yl_speak_up.chat_all_prefix = minetest.colorize("#0000FF", "[NPC] ") +-- the NPC will use this color when sending a chat message +yl_speak_up.chat_all_color = "#AAAAFF" diff --git a/fs_edit_effects.lua b/fs_edit_effects.lua index 4a307e8..f0ee304 100644 --- a/fs_edit_effects.lua +++ b/fs_edit_effects.lua @@ -747,7 +747,9 @@ yl_speak_up.execute_effect = function(player, n_id, o_id, r) local text = r.r_value -- replace $NPC_NAME$, $OWNER_NAME$, $PLAYER_NAME$ etc. text = yl_speak_up.replace_vars_in_text(text, dialog, pname) - minetest.chat_send_all(text) + minetest.chat_send_all( + yl_speak_up.chat_all_prefix.. + minetest.colorize(yl_speak_up.chat_all_color, text)) -- sending a chat message always counts as successful return true -- "Call custom functions that are supposed to be overridden by the server.", -- 11