Hello. I have a simple add-on (below) that scales the MainMenuBar, MultiBarLeft and MultiBarRight. It works perfectly, except when I change a page on the MainMenuBar, both MultiBarLeft & MultiBarRight rescale to normal size.
Is there a way to override the :SetScale() function so that it won’t re-scale after I change it the first time? Like re-define that function to do nothing?
-- Create frame to 'listen' for the event 'PLAYER_ENTERING_WORLD'.
-- This event happens every time the UI is reloaded or a loading zone is crossed.
local EventFrame = CreateFrame("frame", "EventFrame")
EventFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
local function CritMove()
-- Scale the main action bar and the two vertical bars on the right
MainMenuBar:SetScale(.9)
MultiBarLeft:SetScale(.9)
MultiBarRight:SetScale(.9)
-- Scale the entire minimap
MinimapCluster:SetScale(1.1)
-- Resize and move the player frame
PlayerFrame:ClearAllPoints()
PlayerFrame:SetScale(.9)
PlayerFrame:SetPoint("CENTER", UIParent, "CENTER", -250, -250)
PlayerFrame:SetUserPlaced(true)
-- Resize and move the target frame
TargetFrame:ClearAllPoints()
TargetFrame:SetScale(.9)
TargetFrame:SetPoint("CENTER", UIParent, "CENTER", 250, -250)
TargetFrame:SetUserPlaced(true)
-- Hide the text for the experience bar
C_CVar.SetCVar("xpBarText", "0")
end
-- Bind the frame created at the top to run five seconds after PLAYER_ENTERING_WORLD is triggered
EventFrame:SetScript("OnEvent", function(self, event, ...)
if(event == "PLAYER_ENTERING_WORLD") then
C_Timer.After(5, CritMove())
end
end)