diff options
author | rubenwardy <rw@rubenwardy.com> | 2018-04-06 00:24:56 +0100 |
---|---|---|
committer | rubenwardy <rw@rubenwardy.com> | 2018-04-06 00:24:56 +0100 |
commit | 37275963df6a59b461c74c5a50169339650a7c3e (patch) | |
tree | 774be5d8d8c84b35b35bab391d9cfc25a84ee10f | |
parent | 75c01a188a75e49ae79bdea05148dcfdb098c8ec (diff) |
Fix notification positioningv3.1.0
Fixes #55, also fixes @Fixer-007
-rw-r--r-- | api.lua | 25 |
1 files changed, 14 insertions, 11 deletions
@@ -428,7 +428,7 @@ function awards.unlock(name, award) name = "award_bg", scale = {x = 2, y = 1}, text = background, - position = {x = 0.5, y = 0}, + position = {x = 0.5, y = 0.05}, offset = {x = 0, y = 138}, alignment = {x = 0, y = -1} }) @@ -444,8 +444,8 @@ function awards.unlock(name, award) number = 0xFFFFFF, scale = {x = 100, y = 20}, text = hud_announce, - position = {x = 0.5, y = 0}, - offset = {x = 0, y = 40}, + position = {x = 0.5, y = 0.05}, + offset = {x = 0, y = 45}, alignment = {x = 0, y = -1} }) local three = player:hud_add({ @@ -454,8 +454,8 @@ function awards.unlock(name, award) number = 0xFFFFFF, scale = {x = 100, y = 20}, text = title, - position = {x = 0.5, y = 0}, - offset = {x = 30, y = 100}, + position = {x = 0.5, y = 0.05}, + offset = {x = 0, y = 100}, alignment = {x = 0, y = -1} }) local four = player:hud_add({ @@ -463,15 +463,18 @@ function awards.unlock(name, award) name = "award_icon", scale = {x = 4, y = 4}, text = icon, - position = {x = 0.4, y = 0}, - offset = {x = -81.5, y = 126}, + position = {x = 0.5, y = 0.05}, + offset = {x = -200.5, y = 126}, alignment = {x = 0, y = -1} }) minetest.after(4, function() - player:hud_remove(one) - player:hud_remove(two) - player:hud_remove(three) - player:hud_remove(four) + local player2 = minetest.get_player_by_name(name) + if player2 then + player2:hud_remove(one) + player2:hud_remove(two) + player2:hud_remove(three) + player2:hud_remove(four) + end end) end end |