Skip to content

Commit

Permalink
Fixed CP datatext
Browse files Browse the repository at this point in the history
  • Loading branch information
AcidWeb committed Feb 14, 2019
1 parent b357c4d commit 6f279c0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 35 deletions.
46 changes: 26 additions & 20 deletions REFlex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,6 @@ local DUMP = LibStub("LibTextDump-1.0")
_G.REFlex = RE

-- UIDropDownMenu taint workaround by foxlit
if (UIDROPDOWNMENU_VALUE_PATCH_VERSION or 0) < 2 then
UIDROPDOWNMENU_VALUE_PATCH_VERSION = 2
hooksecurefunc("UIDropDownMenu_InitializeHelper", function()
if UIDROPDOWNMENU_VALUE_PATCH_VERSION ~= 2 then
return
end
for i=1, UIDROPDOWNMENU_MAXLEVELS do
for j=1, UIDROPDOWNMENU_MAXBUTTONS do
local b = _G["DropDownList" .. i .. "Button" .. j]
if not (issecurevariable(b, "value") or b:IsShown()) then
b.value = nil
repeat
j, b["fx" .. j] = j+1
until issecurevariable(b, "value")
end
end
end
end)
end
if (UIDROPDOWNMENU_OPEN_PATCH_VERSION or 0) < 1 then
UIDROPDOWNMENU_OPEN_PATCH_VERSION = 1
hooksecurefunc("UIDropDownMenu_InitializeHelper", function(frame)
Expand All @@ -46,6 +27,31 @@ if (UIDROPDOWNMENU_OPEN_PATCH_VERSION or 0) < 1 then
end
end)
end
if (COMMUNITY_UIDD_REFRESH_PATCH_VERSION or 0) < 1 then
COMMUNITY_UIDD_REFRESH_PATCH_VERSION = 1
local function CleanDropdowns()
if COMMUNITY_UIDD_REFRESH_PATCH_VERSION ~= 1 then
return
end
local f, f2 = FriendsFrame, FriendsTabHeader
local s = f:IsShown()
f:Hide()
f:Show()
if not f2:IsShown() then
f2:Show()
f2:Hide()
end
if not s then
f:Hide()
end
end
hooksecurefunc("Communities_LoadUI", CleanDropdowns)
hooksecurefunc("SetCVar", function(n)
if n == "lastSelectedClubId" then
CleanDropdowns()
end
end)
end

--GLOBALS: UIDROPDOWNMENU_VALUE_PATCH_VERSION, UIDROPDOWNMENU_MAXLEVELS, UIDROPDOWNMENU_MAXBUTTONS, UIDROPDOWNMENU_OPEN_PATCH_VERSION, UIDROPDOWNMENU_OPEN_MENU, issecurevariable
local tinsert = _G.table.insert
Expand Down Expand Up @@ -99,7 +105,7 @@ local RegisterAddonMessagePrefix = _G.C_ChatInfo.RegisterAddonMessagePrefix
local SendAddonMessage = _G.C_ChatInfo.SendAddonMessage
local ElvUI = _G.ElvUI

RE.Version = 263
RE.Version = 264
RE.LastSquash = 1531828800
RE.FoundNewVersion = false

Expand Down
2 changes: 1 addition & 1 deletion REFlex.toc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Interface: 80100
## Title: |cFF74D06CRE|rFlex
## Notes: Collect statistics of played arena matches and battlegrounds.
## Version: 2.6.3
## Version: 2.6.4
## Author: AcidWeb
## SavedVariablesPerCharacter: REFlexSettings, REFlexDatabase, REFlexHonorDatabase
## X-Website: https://www.curseforge.com/wow/addons/reflex-battleground-historian
Expand Down
19 changes: 5 additions & 14 deletions REFlexFunctions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ 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 GetQuestLineQuests = _G.C_QuestLine.GetQuestLineQuests
local GetQuestObjectives = _G.C_QuestLog.GetQuestObjectives
local QuestUtils_GetCurrentQuestLineQuest = _G.QuestUtils_GetCurrentQuestLineQuest
local HaveQuestData = _G.HaveQuestData
local GetQuestObjectives = _G.C_QuestLog.GetQuestObjectives
local PanelTemplates_GetSelectedTab = _G.PanelTemplates_GetSelectedTab
local StaticPopup_Hide = _G.StaticPopup_Hide
local IsOnQuest = _G.C_QuestLog.IsOnQuest
local IsQuestFlaggedCompleted = _G.IsQuestFlaggedCompleted

function RE:GetPlayerData(databaseID)
return RE.Database[databaseID].Players[RE.Database[databaseID].PlayerNum]
Expand Down Expand Up @@ -747,16 +745,9 @@ function RE:DumpCSV()
end

function RE:GetConquestPoints()
local quests = GetQuestLineQuests(782)
local currentQuestID = quests[1]
for _, questID in ipairs(quests) do
if not IsQuestFlaggedCompleted(questID) and not IsOnQuest(questID) then
break
end
currentQuestID = questID
end
if not HaveQuestData(currentQuestID) then
return 0, 0
local currentQuestID = QuestUtils_GetCurrentQuestLineQuest(782)
if currentQuestID == 0 or not HaveQuestData(currentQuestID) then
return 500, 500
end
local objectives = GetQuestObjectives(currentQuestID)
if not objectives or not objectives[1] then
Expand Down

0 comments on commit 6f279c0

Please sign in to comment.