Added Damage Popups

This commit is contained in:
Cooldude2606
2019-03-22 23:02:10 +00:00
parent 6a4967645b
commit 29c542f391
7 changed files with 44 additions and 2 deletions

View File

@@ -2,6 +2,7 @@
-- also displays a ping above users who are named in the message
local Game = require 'utils.game'
local Event = require 'utils.event'
local config = require 'config.popup_messages'
local send_text = Game.print_player_floating_text -- (player_index, text, color)
@@ -13,7 +14,11 @@ Event.add(defines.events.on_console_chat,function(event)
if not event.message then return end
-- Sends the message as text above them
send_text(player.index,{'chat-popup.message',player.name,event.message},player.chat_color)
if config.show_player_messages then
send_text(player.index,{'chat-popup.message',player.name,event.message},player.chat_color)
end
if not config.show_player_mentions then return end
-- Makes lower and removes white space from the message
local search_string = event.message:lower():gsub("%s+", "")