diff options
-rw-r--r-- | init.lua | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -1,10 +1,5 @@ chat6 = {} -local player_name = "UNKNOWN" -minetest.register_on_connect(function() - player_name = minetest.localplayer:get_name() -end) - local function default_settings() chat6.settings.fields.highlight_color = "#4E9A06" chat6.settings.fields.send_nick_color = "#A40000" @@ -60,7 +55,6 @@ minetest.register_on_formspec_input(function(formname,fields) chat6.settings.fields.send_message_color = validate_hex_color(fields.sendmsg,chat6.settings.fields.send_message_color) chat6.settings.fields.join_color = validate_hex_color(fields.join,chat6.settings.fields.join_color) chat6.settings.fields.part_color = validate_hex_color(fields.part,chat6.settings.fields.part_color) - --chat6.settings.fields.timestamps = (fields.timestamps and "true" or "false") chat6.storage:from_table(chat6.settings) end return true @@ -102,6 +96,7 @@ minetest.register_on_receiving_chat_message(function(message) timestamp = string.format("[%02d:%02d:%02d] ",date.hour,date.min,date.sec) end if string.sub(message,1,1) == "<" then + local player_name = minetest.localplayer:get_name() msgtype = "channel" user,text = string.match(message,"^<([^%c ]*)> (.*)$") if not user then @@ -118,6 +113,7 @@ minetest.register_on_receiving_chat_message(function(message) text = "(Client Quit)" end elseif string.sub(message,1,1) == "*" then + local player_name = minetest.localplayer:get_name() msgtype = "action" user,text = string.match(message,"^* ([^%c ]*) (.*)$") if not user then |