From 5a585e38d955a5398296b9ed464d55b06599d73e Mon Sep 17 00:00:00 2001 From: Jayefuu Date: Tue, 19 Jan 2021 13:36:25 +0000 Subject: [PATCH 1/5] Update chat_triggers.lua --- features/chat_triggers.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/features/chat_triggers.lua b/features/chat_triggers.lua index 368dc2b8..7a66f6a2 100644 --- a/features/chat_triggers.lua +++ b/features/chat_triggers.lua @@ -100,8 +100,11 @@ local function mentions(event) success = true break end + p.print(prefix .. game.get_player(event.player_index).name .. ' mentioned you!', Color.yellow) p.play_sound {path = 'utility/new_objective', volume_modifier = 1} + local message = game.get_player(event.player_index).name .. ' mentioned you!' + rendering.draw_text({text = message, target_offset = {0,-3},surface = p.surface, target = p.character, time_to_live = 180, alignment="center", scale=2, players={p.name}, color= {1, 1, 1, 1}}) success = true if _DEBUG then player.print(prefix .. 'Successful mentioned ' .. p.name, Color.red) From c88520cccbc6c6e1216f3c085d4f87a3bf7f1d4d Mon Sep 17 00:00:00 2001 From: Jayefuu Date: Tue, 19 Jan 2021 13:37:00 +0000 Subject: [PATCH 2/5] Update chat_triggers.lua --- features/chat_triggers.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/chat_triggers.lua b/features/chat_triggers.lua index 7a66f6a2..9a5182f4 100644 --- a/features/chat_triggers.lua +++ b/features/chat_triggers.lua @@ -103,7 +103,7 @@ local function mentions(event) p.print(prefix .. game.get_player(event.player_index).name .. ' mentioned you!', Color.yellow) p.play_sound {path = 'utility/new_objective', volume_modifier = 1} - local message = game.get_player(event.player_index).name .. ' mentioned you!' + local message = game.get_player(event.player_index).name .. ' mentioned you in the chat!' rendering.draw_text({text = message, target_offset = {0,-3},surface = p.surface, target = p.character, time_to_live = 180, alignment="center", scale=2, players={p.name}, color= {1, 1, 1, 1}}) success = true if _DEBUG then From 476b07a2ab5f379e870a0412a3374c362f17527c Mon Sep 17 00:00:00 2001 From: Jayefuu Date: Wed, 20 Jan 2021 08:48:08 +0000 Subject: [PATCH 3/5] Fixed locale issues --- features/chat_triggers.lua | 4 ++-- locale/en/redmew_features.cfg | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/features/chat_triggers.lua b/features/chat_triggers.lua index 9a5182f4..0c9c95be 100644 --- a/features/chat_triggers.lua +++ b/features/chat_triggers.lua @@ -101,9 +101,9 @@ local function mentions(event) break end - p.print(prefix .. game.get_player(event.player_index).name .. ' mentioned you!', Color.yellow) + p.print({'chat_triggers.mention_success_target', prefix, game.get_player(event.player_index).name}, Color.yellow) p.play_sound {path = 'utility/new_objective', volume_modifier = 1} - local message = game.get_player(event.player_index).name .. ' mentioned you in the chat!' + local message = {'chat_triggers.mention_success_target_floating', game.get_player(event.player_index).name} rendering.draw_text({text = message, target_offset = {0,-3},surface = p.surface, target = p.character, time_to_live = 180, alignment="center", scale=2, players={p.name}, color= {1, 1, 1, 1}}) success = true if _DEBUG then diff --git a/locale/en/redmew_features.cfg b/locale/en/redmew_features.cfg index 379a0854..700e393b 100644 --- a/locale/en/redmew_features.cfg +++ b/locale/en/redmew_features.cfg @@ -99,6 +99,8 @@ patreon=Did you ask about our patreon?\nYou can find it here: patreon.com/redmew donate=Did you ask about donating to the server?\nYou can find our patreon here: patreon.com/redmew grief=To report grief please use the /report function.\nIf no admins are online use #helpdesk-and-moderation on the discord and make sure the @mention the appropriate role. mention_success=__1__ __2__ mentioned __3__! +mention_success_target=__1__ __2__ mentioned you! +mention_success_target_floating=__1__ mentioned you in the chat! mention_fail_mention_self=__1__ Can't mention yourself! mention_not_found_plural=__1__ Players not found: __2__ mention_not_found_singular=__1__ Player not found: __2__ From 75df3186b85e1688a5c4d5813ac4cb4bfa93b549 Mon Sep 17 00:00:00 2001 From: Jayefuu Date: Thu, 21 Jan 2021 14:46:18 +0000 Subject: [PATCH 4/5] Update chat_triggers.lua - Changed font size and line_to_live slightly on feedback from nibu and diffie - Added check for if player is dead. Assume that if they're dead they're probably not distracted and will pay attention to chat. - Removed us of game.get player and replaced with player.name --- features/chat_triggers.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/features/chat_triggers.lua b/features/chat_triggers.lua index 0c9c95be..332d11e2 100644 --- a/features/chat_triggers.lua +++ b/features/chat_triggers.lua @@ -101,10 +101,14 @@ local function mentions(event) break end - p.print({'chat_triggers.mention_success_target', prefix, game.get_player(event.player_index).name}, Color.yellow) + --p.print({'chat_triggers.mention_success_target', prefix, game.get_player(event.player_index).name}, Color.yellow) + p.print({'chat_triggers.mention_success_target', prefix, player.name}, Color.yellow) p.play_sound {path = 'utility/new_objective', volume_modifier = 1} - local message = {'chat_triggers.mention_success_target_floating', game.get_player(event.player_index).name} - rendering.draw_text({text = message, target_offset = {0,-3},surface = p.surface, target = p.character, time_to_live = 180, alignment="center", scale=2, players={p.name}, color= {1, 1, 1, 1}}) + if p.character and p.character.valid then -- If player is dead and they don't have a character then they won't get the hovering notification. + --local message = {'chat_triggers.mention_success_target_floating', game.get_player(event.player_index).name} + local message = {'chat_triggers.mention_success_target_floating', player.name} + rendering.draw_text({text = message, target_offset = {0,-3},surface = p.surface, target = p.character, time_to_live = 360, alignment="center", scale=3, players={p.name}, color= {1, 1, 1, 1}}) + end success = true if _DEBUG then player.print(prefix .. 'Successful mentioned ' .. p.name, Color.red) From f9e5752dd098c4659aba25a7b57e65faa3fecd19 Mon Sep 17 00:00:00 2001 From: Jayefuu Date: Sat, 23 Jan 2021 17:38:34 +0000 Subject: [PATCH 5/5] Removed old comments --- features/chat_triggers.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/features/chat_triggers.lua b/features/chat_triggers.lua index 332d11e2..37fd80a0 100644 --- a/features/chat_triggers.lua +++ b/features/chat_triggers.lua @@ -101,11 +101,9 @@ local function mentions(event) break end - --p.print({'chat_triggers.mention_success_target', prefix, game.get_player(event.player_index).name}, Color.yellow) p.print({'chat_triggers.mention_success_target', prefix, player.name}, Color.yellow) p.play_sound {path = 'utility/new_objective', volume_modifier = 1} if p.character and p.character.valid then -- If player is dead and they don't have a character then they won't get the hovering notification. - --local message = {'chat_triggers.mention_success_target_floating', game.get_player(event.player_index).name} local message = {'chat_triggers.mention_success_target_floating', player.name} rendering.draw_text({text = message, target_offset = {0,-3},surface = p.surface, target = p.character, time_to_live = 360, alignment="center", scale=3, players={p.name}, color= {1, 1, 1, 1}}) end