Compare commits

5 Commits

Author SHA1 Message Date
aec499d25f Delete depends.txt and description.txt, add mod.conf (#3)
Co-authored-by: sys4 <bricassa@sys4.fr>
2022-07-02 14:31:57 +01:00
70fe682416 Update sfinv support
Makes it work with released version (rather than the old alpha)
2016-11-27 19:39:03 +00:00
286a94a0d4 Add sfinv support 2016-03-17 16:16:21 +00:00
97600252ff Add screenshot to README.md 2016-03-17 15:33:55 +00:00
981e51fa7f Create description.txt 2016-03-08 18:23:52 +00:00
4 changed files with 19 additions and 4 deletions

View File

@ -1,5 +1,7 @@
# Email
![screenshot](https://cdn.pbrd.co/images/8fn5I3u.png)
Created by rubenwardy.
License: WTFPL.

View File

@ -1 +0,0 @@
chatplus?

View File

@ -72,8 +72,7 @@ end)
function email.get_formspec(name)
local inbox = email.get_inbox(name)
local fs = "size[12,8]"
fs = fs .. "vertlabel[0,0;email Mail]"
local fs = "vertlabel[0,0;Your Inbox]"
function row(fs, c1, date, from, msg)
date = minetest.formspec_escape(date)
@ -127,7 +126,7 @@ function email.show_inbox(name, text_mode)
return true, "End of mail (" .. #inbox .. " items)"
end
else
local fs = email.get_formspec(name)
local fs = "size[12,8]" .. email.get_formspec(name)
minetest.show_formspec(name, "email:inbox", fs)
return true, "Opened inbox!"
@ -136,6 +135,17 @@ function email.show_inbox(name, text_mode)
return true
end
if minetest.global_exists("sfinv") then
sfinv.register_page("email:inbox", {
title = "Inbox",
get = function(self, player, context)
local name = player:get_player_name()
return sfinv.make_formspec(player, context,
email.get_formspec(name), false, "size[12,8]")
end
})
end
minetest.register_on_player_receive_fields(function(player,formname,fields)
if fields.clear then
local name = player:get_player_name()

4
mod.conf Normal file
View File

@ -0,0 +1,4 @@
name = email
title = Email
description = Adds email style inboxes to Minetest.
optional_depends = chatplus,sfinv