Help Re-sizing MainMenuBar and MultiBars

Hello! I am trying to resize the entire bottom bar of the UI, as well as the two right action bars on Classic Era.

I have discovered the following commands, run via the chatbox or a macro, do exactly what I want:

/run MainMenuBar:SetScale(.9)
/run MultiBarLeft:SetScale(.9)
/run MultiBarRight:SetScale(.9)

However, it’s a bit tiresome to have to re-run this every login or loading screen. During my search for an answer, apparently some other random events (such as mounting) cause them to return to the standard scale - but I’m not a high enough level to see that yet.

I have tried to make a simple add-on to do this, but it isn’t doing anything. Here’s the code:

local EventFrame = CreateFrame("frame", "EventFrame")
EventFrame:RegisterEvent("PLAYER_ENTERING_WORLD")

local function CritMove()
    MainMenuBar:SetScale(.9)
    MultiBarLeft:SetScale(.9)
    MultiBarRight:SetScale(.9)

    /console XpBarText 0

end

EventFrame:SetScript("OnEvent", function(self, event, ...)
    if(event == "PLAYER_ENTERING_WORLD") then
        C_Timer.After(5, CritMove)
    end
end)

But nothing happens. I have tried adding ‘/run’ before each, with no difference. Can anyone spot what’s happening? I’ve tried playing with the time I am having it wait to perform the action, to let anything else load, but no effect. It would also be nice to ‘force’ them to stay that smaller scale, if that’s possible, incase the information about mounting causing them to change is true - obviously they’d stay that way unless I reload the UI to get the PLAYER_ENTERING_WORLD event to go off.

I know I can simply get a different add-on for bars, but I want the default UI (same style), just smaller bars. I haven’t found an up-to-date addon that can simply scale these bars.

Side note, I also want to hide the experience bar text - that console command works in-game, but not in the add-on. Any suggestions there?

/console XpBarText 0

Will not work in an addon.

C_CVar.SetCVar("xpBarText", "0")

Just in case there is something not right about your .toc file, you could copy/paste the code to the website addon.bool.no to create, download and install as any other addon.

2 Likes

Thanks for that info about the xpBarText!

You’re suggestion to use that website also worked, but I am dumbfounded why… it created an exact copy of what I had before, but with a different name for the .lua file. Otherwise, same lines throughout (aside from the name of the .lua file). I did change the Interface version to match Era, but that’s it. Strange.

The name of the .toc file must be the same as the name of the folder it is in.

The name of the .lua file(s) doesn’t matter so long as they’re listed in the .toc file.