From 3f30bf701c2e1ca61e1dbe0e373210057d73c8ac Mon Sep 17 00:00:00 2001 From: Panquesito7 Date: Fri, 29 Nov 2019 15:39:29 -0600 Subject: [PATCH 1/2] Replace deprecated functions with newer ones --- init.lua | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/init.lua b/init.lua index ccbe052..1e45c3c 100755 --- a/init.lua +++ b/init.lua @@ -1,13 +1,16 @@ --- Minetest 0.4.12+ mod: chat2 --- chat2 is mod for minetest game created by Andrey. It's purpose is to improve or replace game built in chat. --- + Higlight some messages in different colors - nearby talk, PM messages, messages with your name in it, shouts(!) --- + Also can show all regular chat messages (use "/chat2 *" command) --- + Switch on/off (use "/chat2" command) --- + Old messages dissapear after some time --- - Problems with unicode symbols on some clients +--[[ +Minetest 0.4.16+ mod: chat2 +chat2 is mod for Minetest, created by Andrey. It's purpose is to improve or replace game built-in chat: --- This mod is Free and Open Source Software, released under the LGPL 2.1 or later. --- I used this mod:https://github.com/vegasd/minetest-mods/blob/master/kmchat/init.lua as example for how to use hud api. + + Higlight some messages in different colors - nearby talk, PM messages, messages with your name in it, shouts(!) + + Also can show all regular chat messages (use "/chat2 *" command) + + Switch on/off (use "/chat2" command) + + Old messages dissapear after some time + - Problems with unicode symbols on some clients + +This mod is Free and Open Source Software, released under the GNU LGPLv2.1 or later. +I used this mod:https://github.com/vegasd/minetest-mods/blob/master/kmchat/init.lua as example for how to use hud api. +--]] chat2 = {} chat2.speedlimit = {} @@ -178,7 +181,7 @@ minetest.register_on_chat_message(function(name, message) minetest.log("action", "chat2 !:"..string.format(fmt, name, submes)) end - local senderpos = player:getpos() + local senderpos = player:get_pos() for i = 1, #players do local fmt_p = fmt local color_p = color @@ -208,7 +211,7 @@ minetest.register_on_chat_message(function(name, message) end if not submes_p and chat2.users[name_p] and name_p ~= name then - recieverpos = players[i]:getpos() + recieverpos = players[i]:get_pos() if vector.distance(senderpos, recieverpos) < 12 then fmt_p = "<%s> %s" color_p = 0x88FFFF @@ -259,7 +262,7 @@ minetest.register_chatcommand("chat2", { func = function(name, param) local player = minetest.get_player_by_name(name) if not player then - return false, "chat2: Player not found" + return false, "chat2: Player not found." end if chat2.users[name] == nil and param and #param > 0 then From 2d91517677ecfd5f46658d9c1505f1e1cbf99611 Mon Sep 17 00:00:00 2001 From: Panquesito7 Date: Fri, 29 Nov 2019 15:42:33 -0600 Subject: [PATCH 2/2] Use mod.conf for dependencies and description --- depends.txt | 2 +- description.txt | 2 +- mod.conf | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) mode change 100755 => 100644 depends.txt mode change 100755 => 100644 description.txt diff --git a/depends.txt b/depends.txt old mode 100755 new mode 100644 index bc1ffb9..0e52e30 --- a/depends.txt +++ b/depends.txt @@ -1,2 +1,2 @@ chat_anticurse? -chat_antiflood? +chat_antiflood? \ No newline at end of file diff --git a/description.txt b/description.txt old mode 100755 new mode 100644 index e3986ab..45fd3fd --- a/description.txt +++ b/description.txt @@ -1 +1 @@ -Complements game built-in chat or replaces it. +Complements game built-in chat or replaces it. \ No newline at end of file diff --git a/mod.conf b/mod.conf index 2e820ec..6f976ce 100755 --- a/mod.conf +++ b/mod.conf @@ -1 +1,3 @@ name = chat2 +optional_depends = chat_anticurse, chat_antiflood +description = Complements game built-in chat or replaces it. \ No newline at end of file