Add sound notification (#86)

* Add sound notification

* Change sound

Update translations
This commit is contained in:
Athozus 2023-05-06 21:21:20 +02:00
parent a79ebd94b8
commit 955f7d123f
No known key found for this signature in database
GPG Key ID: B50895022E8484BF
13 changed files with 68 additions and 50 deletions

View File

@ -62,6 +62,7 @@ See the "LICENSE" file
* imre84 (UI fixes)
* Chache (Spanish translation)
* APercy (Brazilian Portuguese translation)
* Nuno Filipe Povoa (mail_notif.ogg - https://invent.kde.org/plasma/oxygen-sounds/-/blob/master/sounds/Oxygen-Im-Nudge.ogg)
# Contribute

View File

@ -106,6 +106,9 @@ function mail.send(m)
minetest.chat_send_player(name, unified_inventory_alert)
end
end
if mail.get_setting(name, "sound_notifications") == true then
minetest.sound_play("mail_notif", {to_player=name})
end
local receiver_entry = mail.get_storage_entry(name)
local receiver_messages = receiver_entry.inbox
mail.hud_update(name, receiver_messages)

View File

@ -30,6 +30,7 @@ mail = {
chat_notifications = {},
onjoin_notifications = {},
hud_notifications = {},
sound_notifications = {},
unreadcolorenable = {},
cccolorenable = {}
},

View File

@ -16,6 +16,8 @@ BCC=BCC
Cancel=Abbrechen
Save draft=Entwurf Speichern
Send=Senden
Subject=Betreff
To=An
CC=CC
Name=Name
No drafts=Keine Entwürfe
@ -30,23 +32,18 @@ Mail lists=Verteilerlisten
Options=
Close=Schließen
(No subject)=(Kein Betreff)
To=An
Player name=Spielername
That name is already in your contacts=
The contact name cannot be empty.=
Save=Speichern
Maillist name=Verteilerlistenname
Desc=Beschreibung
Players=Spieler
That name is already in your mailing lists.=
The mailing list name cannot be empty.=
Back=Zurück
Save=Speichern
Mark Read=Als gelesen makieren
Mark Unread=Als ungelesen makieren
From=Von
(No description)=(Keine Beschreibung)
No maillist=Keine Verteilerliste
You have mail! Type /mail to read=
Read=Lesen
Filter=
Allow multiple selection=
@ -56,19 +53,23 @@ No mail=Keine Nachrichten
Reply=Antworten
Reply all=Allen antworten
Forward=Weiter
Date=Datum
Ascending=
Descending=
Date=Datum
(No description)=(Keine Beschreibung)
No maillist=Keine Verteilerliste
You have mail! Type /mail to read=
Add=Hinzufügen
Remove=Entfernen
Back=Zurück
Notifications=
Chat notifications=
On join notifications=
HUD notifications=
Sound notifications=
Message list=
Show unread in different color=
Show CC/BCC in different color=
Default sorting fields=
From/To=Von/An
Reset=
Subject=Betreff

View File

@ -16,6 +16,8 @@ BCC=CCO
Cancel=Cancelar
Save draft=Guardar borrador
Send=Enviar
Subject=Asunto
To=Para
CC=CC
Name=Nombre
No drafts=No hay borradores
@ -30,23 +32,18 @@ Mail lists=Listas de correo
Options=
Close=Cerrar
(No subject)=(Sin asunto)
To=Para
Player name=Nombre del jugador
That name is already in your contacts=Ese nombre ya está en tus contactos
The contact name cannot be empty.=Ese nombre de contacto no puede estar vacío.
Save=Guardar
Maillist name=Nombre de la lista de correo
Desc=Desc
Players=Jugadores
That name is already in your mailing lists.=Ese nombre ya está entus listas de correo.
The mailing list name cannot be empty.=Ese nombre de lista de correo no puede estar vacío.
Back=Volver
Save=Guardar
Mark Read=Marcar como leído
Mark Unread=Marcar como no leído
From=De
(No description)=(Sin descripción)
No maillist=Sin lista de correo
You have mail! Type /mail to read=
Read=Leído
Filter=Filtrar
Allow multiple selection=Permitir selección múltiple
@ -56,19 +53,23 @@ No mail=Sin correo
Reply=Responder
Reply all=Responder a todos
Forward=Reenviar
Date=Fecha
Ascending=Ascendente
Descending=Descendiente
Date=Fecha
(No description)=(Sin descripción)
No maillist=Sin lista de correo
You have mail! Type /mail to read=
Add=Añadir
Remove=Quitar
Back=Volver
Notifications=
Chat notifications=
On join notifications=
HUD notifications=
Sound notifications=
Message list=
Show unread in different color=
Show CC/BCC in different color=
Default sorting fields=
From/To=De/Para
Reset=
Subject=Asunto

View File

@ -16,6 +16,8 @@ BCC=Cci
Cancel=Annuler
Save draft=Enregistrer le brouillon
Send=Envoyer
Subject=Objet
To=À
CC=Cc
Name=Nom
No drafts=Pas de brouillons
@ -30,23 +32,18 @@ Mail lists=Listes de diffusion
Options=Options
Close=Fermer
(No subject)=(Sans objet)
To=À
Player name=Nom du joueur
That name is already in your contacts=Ce nom est déjà dans vos contacts
The contact name cannot be empty.=Le nom du contact ne peut pas être vide.
Save=Sauvegarder
Maillist name=Nom de la liste de diffusion
Desc=Desc
Players=Joueurs
That name is already in your mailing lists.=Ce nom est déjà dans vos listes de diffusion.
The mailing list name cannot be empty.=Le nom de la liste de diffusion ne peut pas être vide.
Back=Retour
Save=Sauvegarder
Mark Read=Marquer comme lu
Mark Unread=Marquer non lu
From=De
(No description)=Sans description
No maillist=Aucune liste de diffusion
You have mail! Type /mail to read=Vous avez reçu un mail ! Entrez /mail pour le consulter
Read=Lire
Filter=Filtre
Allow multiple selection=Autoriser la sélection multiple
@ -56,19 +53,23 @@ No mail=Aucun mail
Reply=Répondre
Reply all=Répondre à tous
Forward=Transférer
Date=Date
Ascending=Croissant
Descending=Décroissant
Date=Date
(No description)=Sans description
No maillist=Aucune liste de diffusion
You have mail! Type /mail to read=Vous avez reçu un mail ! Entrez /mail pour le consulter
Add=Ajouter
Remove=Enlever
Back=Retour
Notifications=Notifications
Chat notifications=Notifications dans le tchat
On join notifications=Notifications à la connexion
HUD notifications=Notifications ATH
Sound notifications=Notifications sonores
Message list=Liste de messages
Show unread in different color=Coloriser les non lus
Show CC/BCC in different color=Coloriser les Cc/Cci
Default sorting fields=Champs de tri par défaut
From/To=De/À
Reset=Réinitialiser
Subject=Objet

View File

@ -16,6 +16,8 @@ BCC=BCC
Cancel=Cancelar
Save draft=Salvar rascunho
Send=Enviar
Subject=Assunto
To=Para
CC=CC
Name=Nome
No drafts=Sem rascunhos
@ -30,23 +32,18 @@ Mail lists=Lista de correios
Options=Opções
Close=Fechar
(No subject)=(Sem assunto)
To=Para
Player name=Nome do jogador
That name is already in your contacts=Esse nome já consta em sua lista de contatos
The contact name cannot be empty.=Informe o nome do destinatário
Save=Salvar
Maillist name=Nome da lista de discussão
Desc=Descrição
Players=Jogador
That name is already in your mailing lists.=Esse nome ja está sendo usado em sua lista de discussões
The mailing list name cannot be empty.=O nome da lista de discussões deve ser informado
Back=Voltar
Save=Salvar
Mark Read=Marcar como lido
Mark Unread=Marcar como não lido
From=De
(No description)=(sem descrição)
No maillist=Sem lista de discussão
You have mail! Type /mail to read=Você recebeu e-mail! Tecle /mail para ler
Read=Ler
Filter=Filtrar
Allow multiple selection=Permitir selecionar vários
@ -56,20 +53,23 @@ No mail=Sem e-mails no momento
Reply=Responder
Reply all=Responder Todos
Forward=Encaminhar
Date=Data
Ascending=Ascendente
Descending=Descendente
Date=Data
(No description)=(sem descrição)
No maillist=Sem lista de discussão
You have mail! Type /mail to read=Você recebeu e-mail! Tecle /mail para ler
Add=Adicionar
Remove=Remover
Back=Voltar
Notifications=Notificações
Chat notifications=Notificação de conversa
On join notifications=Notificação ao entrar
HUD notifications=Notificação no HUD
Sound notifications=
Message list=Lista de mensagens
Show unread in different color=Exibir mensagens não lidas em uma cor diferente
Show CC/BCC in different color=Exibir mensagens com copia em uma cor diferente
Default sorting fields=Ordenamento de campos padrão
From/To=De/Para
Reset=
Subject=Assunto

View File

@ -16,6 +16,8 @@ BCC=密件副本
Cancel=取消
Save draft=儲存草稿
Send=發送
Subject=主旨
To=收件人
CC=副本
Name=名稱
No drafts=沒有草稿
@ -30,23 +32,18 @@ Mail lists=郵件列表
Options=
Close=關閉
(No subject)=(沒有主旨)
To=收件人
Player name=玩家名稱
That name is already in your contacts=
The contact name cannot be empty.=
Save=儲存
Maillist name=郵件列表名稱
Desc=描述
Players=玩家
That name is already in your mailing lists.=
The mailing list name cannot be empty.=
Back=返回
Save=儲存
Mark Read=標記已讀
Mark Unread=標記未讀
From=寄件者
(No description)=(沒有描述)
No maillist=沒有郵件列表
You have mail! Type /mail to read=
Read=閱讀
Filter=
Allow multiple selection=
@ -56,19 +53,23 @@ No mail=沒有郵件
Reply=回覆
Reply all=回覆所有人
Forward=轉寄
Date=日期
Ascending=
Descending=
Date=日期
(No description)=(沒有描述)
No maillist=沒有郵件列表
You have mail! Type /mail to read=
Add=加入
Remove=移除
Back=返回
Notifications=
Chat notifications=
On join notifications=
HUD notifications=
Sound notifications=
Message list=
Show unread in different color=
Show CC/BCC in different color=
Default sorting fields=
From/To=
Reset=
Subject=主旨

View File

@ -16,6 +16,8 @@ BCC=
Cancel=
Save draft=
Send=
Subject=
To=
CC=
Name=
No drafts=
@ -30,23 +32,18 @@ Mail lists=
Options=
Close=
(No subject)=
To=
Player name=
That name is already in your contacts=
The contact name cannot be empty.=
Save=
Maillist name=
Desc=
Players=
That name is already in your mailing lists.=
The mailing list name cannot be empty.=
Back=
Save=
Mark Read=
Mark Unread=
From=
(No description)=
No maillist=
You have mail! Type /mail to read=
Read=
Filter=
Allow multiple selection=
@ -56,19 +53,23 @@ No mail=
Reply=
Reply all=
Forward=
Date=
Ascending=
Descending=
Date=
(No description)=
No maillist=
You have mail! Type /mail to read=
Add=
Remove=
Back=
Notifications=
Chat notifications=
On join notifications=
HUD notifications=
Sound notifications=
Message list=
Show unread in different color=
Show CC/BCC in different color=
Default sorting fields=
From/To=
Reset=
Subject=

BIN
sounds/mail_notif.ogg Normal file

Binary file not shown.

View File

@ -263,6 +263,7 @@ function mail.get_setting_default_value(setting_name)
chat_notifications = true,
onjoin_notifications = true,
hud_notifications = true,
sound_notifications = true,
unreadcolorenable = true,
cccolorenable = true,
defaultsortfield = 3,

View File

@ -37,7 +37,8 @@ function mail.show_about(name)
[[#FFF,NatureFreshMilk,Maintenance,]] ..
[[#FFF,imre84,UI fixes,]] ..
[[#FFF,Chache,Spanish translation,]] ..
[[#FFF,APercy,Brazilian Portuguese trans.]
[[#FFF,APercy,Brazilian Portuguese trans.,]] ..
[[#FFF,Nuno Filipe Povoa,mail_notif.ogg]
]] .. mail.theme
minetest.show_formspec(name, FORMNAME, formspec)

View File

@ -17,6 +17,8 @@ function mail.show_settings(name)
tostring(mail.get_setting(name, "onjoin_notifications")) .. [[]
checkbox[0,2.0;hud_notifications;]] .. S("HUD notifications") .. [[;]] ..
tostring(mail.get_setting(name, "hud_notifications")) .. [[]
checkbox[0,2.4;sound_notifications;]] .. S("Sound notifications") .. [[;]] ..
tostring(mail.get_setting(name, "sound_notifications")) .. [[]
box[5,0.8;3,0.45;#466432]
label[5.2,0.8;]] .. S("Message list") .. [[]
@ -68,6 +70,9 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
elseif fields.hud_notifications then
mail.selected_idxs.hud_notifications[playername] = fields.hud_notifications == "true"
elseif fields.sound_notifications then
mail.selected_idxs.sound_notifications[playername] = fields.sound_notifications == "true"
elseif fields.unreadcolorenable then
mail.selected_idxs.unreadcolorenable[playername] = fields.unreadcolorenable == "true"
@ -79,6 +84,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
mail.set_setting(playername, "chat_notifications", mail.selected_idxs.chat_notifications[playername])
mail.set_setting(playername, "onjoin_notifications", mail.selected_idxs.onjoin_notifications[playername])
mail.set_setting(playername, "hud_notifications", mail.selected_idxs.hud_notifications[playername])
mail.set_setting(playername, "sound_notifications", mail.selected_idxs.sound_notifications[playername])
mail.set_setting(playername, "unreadcolorenable", mail.selected_idxs.unreadcolorenable[playername])
mail.set_setting(playername, "cccolorenable", mail.selected_idxs.cccolorenable[playername])
-- dropdowns