MBB

16 - MBB does not find all my buttons

MBB does not find all my buttons in version 1.20 and had the same problem as of version 1.12. It is because you removed the code which is in, MBB_NotSureIfThisIsNeeded(). Everything works okay if I go back to version 0.63 and just fix some code that cataclysm broke.

For example, MBB is not collecting the minimap buttons for outfitter, healbot, monkeybuddy, and more. Outfitter and monkey are considered minimap background buttons (local additional = {MinimapBackdrop:GetChildren()}). Healbot is considered a button inside a child (for _,subchild in ipairs({child:GetChildren()})). Some addons use mouse events instead of clicking (if( hasClick or hasMouseUp or hasMouseDown )).

To help, you can move what you had in MBB_NotSureIfThisIsNeeded() and put in OnUpdate() so it finds all buttons. I made some changes so it makes more sense for the OnUpdate() routine since different from being in the OnEvent() routine.

function MBB_OnUpdate(elapsed)
...
  local children = {Minimap:GetChildren()};
  local additional = {MinimapBackdrop:GetChildren()};
  for _,child in ipairs(additional) do
   table.insert(children, child);
  end
  for _,child in ipairs(MBB_Include) do
   local childframe = _G[child]
   if( childframe ) then
    table.insert(children, childframe);
   end
  end
  for _,child in ipairs(children) do
   if( not child.oshow and child:GetName() and not MBB_IsKnownButton(child:GetName(), 3) ) then
    if( not child:HasScript("OnClick") ) then
     for _,subchild in ipairs({child:GetChildren()}) do
      if( subchild:HasScript("OnClick") ) then
       child = subchild;
       child.hasParentFrame = true;
       break;
      end
     end
    end
    local hasClick, hasMouseUp, hasMouseDown, hasEnter, hasLeave = MBB_TestFrame(child:GetName());
    if( hasClick or hasMouseUp or hasMouseDown ) then
     MBB_PrepareButton(child:GetName());
     if( not MBB_IsInArray(MBB_Exclude, child:GetName()) ) then
      MBB_AddButton(child:GetName());
      MBB_SetPositions();
     end
    end
   end
User When Change
karlsnyder Sep 14, 2012 at 13:08 UTC Changed assigned to from Pericles to karlsnyder
jtbalogh Jan 08, 2012 at 16:57 UTC Changed description:
  For example, MBB is not collecting the minimap buttons for outfitter, healbot, monkeybuddy, and more. Outfitter and monkey are considered minimap background buttons (local additional = {MinimapBackdrop:GetChildren()}). Healbot is considered a button inside a child (for _,subchild in ipairs({child:GetChildren()})). Some addons use mouse events instead of clicking (if( hasClick or hasMouseUp or hasMouseDown )).

- To help, you can move what you had in MBB_NotSureIfThisIsNeeded() and put in OnUpdate() so it finds all buttons.
+ To help, you can move what you had in MBB_NotSureIfThisIsNeeded() and put in OnUpdate() so it finds all buttons. I made some changes so it makes more sense for the OnUpdate() routine since different from being in the OnEvent() routine.

  [code]
  function MBB_OnUpdate(elapsed)
jtbalogh Jan 08, 2012 at 16:56 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

Facts

Last updated
Sep 14, 2012
Reported
Jan 08, 2012
Status
New - Issue has not had initial review yet.
Type
Defect - A shortcoming, fault, or imperfection
Priority
Medium - Normal priority.
Votes
0

Reported by

Possible assignees