Dependency Conflict
Hey I'm currently making a mod, well its more like a script, that configures the default MainMenuBar into a config I like. I'm having Issues with moving the menu buttons around. First of all here's teh code for moving the buttons:
Code:
-- micro menu buttons Code:
Message: Interface\\FrameXML\\MainMenuBarMicroButtons.lua:171: AchievementMicroButton:SetPoint(): TalentMicroButton is dependent on this |
When you hide a frame like that you remove the possibility for other frames to anchor to them, you are hiding a frame thats in the default UI and could be needed for more stuff than you know about.
You should find another way to do this without using the Hide() function, maby you can position the frames off the screen or maby use the SetAlpha() function ? |
Ok I tried implementing :
Code:
LFGMicroButton:ClearAllPoints(); Code:
Message: Interface\FrameXML\MainMenuBarMicroButtons.lua:171: AchievementMicroButton:SetPoint(): TalentMicroButton is dependent on this |
Quote:
The problem is that AchievementMicroButton_Update anchors QuestLogMicroButton to AchievementMicroButton and UpdateTalentButton anchors AchievementMicroButton to TalentMicroButton. Since Blizzard doesn't call ClearAllPoints before calling SetPoint (didn't really need to) and you are anchoring TalentMicroButton to QuestLogMicroButton in your code it creates a circular logic issue with respect to anchoring. The easiest solution would be just to do something like: AchievementMicroButton_Update = function() end |
Ah thank you very much, I got it kluged together now. Its not pretty but it works and doesn't throw any errors. I doubt its very efficient cause I'm new to coding in general. Here's what I got for code:
Code:
function OnLoad() Cheers! |
1. use self instead of this
2. make your functions local instead of polluting the global namespace with nondescript/generic function names - they will get overwritten (unless you're calling them from an xml file but they're located in a lua file - then they'll need to be global - but at least make them less generic and specific to your addon) 3. semicolons (;) are unnecessary in lua 4. are you passing the event arg to your OnEvent function? Then you need to tell the function how to find the event variable (ie, OnEvent(self,event)) 5. you actually don't even need to pass those arguments and check for the event, though, because you're not doing different things based on event. Just call your code in OnEvent straight out |
Quote:
Code:
local function DoNothing() end |
OMG Thank you so much, I have no idea what half of that does but it works great. Kudos
|
You could also try this on a frame you want to hide.
frame:EnableMouse(false) frame:SetAlpha(0) Not that using Vrul's code might want to mess up the vehicle UI. nMainbar is what I am currently using to make the mainbar nicer, and it does not mess up the vehicle UI. |
All times are GMT -6. The time now is 01:52 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI