Skip to content

Commit 07da8b6

Browse files
committed
Added preliminary support for Battleground Blitz
1 parent 9377c91 commit 07da8b6

File tree

3 files changed

+44
-67
lines changed

3 files changed

+44
-67
lines changed

REPorter.lua

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ local IsShiftKeyDown = _G.IsShiftKeyDown
1414
local IsAltKeyDown = _G.IsAltKeyDown
1515
local IsControlKeyDown = _G.IsControlKeyDown
1616
local IsInBrawl = _G.C_PvP.IsInBrawl
17+
local IsBrawlSoloRBG = _G.C_PvP.IsBrawlSoloRBG
1718
local IsRatedBattleground = _G.C_PvP.IsRatedBattleground
1819
local GetTime = _G.GetTime
1920
local GetBattlefieldInstanceRunTime = _G.GetBattlefieldInstanceRunTime
@@ -114,7 +115,7 @@ RE.BlinkPOIValue = 0.3
114115
RE.BlinkPOIUp = true
115116

116117
RE.FoundNewVersion = false
117-
RE.AddonVersionCheck = 2910
118+
RE.AddonVersionCheck = 21000
118119
RE.ScreenHeight, RE.ScreenWidth = _G.UIParent:GetCenter()
119120

120121
RE.MapSettings = {
@@ -127,7 +128,7 @@ RE.MapSettings = {
127128
[TP] = {["PlayerNumber"] = 10},
128129
[TOK] = {["PlayerNumber"] = 10},
129130
[SM] = {["PlayerNumber"] = 10, ["WidgetID"] = 1687},
130-
[DG] = {["PlayerNumber"] = 15, ["NodeTimer"] = 60, ["WidgetID"] = 2074},
131+
[DG] = {["PlayerNumber"] = 15, ["WidgetID"] = 2074},
131132
[TMVS] = {["PlayerNumber"] = 40},
132133
[SS] = {["PlayerNumber"] = 10, ["NodeTimer"] = 40},
133134
[BFW] = {["PlayerNumber"] = 40},
@@ -535,6 +536,18 @@ function RE:CreatePOI(index)
535536
end
536537

537538
function RE:TimerJoinCheck()
539+
RE.IsBrawl = IsInBrawl()
540+
RE.IsRated = IsRatedBattleground()
541+
542+
if IsBrawlSoloRBG() then
543+
RE:LoadMapSettings()
544+
RE.DefaultTimer = 30
545+
elseif RE.MapSettings[RE.CurrentMap].NodeTimer then
546+
RE.DefaultTimer = RE.MapSettings[RE.CurrentMap].NodeTimer
547+
else
548+
RE.DefaultTimer = 60
549+
end
550+
538551
if RE.CurrentMap ~= -1 and GetBattlefieldInstanceRunTime() / 1000 > 120 then
539552
RE.PlayedFromStart = false
540553
RE:OnPOIUpdate()
@@ -808,7 +821,7 @@ function RE:OnPOIUpdate()
808821
for _, v in pairs(RE.POINodes) do
809822
v.active = false
810823
end
811-
if RE.CurrentMap == EOTS and RE.IsRated then
824+
if RE.CurrentMap == EOTS and (RE.IsRated or RE.IsBrawl) then
812825
RE.POIList = GetAreaPOIForMap(EOTSR)
813826
elseif RE.CurrentMap == SS or RE.CurrentMap == CI then
814827
RE.POIList = GetVignettes()
@@ -841,7 +854,7 @@ function RE:OnPOIUpdate()
841854
RE.POIInfo.textureIndex = 2000
842855
end
843856
end
844-
elseif RE.CurrentMap == EOTS and RE.IsRated then
857+
elseif RE.CurrentMap == EOTS and (RE.IsRated or RE.IsBrawl) then
845858
RE.POIInfo = GetAreaPOIInfo(EOTSR, RE.POIList[i])
846859
else
847860
RE.POIInfo = GetAreaPOIInfo(RE.CurrentMap, RE.POIList[i])
@@ -1306,9 +1319,7 @@ end
13061319
function RE:Create()
13071320
_G.REPorterFrameCore:SetScript("OnUpdate", nil)
13081321
_G.REPorterFrameEstimator:ClearAllPoints()
1309-
_G.REPorterFrameEstimator:SetPoint("TOP", _G.UIWidgetTopCenterContainerFrame, "BOTTOM")
1310-
RE.IsBrawl = IsInBrawl()
1311-
RE.IsRated = IsRatedBattleground()
1322+
_G.REPorterFrameEstimator:SetPoint("TOP", _G.UIWidgetTopCenterContainerFrame, "BOTTOM", 0, -10)
13121323
RE.POINodes = {}
13131324

13141325
if RE.CurrentMap == IOC then
@@ -1324,12 +1335,6 @@ function RE:Create()
13241335
RE.EstimatorData = {0, 0, 0, 0, -1}
13251336
end
13261337

1327-
if RE.MapSettings[RE.CurrentMap].NodeTimer then
1328-
RE.DefaultTimer = RE.MapSettings[RE.CurrentMap].NodeTimer
1329-
else
1330-
RE.DefaultTimer = 60
1331-
end
1332-
13331338
if Contains({AV, BFG, IOC, AB, DG, SS, EOTS, BFW, CI, ASH, TOK}, RE.CurrentMap) then
13341339
RE.CareAboutNodes = true
13351340
if RE.CurrentMap == SS then
@@ -1615,12 +1620,17 @@ function RE:LoadMapSettings()
16151620

16161621
local textures
16171622
if RE.CurrentMap == AB and RE.IsBrawl then
1618-
if GetBestMapForUnit("player") == ABJ then
1623+
local currentMap = GetBestMapForUnit("player")
1624+
if currentMap == ABJ then
16191625
textures = GetMapArtLayerTextures(AB, 1)
1620-
else
1626+
RE.ZonesWithoutSubZones[AB] = true
1627+
elseif currentMap == ABW then
16211628
textures = GetMapArtLayerTextures(ABW, 1)
1629+
RE.ZonesWithoutSubZones[AB] = true
1630+
else
1631+
textures = GetMapArtLayerTextures(RE.CurrentMap, 1)
1632+
RE.ZonesWithoutSubZones[AB] = nil
16221633
end
1623-
RE.ZonesWithoutSubZones[AB] = true
16241634
else
16251635
textures = GetMapArtLayerTextures(RE.CurrentMap, 1)
16261636
RE.ZonesWithoutSubZones[AB] = nil

REPorter.toc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
## Interface: 100107
1+
## Interface: 100200
22
## Title: |cFF74D06CRE|rPorter
33
## Notes: Provide battleground map.
4-
## Version: 2.9.10
4+
## Version: 2.10.0
55
## Author: AcidWeb
66
## SavedVariables: REPorterSettings
77
## IconTexture: Interface\AddOns\REPorter\RELogo

TaintLess.xml

Lines changed: 16 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,42 @@
11
<Ui><Script><![CDATA[--[[
22
3-
TaintLess [23-05-18]
3+
TaintLess [23-09-09]
44
https://www.townlong-yak.com/addons/taintless
55
66
All rights reserved.
77
88
Permission is hereby granted to distribute unmodified copies of this file.
99
]]
1010
11-
local function purgeKey(t, k)
12-
local logLevel, c = GetCVar("taintLog"), -42
13-
if (tonumber(logLevel) or 0) > 1 then
14-
if CVarCallbackRegistry then
15-
CVarCallbackRegistry:UnregisterEvent("CVAR_UPDATE")
16-
end
17-
SetCVar("taintLog", "1")
18-
else
19-
logLevel = nil
20-
end
21-
t[k] = nil
22-
repeat
23-
if t[c] == nil then
24-
t[c] = nil
25-
end
26-
c = c - 1
27-
until issecurevariable(t, k)
28-
if logLevel then
29-
SetCVar("taintLog", logLevel)
30-
if CVarCallbackRegistry then
31-
CVarCallbackRegistry:RegisterEvent("CVAR_UPDATE")
32-
end
11+
local purgeKey do
12+
local e = {}
13+
function purgeKey(t, k)
14+
e.textures = t
15+
TextureLoadingGroupMixin.RemoveTexture(e, k)
3316
end
3417
end
3518
3619
local patch do
37-
local q, skips = {}, securecall(function()
20+
local skips = securecall(function()
3821
local cb, r, _, an = select(4,GetBuildInfo()), {moon="haunted"}
3922
r.moon, _, an = nil, issecurevariable(r, "moon")
40-
for m, v, clo, chi in (GetAddOnMetadata(an, "X-TaintLess-DisableMitigations") or ""):gmatch("([%a_]+)=(%d+):?(%d*):?(%d*)") do
23+
for m, v, clo, chi in (C_AddOns.GetAddOnMetadata(an, "X-TaintLess-DisableMitigations") or ""):gmatch("([%a_]+)=(%d+):?(%d*):?(%d*)") do
4124
if (clo == "" or cb >= clo+0) and (chi == "" or chi+0 >= cb) then
4225
r[m] = v + 0
4326
end
4427
end
4528
return r
4629
end)
4730
function patch(name, version, impl)
48-
if name == nil then
49-
for qf, v in pairs(q) do
50-
securecall(qf, v)
51-
end
52-
elseif not ((tonumber(_G[name]) or 0) >= version or skips and skips[name] == version) then
53-
_G[name], q[impl] = version, version
31+
if not ((tonumber(_G[name]) or 0) >= version or skips and skips[name] == version) then
32+
_G[name] = version
33+
securecall(impl, version)
5434
end
5535
end
5636
end
5737
5838
-- https://www.townlong-yak.com/addons/taintless/fixes/RefreshOverread
59-
patch("UIDD_REFRESH_OVERREAD_PATCH_VERSION", 3, function(V)
39+
patch("UIDD_REFRESH_OVERREAD_PATCH_VERSION", 5, function(V)
6040
hooksecurefunc("UIDropDownMenu_InitializeHelper", function()
6141
for i=1, UIDD_REFRESH_OVERREAD_PATCH_VERSION == V and UIDROPDOWNMENU_MAXLEVELS or 0 do
6242
for j=1+_G["DropDownList" .. i].numButtons, UIDROPDOWNMENU_MAXBUTTONS do
@@ -69,7 +49,7 @@ patch("UIDD_REFRESH_OVERREAD_PATCH_VERSION", 3, function(V)
6949
end)
7050
7151
-- https://www.townlong-yak.com/addons/taintless/fixes/DisplayModeTaint
72-
patch("UIDROPDOWNMENU_OPEN_PATCH_VERSION", 1, function(V)
52+
patch("UIDROPDOWNMENU_OPEN_PATCH_VERSION", 3, function(V)
7353
hooksecurefunc("UIDropDownMenu_InitializeHelper", function(frame)
7454
if UIDROPDOWNMENU_OPEN_PATCH_VERSION == V
7555
and UIDROPDOWNMENU_OPEN_MENU and UIDROPDOWNMENU_OPEN_MENU ~= frame
@@ -79,19 +59,8 @@ patch("UIDROPDOWNMENU_OPEN_PATCH_VERSION", 1, function(V)
7959
end)
8060
end)
8161
82-
-- https://www.townlong-yak.com/addons/taintless/fixes/IOFrameSelection
83-
patch("IOFRAME_SELECTION_PATCH_VERSION", 5, function(V)
84-
if type(InterfaceOptionsFrame) == "table" and type(InterfaceOptionsFrame.HookScript) == "function" then
85-
InterfaceOptionsFrame:HookScript("OnHide", function()
86-
if IOFRAME_SELECTION_PATCH_VERSION == V then
87-
InterfaceOptionsFrameCategories.selection = nil
88-
end
89-
end)
90-
end
91-
end)
92-
9362
-- https://www.townlong-yak.com/addons/taintless/fixes/EditModeOpenDrop
94-
patch("EDITMAN_OPENDROP_PATCH_VERSION", 3, function(V)
63+
patch("EDITMAN_OPENDROP_PATCH_VERSION", 5, function(V)
9564
if not (type(EditModeManagerFrame) == "table" and
9665
type(EditModeManagerFrame.GetAttribute) == "function" and
9766
type(FriendsFrameStatusDropDown) == "table") then
@@ -117,7 +86,7 @@ patch("EDITMAN_OPENDROP_PATCH_VERSION", 3, function(V)
11786
end)
11887
11988
-- https://www.townlong-yak.com/addons/taintless/fixes/ObjectiveTrackerUpdate
120-
patch("OBJTRACK_DELAYUPDATE_PATCH_VERSION", 3, function(V)
89+
patch("OBJTRACK_DELAYUPDATE_PATCH_VERSION", 5, function(V)
12190
if not (type(ObjectiveTrackerFrame) == "table" and
12291
type(ObjectiveTrackerFrame.HeaderMenu) == "table" and
12392
type(ObjectiveTrackerFrame.HeaderMenu.Title) == "table") then
@@ -134,8 +103,7 @@ patch("OBJTRACK_DELAYUPDATE_PATCH_VERSION", 3, function(V)
134103
end)
135104
hooksecurefunc("ObjectiveTracker_Update", function()
136105
if OBJTRACK_DELAYUPDATE_PATCH_VERSION == V and didDelayUpdate then
137-
didDelayUpdate = nil
138-
purgeKey(ObjectiveTrackerFrame, "isUpdating")
106+
ObjectiveTrackerFrame.isUpdating, didDelayUpdate = nil
139107
end
140108
end)
141109
hooksecurefunc(ObjectiveTrackerFrame.HeaderMenu.Title, "ClearAllPoints", function()
@@ -154,5 +122,4 @@ patch("OBJTRACK_DELAYUPDATE_PATCH_VERSION", 3, function(V)
154122
end)
155123
end)
156124
157-
patch()
158125
]]></Script></Ui>

0 commit comments

Comments
 (0)