So i noticed that my UI builds up mem usage every step you take and continues to do so till it hits some sort of garbage dump threshold and then starts over. Its primarily as you move. SO i think it has to do with my minimap and the coordinates. Can someone take a look at this and tell me maybe whats happening here and why its building so much mem up constantly? Is this normal? lol.
lua Code:
local module = GrimUI:RegisterModule("MiniMap")
-- Minimap
Minimap:ClearAllPoints()
Minimap:Show()
Minimap:SetPoint("BOTTOM", UIParent, 0, 11)
Minimap:SetHeight(132)
Minimap.SetHeight = GrimUI.Dummy
Minimap:SetBackdropBorderColor(nil, nil, nil, nil)
Minimap.SetBackdropBorderColor = GrimUI.Dummy
Minimap:SetMaskTexture([[Interface\AddOns\!GrimUI\Art\Masks\Mask-SQUARE]])
Minimap.ClearAllPoints = GrimUI.Dummy
Minimap.SetPoint = GrimUI.Dummy
Minimap.Hide = GrimUI.Dummy
Minimap.SetWidth = GrimUI.Dummy
Minimap.SetMaskTexture = GrimUI.Dummy
Minimap:SetScale(0.95)
Minimap:EnableMouseWheel(true)
Minimap:SetScript("OnMouseWheel", function(self, arg1)
if(arg1 < 0) then
Minimap_ZoomIn()
else
Minimap_ZoomOut()
end
end)
MinimapCluster:ClearAllPoints()
MinimapCluster:SetPoint("BOTTOM", UIParent, 0, 11)
MinimapCluster:SetHeight(2)
MinimapCluster.SetPoint = GrimUI.Dummy
MinimapCluster.SetHeight = GrimUI.Dummy
Minimap:SetScript("OnMouseUp", function(self, btn)
if btn == "RightButton" then
if ( WorldMapFrame:IsVisible() ) then
HideUIPanel(WorldMapFrame);
else
ShowUIPanel(WorldMapFrame);
end
elseif btn == "MiddleButton" then
_G.ToggleDropDownMenu(1, nil, _G.MiniMapTrackingDropDown, self)
else
_G.Minimap_OnClick(self)
end
end)
-- Start Cords Frame
local GUICordsFrame = CreateFrame('Button', "GUICordsFrame", UIParent)
GUICordsFrame:SetPoint("BOTTOM", UIParent, "BOTTOM", 0, 0)
GUICordsFrame:SetHeight(11)
GUICordsFrame:SetWidth(80)
GUICordsFrame:RegisterForClicks('LeftButtonUp', 'RightButtonUp')
GUICordsFrame:RegisterEvent("MINIMAP_ZONE_CHANGED")
GUICordsFrame:RegisterEvent("ZONE_CHANGED")
GUICordsFrame:RegisterEvent("ZONE_CHANGED_INDOORS")
GUICordsFrame:RegisterEvent("ZONE_CHANGED_NEW_AREA")
GUICordsFrame.elapsed = 1
local GUICordsFrameBG = GUICordsFrame:CreateTexture(nil, "BACKGROUND")
GUICordsFrameBG:SetTexture(0, 0, 0, .8)
GUICordsFrameBG:SetAllPoints(GUICordsFrame)
local GUICordsFrameText = GUICordsFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
GUICordsFrameText:SetPoint("CENTER", GUICordsFrame, "CENTER", 0, 1)
GUICordsFrameText:SetTextColor(1, 1, 1, 1)
GUICordsFrameText:SetFont("Fonts\\FRIZQT__.TTF", 10, "NORMAL")
GUICordsFrameText:SetJustifyH("CENTER")
GUICordsFrame:SetScript("OnUpdate", function(self)
local x,y = GetPlayerMapPosition("player")
if (x == 0) and (y == 0) and not IsInInstance() then
SetMapToCurrentZone()
local x,y = GetPlayerMapPosition("player")
end
GUICordsFrameText:SetText(format("%.2f %.2f", 100*x, 100*y))
end)
GUICordsFrame:SetScript("OnEvent", function(self)
if not WorldMapFrame:IsVisible() then
SetMapToCurrentZone()
end
end)