Skip to content

Commit

Permalink
Shadowlands LDB feed update
Browse files Browse the repository at this point in the history
  • Loading branch information
AcidWeb committed Dec 15, 2020
1 parent 2afda7e commit ab2bde6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 8 deletions.
19 changes: 14 additions & 5 deletions REFlex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ local GetBattlefieldStatData = _G.GetBattlefieldStatData
local GetBattlefieldArenaFaction = _G.GetBattlefieldArenaFaction
local GetInstanceInfo = _G.GetInstanceInfo
local GetRandomBGInfo = _G.C_PvP.GetRandomBGInfo
local GetRandomEpicBGInfo = _G.C_PvP.GetRandomEpicBGInfo
local GetNumBattlefieldScores = _G.GetNumBattlefieldScores
local GetMatchPVPStatColumns = _G.C_PvP.GetMatchPVPStatColumns
local GetActiveMatchDuration = _G.C_PvP.GetActiveMatchDuration
Expand Down Expand Up @@ -260,6 +261,7 @@ function RE:OnEvent(_, event, ...)
RE.Tooltip:AddHeader("", "")
RE.Tooltip:SetCell(1, 1, "|cFFFFD100".._G.DAILY.."|r", RE.Tooltip:GetHeaderFont(), "CENTER", 2)
RE.Tooltip:AddLine(_G.BATTLEGROUND , GetRandomBGInfo().hasRandomWinToday and "|TInterface\\RaidFrame\\ReadyCheck-Ready:0|t" or "|TInterface\\RaidFrame\\ReadyCheck-NotReady:0|t")
RE.Tooltip:AddLine(_G.ITEM_QUALITY4_DESC.." ".._G.BATTLEGROUND, GetRandomEpicBGInfo().hasRandomWinToday and "|TInterface\\RaidFrame\\ReadyCheck-Ready:0|t" or "|TInterface\\RaidFrame\\ReadyCheck-NotReady:0|t")
RE.Tooltip:AddLine(_G.ARENA_CASUAL, HasArenaSkirmishWinToday() and "|TInterface\\RaidFrame\\ReadyCheck-Ready:0|t" or "|TInterface\\RaidFrame\\ReadyCheck-NotReady:0|t")
if IsPlayerAtEffectiveMaxLevel() and brawlInfo and brawlInfo.canQueue then
RE.Tooltip:AddLine(_G.LFG_CATEGORY_BATTLEFIELD, select(5, GetBrawlRewards(brawlInfo.brawlType)) and "|TInterface\\RaidFrame\\ReadyCheck-Ready:0|t" or "|TInterface\\RaidFrame\\ReadyCheck-NotReady:0|t")
Expand All @@ -272,15 +274,22 @@ function RE:OnEvent(_, event, ...)
end
RE.Tooltip:AddLine("", "")
RE.Tooltip:AddHeader("", "")
RE.Tooltip:SetCell(10 - mod, 1, "|cFFFFD100".._G.HONOR.."|r", RE.Tooltip:GetHeaderFont(), "CENTER", 2)
RE.Tooltip:SetCell(11 - mod, 1, "|cFFFFD100".._G.HONOR.."|r", RE.Tooltip:GetHeaderFont(), "CENTER", 2)
RE.Tooltip:AddLine("", "")
RE.Tooltip:SetCell(11 - mod, 1, UnitHonor("player").." / "..UnitHonorMax("player"), "CENTER", 2)
RE.Tooltip:SetCell(12 - mod, 1, UnitHonor("player").." / "..UnitHonorMax("player"), "CENTER", 2)
if IsPlayerAtEffectiveMaxLevel() and GetCurrentArenaSeason() > 0 then
local current, max = RE:GetConquestPoints()
local current, cap = RE:GetConquestPoints()
local weeklyCurrent, weeklycap, weeklyProgress = RE:GetWeeklyChest()
RE.Tooltip:AddHeader("", "")
RE.Tooltip:SetCell(12 - mod, 1, "|cFFFFD100".._G.PVP_CONQUEST.."|r", RE.Tooltip:GetHeaderFont(), "CENTER", 2)
RE.Tooltip:SetCell(13 - mod, 1, "|cFFFFD100".._G.PVP_CONQUEST.."|r", RE.Tooltip:GetHeaderFont(), "CENTER", 2)
RE.Tooltip:AddLine("", "")
RE.Tooltip:SetCell(13 - mod, 1, current.." / "..max, "CENTER", 2)
RE.Tooltip:SetCell(14 - mod, 1, current.." / "..cap, "CENTER", 2)
RE.Tooltip:AddHeader("", "")
RE.Tooltip:SetCell(15 - mod, 1, "|cFFFFD100".._G.RATED_PVP_WEEKLY_CHEST.."|r", RE.Tooltip:GetHeaderFont(), "CENTER", 2)
RE.Tooltip:AddLine("", "")
RE.Tooltip:SetCell(16 - mod, 1, weeklyCurrent.." / "..weeklycap, "CENTER", 2)
RE.Tooltip:AddLine("", "")
RE.Tooltip:SetCell(17 - mod, 1, weeklyProgress, "CENTER", 2)
end
RE.Tooltip:Show()
end
Expand Down
23 changes: 20 additions & 3 deletions REFlexFunctions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ local QTIP = LibStub("LibQTip-1.0")
local DUMP = LibStub("LibTextDump-1.0")

local tinsert, tsort, tconcat, tremove = _G.table.insert, _G.table.sort, _G.table.concat, _G.table.remove
local mfloor = _G.math.floor
local mfloor, min = _G.math.floor, _G.math.min
local sgsub, sbyte = _G.string.gsub, _G.string.byte
local strsplit, date, select, tostring, PlaySound, time, pairs, ipairs = _G.strsplit, _G.date, _G.select, _G.tostring, _G.PlaySound, _G.time, _G.pairs, _G.ipairs
local GetAchievementCriteriaInfo = _G.GetAchievementCriteriaInfo
local GetHonorRewardInfo = _G.C_PvP.GetHonorRewardInfo
local GetCurrencyInfo = _G.C_CurrencyInfo.GetCurrencyInfo
local GetConquestWeeklyProgress = _G.C_WeeklyRewards.GetConquestWeeklyProgress
local GetSecondsUntilWeeklyReset = _G.C_DateAndTime.GetSecondsUntilWeeklyReset
local PanelTemplates_GetSelectedTab = _G.PanelTemplates_GetSelectedTab
Expand Down Expand Up @@ -736,11 +737,27 @@ function RE:DumpCSV()
end

function RE:GetConquestPoints()
local currencyInfo = GetCurrencyInfo(_G.Constants.CurrencyConsts.CONQUEST_CURRENCY_ID)
if currencyInfo then
return min(currencyInfo.totalEarned, currencyInfo.maxQuantity), currencyInfo.maxQuantity
else
return 0, 0
end
end

function RE:GetWeeklyChest()
local progress = GetConquestWeeklyProgress()
if progress then
return progress.progress, progress.maxProgress
local weeklyStatus = {}
for _=1, progress.unlocksCompleted do
tinsert(weeklyStatus, "|TInterface\\RaidFrame\\ReadyCheck-Ready:0|t")
end
for _=1, progress.maxUnlocks - progress.unlocksCompleted do
tinsert(weeklyStatus, "|TInterface\\RaidFrame\\ReadyCheck-NotReady:0|t")
end
return progress.progress, progress.maxProgress, tconcat(weeklyStatus, " ")
else
return 0, 0
return 0, 0, ""
end
end

Expand Down

0 comments on commit ab2bde6

Please sign in to comment.