Thread Tools Display Modes
Prev Previous Post   Next Post Next
04-24-24, 07:05 PM   #1
Sharpedge
A Theradrim Guardian
 
Sharpedge's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2022
Posts: 68
Need a little guidance...

The little snippet below works for the most part. The problem that I am having is that the Solo Shuffle Rating will only show if you are in a match. Once you leave the match is says "N/A". I know that it is using this C_PvP.GetPVPActiveMatchPersonalRatedInfo().....But I cannot for the life of me find anything that will actually show it outside of a match. Can anyone send me in the right direction on this?

Code:
local function UpdatePvPStatsFrame()
    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 conquestCap = weeklyProgress.maxProgress or 1350

    if conquestCap == 1250 then
        conquestCap = 1350
    end
   
    local pvpRatingInfo = C_PvP.GetPVPActiveMatchPersonalRatedInfo()
    local soloShuffleRating = pvpRatingInfo and pvpRatingInfo.personalRating 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)  
end

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

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Need a little guidance...


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