Index of those buttons should match arguments of lua funtions GetWorldPVPAreaInfo, GetBattlegroundInfo.
And there's some info stored in those buttons:
Code:
frame = _G["PVPHonorFrameBgButton"..currentFrameNum];
...
frame.pvpID = pvpID;
frame.localizedName = localizedName;
frame.isWorldPVP = isWorldPVP;
...
so you should be able to find those values in memory.
Code:
function PVPHonor_UpdateBattlegrounds()
local frame, _;
local localizedName, canEnter, isHoliday;
local pvpID, isActive, canQueue, startTime;
local tempString, isBig, isWorldPVP;
local offset = FauxScrollFrame_GetOffset(PVPHonorFrameTypeScrollFrame);
local currentFrameNum = 1;
local availableBGs = 0;
local numWorldPvP = GetNumWorldPVPAreas();
local numBgs = GetNumBattlegroundTypes();
local numTypes = numWorldPvP + numBgs ;
for i=1,numTypes do
frame = _G["PVPHonorFrameBgButton"..currentFrameNum];
if i <= numWorldPvP then
isHoliday = false;
_, localizedName, isActive, canQueue, startTime, canEnter = GetWorldPVPAreaInfo(i);
pvpID = i;
isWorldPVP = true;
else
pvpID = i-numWorldPvP;
isActive = false;
canQueue = true;
startTime = -1;
localizedName, canEnter, isHoliday = GetBattlegroundInfo(i-numWorldPvP);
isWorldPVP = false
end
if ( localizedName and canEnter ) then
if offset > 0 then
offset = offset -1;
elseif ( frame ) then
frame.pvpID = pvpID;
frame.localizedName = localizedName;
frame.isWorldPVP = isWorldPVP;
if canQueue then
frame:Enable();
if ( not PVPHonorFrame.selectedButtonIndex ) then
frame:Click();
end
else
frame:Disable();
localizedName = GRAY_FONT_COLOR_CODE..localizedName;
end
tempString = localizedName;
if isWorldPVP then
frame:SetScript("OnUpdate", PVPHonor_UpdateWorldPVPTimer);
frame.timeStep = 0;
frame.worldIndex = i;
else
frame:SetScript("OnUpdate", nil);
end
if ( isHoliday ) then
tempString = tempString.." ("..BATTLEGROUND_HOLIDAY..")";
end
if ( isActive ) then
tempString = tempString.." ("..WINTERGRASP_IN_PROGRESS..")";
elseif ( startTime > 0 ) then
tempString = tempString.." ("..SecondsToTime(startTime)..")";
end
if PVPHonorFrame.selectedPvpID == frame.pvpID and PVPHonorFrame.selectedIsWorldPvp == isWorldPVP then
frame:LockHighlight();
else
frame:UnlockHighlight();
end
frame.title:SetText(tempString);
frame:Show();
currentFrameNum = currentFrameNum + 1;
end
availableBGs = availableBGs + 1;
end
end
if ( currentFrameNum <= NUM_DISPLAYED_BATTLEGROUNDS ) then
isBig = true; --Espand the highlight to cover where the scroll bar usually is.
end
for i=1,NUM_DISPLAYED_BATTLEGROUNDS do
frame = _G["PVPHonorFrameBgButton"..i];
if ( isBig ) then
frame:SetWidth(BG_BUTTON_WIDTH);
else
frame:SetWidth(BG_BUTTON_SCROLL_WIDTH);
end
end
for i=currentFrameNum,NUM_DISPLAYED_BATTLEGROUNDS do
frame = _G["PVPHonorFrameBgButton"..i];
frame:Hide();
end
PVPHonor_UpdateQueueStatus();
PVPHonorFrame_UpdateGroupAvailable();
FauxScrollFrame_Update(PVPHonorFrameTypeScrollFrame, availableBGs, NUM_DISPLAYED_BATTLEGROUNDS, 16);
end