Add global display to battlepass

This commit is contained in:
2024-04-13 16:23:14 +02:00
parent 59d6165dec
commit 0e98ef5d2d
2 changed files with 30 additions and 1 deletions

View File

@@ -10,6 +10,32 @@ if not WeakAurasSaved.Cyka.LoginInfo[Today][UnitName("player")] then
}
end
local greenColor = "|cff00ff00"
local noColor = "|r"
BattlepassAccountInfo = ""
local function UpdateAccountInfo()
local ret = {}
for char, info in pairs(WeakAurasSaved.Cyka.LoginInfo[Today]) do
if info.claimed == 1 then
char = string.format("%s%s %d%s", greenColor, char, info.onlineTimeInMinutes, noColor)
else
char = string.format("%s %d", char, info.onlineTimeInMinutes)
end
ret[#ret + 1] = char
end
BattlepassAccountInfo = table.concat(ret, "\n")
end
-- [02:37 PM] Bluepotato
-- [02:37 PM] onlineTimeInMinutes=120,
-- [02:37 PM] claimed=1
-- [02:37 PM] Smolpotato
-- [02:37 PM] onlineTimeInMinutes=120,
-- [02:37 PM] claimed=1
-- [02:37 PM] Thiccpotato
-- [02:37 PM] onlineTimeInMinutes=57,
-- [02:37 PM] claimed=0
---@param input string
---@param deliminer string
---@return table<string>
@@ -55,6 +81,8 @@ BattlepassInfo = {
BattlepassInfo.PingApi()
end)
end
UpdateAccountInfo()
end,
DoClaim = function()
SendAddonMessage('UIMSG_TO_SERVER', "UIMSG_WEEKLY_REW_GET" .. "\t", 'WHISPER', UnitName('player'))
@@ -79,5 +107,6 @@ for k, v in pairs(BattlepassInfo) do
end
BattlepassInfo()
-- Claiming rewards works fine
-- But the bar does not hide once rewards are claimed