Code format

This commit is contained in:
2025-05-15 20:37:50 +02:00
parent 9e6432d0b0
commit 69d1f9fd93
105 changed files with 24069 additions and 28084 deletions

View File

@@ -26,14 +26,14 @@ local function UpdateAccountInfo()
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] 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
@@ -57,7 +57,7 @@ end
---@field currentDayOnlineTimeMilliseconds number
BattlepassInfo = {
PingApi = function()
SendAddonMessage('UIMSG_TO_SERVER', "UIMSG_GET_ONLINETIME_DAY" .. "\t", 'WHISPER', UnitName('player'))
SendAddonMessage("UIMSG_TO_SERVER", "UIMSG_GET_ONLINETIME_DAY" .. "\t", "WHISPER", UnitName("player"))
end,
ParseApi = function(msg)
local packets = aura_env.Split(msg, ":")
@@ -71,24 +71,22 @@ BattlepassInfo = {
BattlepassInfo.cost = tonumber(packets[7])
BattlepassInfo.currentDayOnlineTimeMinutes = math.floor(BattlepassInfo.currentDayOnlineTimeMilliseconds / 60000)
WeakAurasSaved.Cyka.LoginInfo[Today][UnitName("player")].onlineTimeInMinutes = BattlepassInfo
.currentDayOnlineTimeMinutes
WeakAurasSaved.Cyka.LoginInfo[Today][UnitName("player")].onlineTimeInMinutes =
BattlepassInfo.currentDayOnlineTimeMinutes
WeakAurasSaved.Cyka.LoginInfo[Today][UnitName("player")].claimed = BattlepassInfo.dayRewardComplete
if BattlepassInfo.dayRewardComplete == 0 and BattlepassInfo.currentDayOnlineTimeMinutes >= 120 then
BattlepassInfo.DoClaim()
C_Timer.After(0.2, function()
BattlepassInfo.PingApi()
end)
C_Timer.After(0.2, function() BattlepassInfo.PingApi() end)
end
UpdateAccountInfo()
end,
DoClaim = function()
SendAddonMessage('UIMSG_TO_SERVER', "UIMSG_WEEKLY_REW_GET" .. "\t", 'WHISPER', UnitName('player'))
SendAddonMessage("UIMSG_TO_SERVER", "UIMSG_WEEKLY_REW_GET" .. "\t", "WHISPER", UnitName("player"))
WeakAuras.ScanEvents("PLAY_SOUND", "Interface\\Sounds\\quack.ogg")
SendChatMessage("YEEE", "WHISPER", nil, UnitName("player"))
end
end,
}
setmetatable(BattlepassInfo, {
__call = BattlepassInfo.PingApi,
@@ -99,16 +97,13 @@ setmetatable(BattlepassInfo, {
table.insert(ret, k .. ": " .. tostring(v))
end
return table.concat(ret, "\n")
end
end,
})
for k, v in pairs(BattlepassInfo) do
if type(v) == "number" then
BattlepassInfo[k] = 0
end
if type(v) == "number" then BattlepassInfo[k] = 0 end
end
BattlepassInfo()
-- Claiming rewards works fine
-- But the bar does not hide once rewards are claimed
-- But the bar does not hide once rewards are claimed