ElvUI WindTools

ElvUI WindTools

3M Downloads

[Bug] Eventtracker overlaps when switch from Big to Small Map or Questlog

fubaWoW opened this issue ยท 4 comments

commented

Describe the bug
Your Event Tracker Bars overlap when the World Map Frame when switch from Full to Small Map or Quest Log!
I know it's correctly aligned if you "Re-Open" the map, but take a look at the end -> Additional context

Screenshots
image

Additional context
Maybe you can take a look into CVAR_UPDATE and the arg1 miniWorldMap
So you can Resize your Event Tracker every time miniWorldMap changes!

Just run ET:UpdateTrackers() every time the CVar miniWorldMap changes

i did a little "fix" for myself with this code:

local f = CreateFrame("FRAME")
f:RegisterEvent("CVAR_UPDATE")

f:SetScript("OnEvent", function(self, event, arg1)
	if event == "CVAR_UPDATE" and arg1 == "miniWorldMap" then
		local ET = WindTools[1]:GetModule("EventTracker")
		if ET then
			C_Timer.After(0.01, function()
				ET:UpdateTrackers()
			end)
		end
	end
end)
commented

hmm, actually I totoally forget world map can be maximized, I don't see people use that feature before.
but yeah, I will add a fix based on your solution! thanks~

commented

found a "better" way because the event CVAR_UPDATE does not trigger properly:

if not WindTools then return end

local function UpdateTracker()
	local ET = WindTools[1]:GetModule("EventTracker")
	if ET then C_Timer.After(0.01, function() ET:UpdateTrackers() end) end
end

local function RegisterEvents(...)
	for i = 1, select("#", ...) do
		EventRegistry:RegisterCallback(select(i, ...), UpdateTracker)
	end
end

RegisterEvents("WorldMapOnShow", "WorldMapMinimized", "WorldMapMaximized")
commented

You better use my 2nd Method with EventRegistry:RegisterCallback, as mentioned before, because the CVAR_UPDATE does not trigger properly all the time.

commented

@fubaWoW
Yeah, new event system maybe better!
Fixed in 6e7e1ab