mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-24 21:10:49 +00:00
else-statement restored, comments added
This commit is contained in:
@@ -218,13 +218,20 @@ pfUI:RegisterModule("player", function ()
|
|||||||
for i=1, 16 do
|
for i=1, 16 do
|
||||||
local timeleft = GetPlayerBuffTimeLeft(GetPlayerBuff(i-1,"HELPFUL"))
|
local timeleft = GetPlayerBuffTimeLeft(GetPlayerBuff(i-1,"HELPFUL"))
|
||||||
if timeleft ~= nil and timeleft ~= 0 then
|
if timeleft ~= nil and timeleft ~= 0 then
|
||||||
|
-- if there are more than 0 seconds left
|
||||||
if timeleft < 60 then
|
if timeleft < 60 then
|
||||||
|
-- show seconds if less than 60 seconds
|
||||||
pfUI.uf.player.buff.buffs[i].cd:SetText(ceil(timeleft))
|
pfUI.uf.player.buff.buffs[i].cd:SetText(ceil(timeleft))
|
||||||
elseif timeleft < 3600 then
|
elseif timeleft < 3600 then
|
||||||
|
-- show minutes if less than 3600 seconds (1 hour)
|
||||||
pfUI.uf.player.buff.buffs[i].cd:SetText(ceil(timeleft/60) .. 'm')
|
pfUI.uf.player.buff.buffs[i].cd:SetText(ceil(timeleft/60) .. 'm')
|
||||||
else
|
else
|
||||||
|
-- otherwise show hours
|
||||||
pfUI.uf.player.buff.buffs[i].cd:SetText(ceil(timeleft/3600) .. 'h')
|
pfUI.uf.player.buff.buffs[i].cd:SetText(ceil(timeleft/3600) .. 'h')
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
-- if there's no time left or not set, empty buff text
|
||||||
|
pfUI.uf.player.buff.buffs[i].cd:SetText("")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
@@ -310,13 +317,20 @@ pfUI:RegisterModule("player", function ()
|
|||||||
for i=1, 16 do
|
for i=1, 16 do
|
||||||
local timeleft = GetPlayerBuffTimeLeft(GetPlayerBuff(i-1,"HARMFUL"))
|
local timeleft = GetPlayerBuffTimeLeft(GetPlayerBuff(i-1,"HARMFUL"))
|
||||||
if timeleft ~= nil and timeleft ~= 0 then
|
if timeleft ~= nil and timeleft ~= 0 then
|
||||||
|
-- if there are more than 0 seconds left
|
||||||
if timeleft < 60 then
|
if timeleft < 60 then
|
||||||
|
-- show seconds if less than 60 seconds
|
||||||
pfUI.uf.player.debuff.debuffs[i].cd:SetText(ceil(timeleft))
|
pfUI.uf.player.debuff.debuffs[i].cd:SetText(ceil(timeleft))
|
||||||
elseif timeleft < 3600 then
|
elseif timeleft < 3600 then
|
||||||
|
-- show minutes if less than 3600 seconds (1 hour)
|
||||||
pfUI.uf.player.debuff.debuffs[i].cd:SetText(ceil(timeleft/60)..'m')
|
pfUI.uf.player.debuff.debuffs[i].cd:SetText(ceil(timeleft/60)..'m')
|
||||||
else
|
else
|
||||||
|
-- otherwise show hours
|
||||||
pfUI.uf.player.buff.buffs[i].cd:SetText(ceil(timeleft/3600) .. 'h')
|
pfUI.uf.player.buff.buffs[i].cd:SetText(ceil(timeleft/3600) .. 'h')
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
-- if there's no time left or not set, empty buff text
|
||||||
|
pfUI.uf.player.buff.buffs[i].cd:SetText("")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user