Thread Tools Display Modes
Prev Previous Post   Next Post Next
04-28-24, 09:41 AM   #1
Sharpedge
A Theradrim Guardian
 
Sharpedge's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2022
Posts: 68
Need some more help....

I now have ran into a small issue. In my PvP Stats window it will display the Conquest Cap. What is showing is the "current" conquest and not the total towards the cap. Can anyone shed some light on this please?

Code:
local function UpdatePvPStatsFrame()
    if not IsAddOnLoaded("Blizzard_PVPUI") then
        LoadAddOn("Blizzard_PVPUI")
    end

        C_Timer.After(2, function()  -- Delay for 2 seconds to ensure the AddOn is fully loaded and ready
        local conquestInfo = C_CurrencyInfo.GetCurrencyInfo(Constants.CurrencyConsts.CONQUEST_CURRENCY_ID)
        local weeklyProgress = C_WeeklyRewards.GetConquestWeeklyProgress()
        local honorInfo = C_CurrencyInfo.GetCurrencyInfo(HONOR_CURRENCY_ID)
        local lifetimeHonorableKills, _ = GetPVPLifetimeStats()
        local honorLevel = UnitHonorLevel("player")
        local currentConquestPoints = conquestInfo.quantity
        local currencyInfo = C_CurrencyInfo.GetCurrencyInfo(Constants.CurrencyConsts.CONQUEST_CURRENCY_ID);
        local conquestCap = currencyInfo.maxQuantity;  -- Dynamically fetch the current conquest cap

        if not weeklyCap or weeklyCap == 0 then
            weeklyCap = 1350  
        end

        local rating = GetPersonalRatedInfo(SOLO_SHUFFLE_INDEX)
        local soloShuffleRating = rating or "N/A"

        pvpStatsFrame.honorableKillsValue:SetText(lifetimeHonorableKills)
        pvpStatsFrame.conquestValue:SetText(currentConquestPoints)
        pvpStatsFrame.conquestCapValue:SetText(currentConquestPoints .. " / " .. conquestCap)
        pvpStatsFrame.honorValue:SetText(honorInfo.quantity)
        pvpStatsFrame.honorLevelValue:SetText(honorLevel)
        pvpStatsFrame.soloShuffleRatingValue:SetText(soloShuffleRating)

        local canUseRated = C_PvP.CanPlayerUseRatedPVPUI()
        local canUsePremade = C_LFGInfo.CanPlayerUsePremadeGroup()

        if canUseRated then
            PVPQueueFrame_SetCategoryButtonState(PVPQueueFrame.CategoryButton2, true)
            PVPQueueFrame.CategoryButton2.tooltip = nil
        end

        if canUsePremade then
            PVPQueueFrame_SetCategoryButtonState(PVPQueueFrame.CategoryButton3, true)
            PVPQueueFrame.CategoryButton3.tooltip = nil
        end
    end)
end

pvpStatsFrame:RegisterEvent("CURRENCY_DISPLAY_UPDATE")
pvpStatsFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
pvpStatsFrame:RegisterEvent("WEEKLY_REWARDS_UPDATE")
pvpStatsFrame:SetScript("OnEvent", UpdatePvPStatsFrame)
pvpStatsFrame:SetScript("OnShow", UpdatePvPStatsFrame)
  Reply With Quote
 

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Need some more help....


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off