{"action":"created","issue":{"url":"https://api.github.com/repos/CraigyDavi/Craig-Server_game/issues/48","labels_url":"https://api.github.com/repos/CraigyDavi/Craig-Server_game/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/CraigyDavi/Craig-Server_game/issues/48/comments","events_url":"https://api.github.com/repos/CraigyDavi/Craig-Server_game/issues/48/events","html_url":"https://github.com/CraigyDavi/Craig-Server_game/issues/48","id":98622844,"number":48,"title":"Add notification for inbox message on the crosshair","user":{"login":"CraigyDavi","id":5341072,"avatar_url":"https://avatars.githubusercontent.com/u/5341072?v=3","gravatar_id":"","url":"https://api.github.com/users/CraigyDavi","html_url":"https://github.com/CraigyDavi","followers_url":"https://api.github.com/users/CraigyDavi/followers","following_url":"https://api.github.com/users/CraigyDavi/following{/other_user}","gists_url":"https://api.github.com/users/CraigyDavi/gists{/gist_id}","starred_url":"https://api.github.com/users/CraigyDavi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CraigyDavi/subscriptions","organizations_url":"https://api.github.com/users/CraigyDavi/orgs","repos_url":"https://api.github.com/users/CraigyDavi/repos","events_url":"https://api.github.com/users/CraigyDavi/events{/privacy}","received_events_url":"https://api.github.com/users/CraigyDavi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/CraigyDavi/Craig-Server_game/labels/Enhancement","name":"Enhancement","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-02T17:12:51Z","updated_at":"2015-08-02T20:50:29Z","closed_at":null,"body":""},"comment":{"url":"https://api.github.com/repos/CraigyDavi/Craig-Server_game/issues/comments/127069718","html_url":"https://github.com/CraigyDavi/Craig-Server_game/issues/48#issuecomment-127069718","issue_url":"https://api.github.com/repos/CraigyDavi/Craig-Server_game/issues/48","id":127069718,"user":{"login":"Amaz1","id":4390945,"avatar_url":"https://avatars.githubusercontent.com/u/4390945?v=3","gravatar_id":"","url":"https://api.github.com/users/Amaz1","html_url":"https://github.com/Amaz1","followers_url":"https://api.github.com/users/Amaz1/followers","following_url":"https://api.github.com/users/Amaz1/following{/other_user}","gists_url":"https://api.github.com/users/Amaz1/gists{/gist_id}","starred_url":"https://api.github.com/users/Amaz1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Amaz1/subscriptions","organizations_url":"https://api.github.com/users/Amaz1/orgs","repos_url":"https://api.github.com/users/Amaz1/repos","events_url":"https://api.github.com/users/Amaz1/events{/privacy}","received_events_url":"https://api.github.com/users/Amaz1/received_events","type":"User","site_admin":false},"created_at":"2015-08-02T20:50:29Z","updated_at":"2015-08-02T20:50:29Z","body":"Code that does it in pretty much exactly the same way as the old stuff:\r\nlocal count = 0\r\n```lua\r\nminetest.register_globalstep(function(dtime)\r\n\tcount = count + dtime\r\n\tif count > 5 then\r\n\t\tcount = 0\r\n\t\tfor _,player in pairs(minetest.get_connected_players()) do\r\n\t\t\tlocal name = player:get_player_name()\r\n\t\t\tplayer:hud_remove(memo.mail)\r\n\t\t\tplayer:hud_remove(memo.mail_text)\r\n\t\t\t\r\n\t\t\tif memo.memos[name] and #memo.memos[name] ~= 0 then\r\n\t\t\t\tmemo.mail = player:hud_add({\r\n\t\t\t\t\thud_elem_type = \"image\",\r\n\t\t\t\t\tname = \"MailIcon\",\r\n\t\t\t\t\tposition = {x=0.52, y=0.52},\r\n\t\t\t\t\ttext=\"chatplus_mail.png\",\r\n\t\t\t\t\tscale = {x=1,y=1},\r\n\t\t\t\t\talignment = {x=0.5, y=0.5},\r\n\t\t\t\t})\r\n\t\t\t\tmemo.mail_text = player:hud_add({\r\n\t\t\t\t\thud_elem_type = \"text\",\r\n\t\t\t\t\tname = \"MailText\",\r\n\t\t\t\t\tposition = {x=0.55, y=0.52},\r\n\t\t\t\t\ttext=#memo.memos[name],\r\n\t\t\t\t\tscale = {x=1,y=1},\r\n\t\t\t\t\talignment = {x=0.5, y=0.5},\r\n\t\t\t\t})\t\t\t\t\t\r\n\t\t\tend\r\n\t\tend\r\n\tend\r\nend)\r\n```\r\n\r\nHowever, you can remove the hud icons imediately with this code after this line: https://github.com/CraigyDavi/Craig-Server_game/blob/master/mods/_memo/init.lua#L124\r\n```lua\r\nplayer:hud_remove(memo.mail)\r\nplayer:hud_remove(memo.mail_text)\r\n```\r\n\r\nIf you use the second method, remove those two lines in the gloabalstep function.\r\n\r\n(Note: This doesn't display anything if there are staff mails.)"}}