forked from mtcontrib/email
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
aec499d25f | |||
70fe682416 | |||
286a94a0d4 | |||
97600252ff | |||
981e51fa7f |
@ -1,5 +1,7 @@
|
|||||||
# Email
|
# Email
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
Created by rubenwardy.
|
Created by rubenwardy.
|
||||||
|
|
||||||
License: WTFPL.
|
License: WTFPL.
|
||||||
|
@ -1 +0,0 @@
|
|||||||
chatplus?
|
|
18
init.lua
18
init.lua
@ -72,10 +72,9 @@ end)
|
|||||||
function email.get_formspec(name)
|
function email.get_formspec(name)
|
||||||
local inbox = email.get_inbox(name)
|
local inbox = email.get_inbox(name)
|
||||||
|
|
||||||
local fs = "size[12,8]"
|
local fs = "vertlabel[0,0;Your Inbox]"
|
||||||
fs = fs .. "vertlabel[0,0;email Mail]"
|
|
||||||
|
|
||||||
local function row(fs, c1, date, from, msg)
|
function row(fs, c1, date, from, msg)
|
||||||
date = minetest.formspec_escape(date)
|
date = minetest.formspec_escape(date)
|
||||||
from = minetest.formspec_escape(from)
|
from = minetest.formspec_escape(from)
|
||||||
msg = minetest.formspec_escape(msg)
|
msg = minetest.formspec_escape(msg)
|
||||||
@ -127,7 +126,7 @@ function email.show_inbox(name, text_mode)
|
|||||||
return true, "End of mail (" .. #inbox .. " items)"
|
return true, "End of mail (" .. #inbox .. " items)"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
local fs = email.get_formspec(name)
|
local fs = "size[12,8]" .. email.get_formspec(name)
|
||||||
minetest.show_formspec(name, "email:inbox", fs)
|
minetest.show_formspec(name, "email:inbox", fs)
|
||||||
|
|
||||||
return true, "Opened inbox!"
|
return true, "Opened inbox!"
|
||||||
@ -136,6 +135,17 @@ function email.show_inbox(name, text_mode)
|
|||||||
return true
|
return true
|
||||||
end
|
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)
|
minetest.register_on_player_receive_fields(function(player,formname,fields)
|
||||||
if fields.clear then
|
if fields.clear then
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
|
4
mod.conf
Normal file
4
mod.conf
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
name = email
|
||||||
|
title = Email
|
||||||
|
description = Adds email style inboxes to Minetest.
|
||||||
|
optional_depends = chatplus,sfinv
|
Binary file not shown.
Before Width: | Height: | Size: 161 B After Width: | Height: | Size: 270 B |
Reference in New Issue
Block a user