Rework battle pass timer into multiple weakauras
This commit is contained in:
17
FreshShit/BattlePassTimer/BattlePassTimeDisplay/init.lua
Normal file
17
FreshShit/BattlePassTimer/BattlePassTimeDisplay/init.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
if WeakAurasSaved.Cyka == nil then WeakAurasSaved.Cyka = {} end
|
||||
if WeakAurasSaved.Cyka.LoginInfo == nil then WeakAurasSaved.Cyka.LoginInfo = {} end
|
||||
|
||||
Today = date("%Y-%m-%d")
|
||||
if WeakAurasSaved.Cyka.LoginInfo[UnitName("player")] == nil then WeakAurasSaved.Cyka.LoginInfo[UnitName("player")] = {} end
|
||||
if WeakAurasSaved.Cyka.LoginInfo[UnitName("player")][Today] == nil then
|
||||
WeakAurasSaved.Cyka.LoginInfo[UnitName("player")][Today] = {
|
||||
isClaimed = false,
|
||||
timeLeft = 120,
|
||||
}
|
||||
end
|
||||
|
||||
aura_env.GetTimeLeft = function()
|
||||
local timeLeft = WeakAurasSaved.Cyka.LoginInfo[UnitName("player")][Today].timeLeft
|
||||
if timeLeft == nil then return 120 end
|
||||
return timeLeft
|
||||
end
|
||||
Reference in New Issue
Block a user