summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2014-07-06 22:52:40 +0200
committerWuzzy <almikes@aol.com>2014-07-06 22:52:40 +0200
commit812c15c9dd66b56e44834bd43596d39f53fa1ec1 (patch)
tree46c1cb4b5746c3d519a39e7b85d6cb462df6156c
parent33c50c81ac2953bbd1f54a0a67a7dd2c5de1d001 (diff)
Show duration on first HUD add
-rw-r--r--init.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index f06e5a7..d634808 100644
--- a/init.lua
+++ b/init.lua
@@ -90,7 +90,7 @@ function playereffects.apply_effect_type(effect_type_id, duration, player)
else
free_hudpos = biggest_hudpos + 1
end
- local hudid = playereffects.hud_effect(effect_type_id, player, free_hudpos)
+ local hudid = playereffects.hud_effect(effect_type_id, player, free_hudpos, duration)
local effect = {
playername = playername,
@@ -275,13 +275,13 @@ function playereffects.hud_clear(player)
end
end
-function playereffects.hud_effect(effect_type_id, player, pos)
+function playereffects.hud_effect(effect_type_id, player, pos, time_left)
local id
id = player:hud_add({
hud_elem_type = "text",
position = { x = 1, y = 0.3 },
name = "effect_"..effect_type_id,
- text = playereffects.effect_types[effect_type_id].description,
+ text = playereffects.effect_types[effect_type_id].description .. " ("..tostring(time_left).." s)",
scale = { x = 120, y = 20},
alignment = 1,
direction = 1,